Sample
JetBrains/i7
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 55.1Δ 3.4 |
| Scalabrino | 0.297 | 0–1; higher is more readable | 13.6Δ 38.1 |
| Dorn | 0.602 | 0–1; higher is more readable | 71.2Δ 19.5 |
| Mi | 0.501 | 0–1; higher is more readable | 53.4Δ 1.7 |
| LLOC | 18 | Logical lines; fewer is more readable | 29.7Δ 22.0 |
| DeepSeek V4 Pro | 14.67 | 0–20; mean of three runs | 40.3Δ 11.4 |
| GPT-6.1 Sol | 15.33 | 0–20; mean of three runs | 17.8Δ 33.9 |
| BTTF | 0.492 | 0–1; higher is more readable | 64.4Δ 12.7 |
| Human | 0.73 | 0–1; original rating | 51.7 |
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. | 783.197 | −25.846 |
| Source linesThe number of non-empty source lines. | 27 | +10.8 |
| 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.221 | −4.832 |
Intercept 8.87 + feature contributions = -11.008 (log-odds).
Score = sigmoid(-11.008) = 0.
| Score | 0.297 |
|---|
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. | 59 | +1.166 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 27 | −0.199 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 27 | +0.197 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 25 | +0.151 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.109 | −0.117 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 25.683 | −0.051 |
Intercept 0.07 + feature contributions = 0.414 (log-odds).
Score = sigmoid(0.414) = 0.602.
| Score | 0.501 |
|---|
| Score | 18 |
|---|
Run 1
The code is straightforward and readable. The structure is logical, moving from input generation to bit summation, primality check, and output. Nesting is shallow (maximum two levels), which helps maintain clarity. Each loop and conditional has a clear purpose, and actions are generally one per line. However, there are minor readability issues: 'isPrime' is computed for every number, including 0 and 1 (for which the loop doesn’t run), and the variable names like 'sum' and 'isPrime' are slightly generic. Extracting the bit-counting and prime-checking into helper methods would improve clarity and modularity, but as-is, the code remains easy to follow for a small utility.
Run 2
The code is logically organized and follows a clear sequence: convert to binary, count ones, check primality, and print. However, several readability issues reduce the score. The nesting depth is moderate but could be flatter; the primality check uses an unnecessary boolean variable and fails for sum = 2 (returns true incorrectly, though the loop still works for that case). Variable names like 'k' and 'j' are less descriptive. The code length is fairly concise, but extracting helper methods (e.g., isPrime, countBits) would improve clarity and reduce nested logic. Action granularity is mostly one action per line, which is good. The reading flow is natural top-to-bottom, but the primality logic would benefit from early return or a separate method. Overall, the code is understandable but lacks clean decomposition and has a minor logic edge case.
Run 3
The code is logically organized with clear separation of concerns: binary conversion, counting bits, prime checking, and output. Nesting is moderate with one inner loop and a second loop for prime validation. Intent is understandable but would benefit from helper method names like 'isPrime' or 'countSetBits' to self-document the logic. The code is concise but lacks guard clauses for edge cases (e.g., sum < 2). Action granularity is good, one statement per line. Reading flow is natural top-to-bottom, but the prime-check loop starts at 2, which is inefficient and slightly unclear for sum=1 or 0. Overall, readable but not highly polished.
Run 1
Code Structure: The program logically groups iteration, counting binary ones, primality testing, and output, though helper methods would separate responsibilities better. Nesting: Loop-and-conditional nesting is moderate and easy to follow. Clarity of intent: The class name and binary conversion suggest the purpose, but 'sum' would be clearer as 'bitCount', and the pernicious-number condition is not explained. The primality check incorrectly treats counts of 0 and 1 as prime, making its behavior inconsistent with its apparent intent. Code length: Compact without unnecessary verbosity, although standard bit-counting utilities could simplify it. Action granularity: Each statement performs one clear action; loop headers use conventional syntax. Reading flow: Consistent formatting and blank lines provide a natural progression through the algorithm.
Run 2
Code Structure: Logically organized into binary conversion, bit counting, primality testing, and output, but helper methods would separate responsibilities better. Nesting: Moderate nesting is easy to follow, though loops containing conditionals add depth. Clarity of intent: The class name and operations suggest finding pernicious numbers, but 'sum' would be clearer as 'setBitCount'. Initializing isPrime to true without rejecting counts below 2 incorrectly treats 0 and 1 as prime, undermining intent. Code length: Compact without unnecessary verbosity; Integer.bitCount could simplify counting. Action granularity: Each statement performs one clear action. Reading flow: Consistent indentation and blank lines make the progression natural, although named helper methods would make the algorithm easier to scan.
Run 3
Code Structure: The counting, primality checking, and printing stages are logically grouped, though helper methods would improve separation. Nesting: Moderate nesting of loops and conditionals remains manageable. Clarity of intent: Binary conversion and counting are clear, but 'sum' would be clearer as 'oneCount', and the definition of a pernicious number is implicit. The primality check also incorrectly treats counts of 0 and 1 as prime, undermining confidence in the expressed intent. Code length: Compact without unnecessary verbosity. Action granularity: Each statement performs a single action, with conventional loop headers. Reading flow: Execution proceeds naturally from conversion to counting to testing to output, supported by whitespace between stages.