Sample
MBJP/3
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0.18 | 0–1; higher is more readable | 68.8Δ 25.0 |
| Scalabrino | 0.942 | 0–1; higher is more readable | 87.5Δ 6.2 |
| Dorn | 0.772 | 0–1; higher is more readable | 75.0Δ 18.8 |
| Mi | 0.755 | 0–1; higher is more readable | 75.0Δ 18.8 |
| LLOC | 8 | Logical lines; fewer is more readable | 62.5Δ 31.2 |
| DeepSeek V4 Pro | 16.67 | 0–20; mean of three runs | 56.2Δ 37.5 |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs | 65.6Δ 28.1 |
| BTTF | 0.714 | 0–1; higher is more readable | 87.5Δ 6.2 |
| Human | 5 | 1–5; original rating | 93.8 |
Views
Loading feature diagnosis…
Source regions
Feature contributions
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones. | 468.851 | −15.472 |
| Source linesThe number of non-empty source lines. | 28 | +11.2 |
| Byte entropyHow varied the bytes in the source text are. Repeated bytes give a lower value; a more even mixture gives a higher value. | 4.078 | −6.116 |
Intercept 8.87 + feature contributions = -1.518 (log-odds).
Score = sigmoid(-1.518) = 0.18.
| Score | 0.942 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Identifier layout (horizontal)How rapidly the visual pattern of identifier characters changes from left to right. It measures spatial frequency, not the meaning of the names. | 61 | +1.082 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 58.893 | +0.146 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 19 | −0.08 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 28 | +0.045 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 26.952 | −0.033 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 19 | −0.015 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.097 | +0.003 |
Intercept 0.07 + feature contributions = 1.217 (log-odds).
Score = sigmoid(1.217) = 0.772.
| Score | 0.755 |
|---|
| Score | 8 |
|---|
Run 1
The code is well-structured, with a clear class and method name that directly convey intent. Nesting is minimal, using early returns to avoid unnecessary indentation. The action granularity is appropriate, though the loop body could be slightly more compact. The logic for identifying non-prime numbers is straightforward and readable. The redundant import statements and over-commented Javadoc are minor issues but don't significantly affect readability. Overall, the code is concise, flows naturally, and requires no additional explanation.
Run 2
The code is well-structured, with a single class and method that clearly implement the prime-checking logic. Nesting is minimal (one level), and intent is straightforward: return true if the number is non-prime. The use of Math.sqrt(n) as the loop bound is efficient and readable. Variable names are concise but clear. The main weakness is that the logic is inverted relative to the method name — the function returns true for non-prime numbers, but the loop checks for divisibility to return true, which can be slightly counterintuitive. Additionally, the imported packages (java.io, java.lang, java.math) are unused, adding unnecessary noise. Overall, the code is easy to follow but could be improved by removing unused imports and perhaps renaming or restructuring to make the non-prime detection more explicit.
Run 3
The code is well-structured and readable. It uses clear naming (isNotPrime, n, i), a flat control flow with only one level of nesting, and a concise loop that directly expresses the primality check. The method is short, has a single responsibility, and the action granularity is good—each line does one logical step. The included Javadoc with examples clarifies intent. Minor deductions: the import statements are unnecessary and add clutter, and the primitive wrapper Boolean could be replaced with boolean for consistency. The loop bound Math.sqrt(n) is recalculated per iteration, but this is a minor efficiency not readability issue. Overall, the code is straightforward and easy to follow.
Run 1
Code Structure: A single focused method is logically organized into an edge-case check, divisor search, and final result. Nesting: Shallow nesting and early returns keep control flow easy to follow. Clarity of intent: The class and method names clearly express the purpose, reinforced by examples; however, the documentation could clarify that numbers less than 2 are considered non-prime. Code length: The implementation is concise, though unused wildcard imports add clutter. Action granularity: Each statement performs one clear action, with conventional loop syntax. Reading flow: Consistent formatting and a natural top-to-bottom progression make the code easy to read. Minor distractions include the malformed documentation marker and using boxed Boolean rather than primitive boolean.
Run 2
Code Structure: The single method is logically organized, with an edge-case check followed by divisor testing. Nesting: Shallow nesting and early returns keep control flow easy to follow. Clarity of intent: The class and method names, documentation, and examples clearly communicate the non-prime check. Code length: The implementation is concise, though unused wildcard imports and the redundant java.lang import add clutter. Action granularity: Each statement performs one clear action. Reading flow: Conventional formatting and a natural progression from edge cases to testing to the final result make the code readable. Minor distractions include the malformed documentation marker and using boxed Boolean rather than primitive boolean.
Run 3
Code Structure: A single, well-organized method separates the edge case, divisor search, and final result. Nesting: Shallow nesting and early returns keep the logic easy to follow. Clarity of intent: The class and method names clearly identify the purpose, and examples document expected behavior; the stray asterisk in the comment slightly reduces polish. Code length: The implementation is concise, though unused wildcard imports add clutter. Action granularity: Statements generally perform one action each; the conventional loop header remains readable. Reading flow: Execution proceeds naturally from handling numbers at or below one to checking divisors and returning the result.