Sample

JetBrains/b13

Human rating uses the original dataset scale.

DatasetJetBrains
Human0.9
Lines16

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
66.9Δ 10.6
Scalabrino0.5520–1; higher is more readable
38.1Δ 39.4
Dorn0.7060–1; higher is more readable
87.3Δ 9.7
Mi0.4430–1; higher is more readable
43.2Δ 34.3
LLOC11Logical lines; fewer is more readable
63.6Δ 14.0
DeepSeek V4 Pro150–20; mean of three runs
43.6Δ 33.9
GPT-6.1 Sol17.330–20; mean of three runs
58.5Δ 19.1
BTTF0.4250–1; higher is more readable
33.1Δ 44.5
Human0.90–1; original rating
77.5

Views

Source code

public class EvilNumbers { public static void main(String[] args) { for(int i = 0; i <= 1000; i++) { String binary = Integer.toBinaryString(i); int ones = 0; for(int j = 0; j < binary.length(); j++) { if(binary.charAt(j) == '1') { ones++; } } if(ones % 2 == 0) { System.out.println(i); } } } }

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(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.548.159−18.089
Source linesThe number of non-empty source lines.16+6.4
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.436−5.154

Intercept 8.87 + feature contributions = -7.973 (log-odds).
Score = sigmoid(-7.973) = 0.

Score0.552

Feature contributions

FeatureValueContribution
(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.58+1.209
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
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.125−0.268
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.14.864−0.202
Indentation frequencyHow rapidly indentation changes from line to line.16−0.184
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.16+0.054

Intercept 0.07 + feature contributions = 0.875 (log-odds).
Score = sigmoid(0.875) = 0.706.

Score0.443
Score11
Run 1

The code is highly readable due to its clear structure and straightforward logic. It is well-organized with a main method containing two simple loops. Nesting is minimal—only two levels deep—which keeps the code flat and easy to follow. The intent is unambiguous: find and print 'evil numbers' (numbers with an even number of 1s in binary) up to 1000. Variable names like 'binary' and 'ones' clearly describe their purpose. Code length is concise and avoids unnecessary complexity. Each line performs a single, clear action, improving granularity. The reading flow is natural, progressing from iteration to binary conversion, counting, and conditional output. Minor improvements could include adding a comment explaining 'evil numbers' or extracting the even-ones check into a helper method, but the code is already very readable.

Run 2

The code is generally readable due to its simple structure and clear purpose. It uses straightforward loops and conditionals without deep nesting. Action granularity is acceptable, with one main operation per line in most cases. However, the code length could be reduced by using `Integer.bitCount(i)` instead of manually counting ones in the binary string, which would improve clarity and conciseness. The variable name `ones` is clear enough. The class name `EvilNumbers` is somewhat vague about context, and the lack of comments or formatting makes the code less self-documenting. Overall, logic is easy to follow but could be more concise and expressive.

Run 3

The code is reasonably clear but overly complex for its purpose. The structure is logical, with a separate method and a straightforward loop to find evil numbers; however, it could be simplified by replacing the inner loop and 'ones' counter with a single call like Integer.bitCount(i). Nesting is low but present due to the inner loop and if-statement, which reduces readability. Clarity of intent is acceptable: the code is about binary ones counting and even parity, though the term 'Evil' is not explained. Code length is slightly long for the task; using bitCount would cut lines. Action granularity is mostly one action per line, which is good. Reading flow is natural and linear. Overall, readable but not idiomatic or concise.

Run 1

Code Structure: Logically organized into number iteration, binary conversion, bit counting, and output. Nesting: Moderate nesting from two loops and a conditional, but each block is short and easy to follow. Clarity of intent: Descriptive variables make the mechanics clear, though the mathematical meaning of 'evil numbers' and the inclusive limit of 1000 are unexplained. Code length: Concise, with no unnecessary code. Action granularity: Each statement performs one clear action; loop headers use conventional syntax. Reading flow: Natural top-to-bottom progression with consistent indentation, although spacing around control statements could improve readability.

Run 2

Code Structure: Logically organized into iteration, binary conversion, bit counting, and output. Nesting: Moderate nesting from two loops and a conditional, but easy to follow. Clarity of intent: Descriptive names such as binary and ones clarify the operations; a brief explanation of evil numbers would clarify the overall purpose. Code length: Concise, with no unnecessary code. Action granularity: Each statement performs one clear action. Reading flow: The sequence naturally progresses from generating a number's binary representation to testing parity and printing matches. Minor readability improvements include consistent spacing around control statements and naming the upper-bound constant.

Run 3

Code Structure: Logically organized into number iteration, binary conversion, counting, and output. Nesting: Moderate nesting from two loops and a conditional, but easy to follow. Clarity of intent: Descriptive variables and the class name convey the purpose, though a brief explanation of evil numbers would help unfamiliar readers. Code length: Concise without unnecessary operations or boilerplate beyond Java requirements. Action granularity: Each statement performs a single clear action; loop headers use standard conventions. Reading flow: Execution proceeds naturally from conversion to counting to parity checking. Minor improvements include conventional spacing around control statements and naming the upper bound.