Sample

JetBrains/b59

Human rating uses the original dataset scale.

DatasetJetBrains
Human0.7
Lines24

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
46.6Δ 4.2
Scalabrino0.7450–1; higher is more readable
60.2Δ 17.8
Dorn0.5890–1; higher is more readable
66.9Δ 24.6
Mi0.510–1; higher is more readable
55.9Δ 13.6
LLOC17Logical lines; fewer is more readable
34.3Δ 8.1
DeepSeek V4 Pro13.330–20; mean of three runs
28.0Δ 14.4
GPT-6.1 Sol170–20; mean of three runs
46.2Δ 3.8
BTTF0.350–1; higher is more readable
20.3Δ 22.0
Human0.70–1; original rating
42.4

Views

Source code

public class VanEckSequence { public static void main(String[] args) { int[] sequence = new int[1000]; sequence[0] = 0; for (int i = 1; i < 1000; i++) { boolean isNew = true; for (int j = i - 2; j >= 0; j--) { if (sequence[i - 1] == sequence[j]) { sequence[i] = i - j - 1; isNew = false; break; } } if (isNew) { sequence[i] = 0; } } for (int i = 0; i < 1000; i++) { System.out.println(sequence[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.798.063−26.336
Source linesThe number of non-empty source lines.24+9.6
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.304−4.956

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

Score0.745

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.56.917+1.254
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.123−0.254
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.23+0.222
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.24−0.13
Indentation frequencyHow rapidly indentation changes from line to line.24+0.093
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.22.897−0.09

Intercept 0.07 + feature contributions = 0.362 (log-odds).
Score = sigmoid(0.362) = 0.589.

Score0.51
Score17
Run 1

The code is logically structured and readable in a general sense, but lacks clarity of intent and uses an inner loop with a boolean flag to emulate a 'find last occurrence' operation. The nested loops add complexity, and the purpose of the index calculation `i - j - 1` is not immediately obvious. Variable names are not descriptive (e.g., `i`, `j`, `sequence` is acceptable but generic). The action granularity is mostly one action per line, which helps, but the reading flow is interrupted by the `isNew` flag pattern. Overall, it is moderately readable but could be improved with a helper method or comment clarifying the Van Eck rule and better variable naming.

Run 2

The code is generally well-structured and readable. It uses clear variable names, simple loops, and one main action per line. The logic for generating the Van Eck sequence is understandable, though the inner loop's purpose could be more explicit. The use of a boolean flag (`isNew`) helps clarify intent. However, the code lacks comments explaining the sequence's rule, and the hard-coded array size (1000) and magic number for backtracking (`i - j - 1`) reduce clarity. Nesting is only two levels deep, which is acceptable. Overall, the structure is logical and the flow is natural, but a few comments and named constants would improve readability.

Run 3

The code is relatively readable due to its simple structure, consistent indentation, and clear use of loops. However, intent is not obvious without domain knowledge: the variable names are too generic (`i`, `j`, `isNew`) and do not explain the Van Eck sequence logic. The inner search loop and the conditional flag create moderate nesting, making the flow slightly harder to follow. Action granularity is good—most lines perform one action. Code length is appropriate for the task. Overall, it is understandable but not highly self-documenting.

Run 1

Code Structure: Clearly separates initialization, sequence generation, and output. Nesting: The generation uses two nested loops and a conditional, but the depth is manageable and the break limits complexity. Clarity of intent: The class and sequence variable identify the purpose; however, the backward search and distance calculation would benefit from a brief explanation. Code length: Concise, with little unnecessary code, though repeated 1000 literals could be replaced by sequence.length or a named constant. Action granularity: Each statement performs one action, making updates easy to follow. Reading flow: Execution proceeds naturally from setup through computation to printing, with consistent formatting and useful whitespace.

Run 2

Code Structure: Initialization, sequence generation, and output are logically separated. Nesting: The nested search loop and conditional add moderate depth, but remain easy to follow. Clarity of intent: The class and variable names convey the purpose, though the backward search and distance calculation would benefit from a brief explanation. Code length: Compact and appropriate, with minor repetition of the constant 1000. Action granularity: Each statement performs a single action, making updates and control flow clear. Reading flow: Execution proceeds naturally from setup to computation to printing; the isNew flag and break make the search outcome understandable.

Run 3

Code Structure: Initialization, sequence generation, and output are logically separated. Nesting: The nested search loop and conditional introduce moderate depth, but remain easy to follow. Clarity of intent: The class name and sequence variable establish the purpose; however, the backward search and distance calculation would benefit from a brief explanation of the Van Eck rule. Code length: Compact and appropriately sized, though repeated use of 1000 could be replaced with a named constant or sequence.length. Action granularity: Each statement performs a single clear action. Reading flow: Execution proceeds naturally from setup to generation to printing, with useful whitespace. Overall, readable code with minor opportunities to clarify the algorithm and eliminate magic numbers.