Sample
JetBrains/b7
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 41.5Δ 19.9 |
| Scalabrino | 0.361 | 0–1; higher is more readable | 17.8Δ 43.6 |
| Dorn | 0.59 | 0–1; higher is more readable | 68.6Δ 7.2 |
| Mi | 0.491 | 0–1; higher is more readable | 50.8Δ 10.6 |
| LLOC | 17 | Logical lines; fewer is more readable | 34.3Δ 27.1 |
| DeepSeek V4 Pro | 13.33 | 0–20; mean of three runs | 28.0Δ 33.5 |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs | 26.7Δ 34.7 |
| BTTF | 0.45 | 0–1; higher is more readable | 43.2Δ 18.2 |
| Human | 0.8 | 0–1; original rating | 61.4 |
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. | 797.289 | −26.311 |
| Source linesThe number of non-empty source lines. | 23 | +9.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. | 3.484 | −5.226 |
Intercept 8.87 + feature contributions = -13.466 (log-odds).
Score = sigmoid(-13.466) = 0.
| Score | 0.361 |
|---|
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. | 55.957 | +1.295 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 1 | +1.001 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 1 | −0.703 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.126 | −0.283 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 23 | −0.107 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 21.842 | −0.105 |
Intercept 0.07 + feature contributions = 0.365 (log-odds).
Score = sigmoid(0.365) = 0.59.
| Score | 0.491 |
|---|
| Score | 17 |
|---|
Run 1
The code is generally structured clearly with straightforward loops and conditional logic. Nesting is minimal, and each action is relatively granular. However, the intent is not purposefully conveyed: 'sum' and 'isPrime' are vague, and the logic for prime checking is simplistic and not separated into methods. Loops are a bit long and repetitive, reducing readability for larger ranges. The code could benefit from method extraction and semantic naming.
Run 2
The code is logically structured and easy to follow at a high level: it generates numbers, computes the binary ones count, checks if the count is prime, and prints qualifying numbers. Nesting is shallow, with only two nested loops inside the main loop, and each action is clearly separated by line. However, readability is reduced by embedding the prime-checking logic and binary processing directly in the main method, which mixes levels of abstraction and obscures the overall intent. Variable names like 'sum' and 'isPrime' are fairly clear, but 'sum' would be better named 'popCount' or 'oneCount' to reflect its purpose. The prime-checking loop uses `sum / 2` which is slightly less intuitive than `Math.sqrt(sum)`. Overall, the code is decently readable for a small script-style task, but could benefit from helper methods and clearer naming.
Run 3
The code is functional but has moderate readability issues. Structure is straightforward but monolithically contained in main. Nesting is acceptable—only two levels deep. Intent is somewhat clear but not explicit: 'pernicious number' concept is not evident from variable names. Code length is reasonable but could be shorter with helper methods. Action granularity is mostly one action per line, which is good. Reading flow is decent but interrupted by inline prime-check logic. Major issues: prime-checking loop condition uses sum/2 without handling sum < 2 cleanly; checking sum > 1 only after full prime loop is inefficient; no separation of concerns. Overall, the logic works for small ranges but lacks modularity, making it less maintainable. Could be improved by extracting isPrime() and countSetBits() methods for clarity and reuse.
Run 1
Code Structure: Logically organized into counting set bits, checking primality, and printing results, though helper methods would better separate these responsibilities. Nesting: Moderate nesting from loops and conditionals is manageable but adds some reading effort. Clarity of intent: The class name and binary conversion suggest the purpose; however, sum is less descriptive than setBitCount, and the significance of the 10000 limit is unexplained. Code length: Concise overall, though Integer.bitCount could replace the string-based counting loop. Action granularity: Each statement performs a single clear action, with no densely packed operations. Reading flow: Execution proceeds naturally from candidate selection to counting, testing, and output; spacing between these stages would improve visual readability.
Run 2
Code Structure: Logically organized into binary conversion, counting set bits, checking primality, and printing results, though helper methods would separate responsibilities more clearly. Nesting: Moderate nesting from loops and conditionals is manageable but adds visual depth. Clarity of intent: The algorithm is understandable, but names such as sum and j are generic; setBitCount would communicate intent better. Code length: Compact without unnecessary verbosity, although Integer.bitCount could simplify the counting step. Action granularity: Statements generally perform one action per line; conventional loop headers remain easy to read. Reading flow: Execution follows a natural sequence, with consistent indentation, but blank lines between processing stages would improve scanning.
Run 3
Code Structure: Logically organized into binary conversion, counting set bits, primality testing, and printing, though helper methods would better separate responsibilities. Nesting: Moderate nesting from loops and conditionals remains easy to follow. Clarity of intent: The class name and isPrime convey purpose, but sum would be clearer as setBitCount, and the upper limit is unexplained. Code length: Compact without unnecessary verbosity. Action granularity: Most lines perform one clear action; conventional loop headers do not hinder readability. Reading flow: The sequential progression is natural, with consistent indentation, although blank lines between processing stages would improve scanning.