Sample

JetBrains/e49

Human rating uses the original dataset scale.

DatasetJetBrains
Human0.7
Lines24

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
21.2Δ 21.2
Scalabrino0.7590–1; higher is more readable
66.1Δ 23.7
Dorn0.5490–1; higher is more readable
59.3Δ 16.9
Mi0.070–1; higher is more readable
8.5Δ 33.9
LLOC15Logical lines; fewer is more readable
43.6Δ 1.3
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.3980–1; higher is more readable
28.0Δ 14.4
Human0.70–1; original rating
42.4

Views

Source code

public class NumberSequence { public static void main(String[] args) { int[] sequence = new int[250]; // Creating an array to hold the sequence up to 250 terms sequence[0] = 0; // Assigning the first term for (int i = 1; i < 250; i++) { if (sequence[i-1] - i > 0 && !contains(sequence, sequence[i-1] - i, i)) { sequence[i] = sequence[i-1] - i; } else { sequence[i] = sequence[i-1] + i; } System.out.println(sequence[i]); // Printing each term } } // Helper method to check if a number is already in the sequence public static boolean contains(int[] sequence, int number, int index) { for (int i = 0; i < index; i++) { if (sequence[i] == number) { return true; } } return false; } }

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.977.67−32.263
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.88−5.82

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

Score0.759

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.100+0.809
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.99.958−0.569
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.24+0.187
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.22.792−0.091
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.106−0.09
Indentation frequencyHow rapidly indentation changes from line to line.19−0.08
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.20−0.038

Intercept 0.07 + feature contributions = 0.198 (log-odds).
Score = sigmoid(0.198) = 0.549.

Score0.07
Score15
Run 1

The code is generally readable but has several issues. Structure is acceptable with the main method and helper separated. Nesting is shallow, which is good. Intent is mostly clear, though the sequence logic could be more explicitly documented. The code is reasonably concise but has some unnecessary comments. Action granularity is mostly one action per line. Reading flow is decent. However, problems include: magic number 250 used repeatedly instead of a constant, unclear variable naming (sequence is too generic), the contains method searches the entire array each time which is inefficient but not a readability issue per se, and the comment on line 2 is redundant. The logic on line 5 is somewhat complex and could benefit from better variable naming or explanation. Overall, it's readable but falls short due to magic numbers and an overly terse explanation of the algorithm's intent.

Run 2

The code has a clear intent (generating a number sequence) and uses descriptive variable names, but it has several readability issues. The main loop is moderately nested and combines multiple actions per line: condition checks, array assignment, and printing. The `contains` helper is logical but inefficient and requires passing an index to limit the search. The magic number '250' is hardcoded in multiple places, reducing clarity. The inline comments are helpful but verbose, and the code structure could benefit from extracting the sequence logic into a separate method. The flow is somewhat natural, but the condition in the if-statement is long and could be broken into a helper method to improve readability.

Run 3

The code is fairly readable with a clear main method and a helper method that checks for duplicates. It uses straightforward variable names and includes comments explaining key steps. However, readability is reduced by a magic number (250) used repeatedly, a complex compound condition that combines subtraction, positive check, and contains() in one line, and the fact that the sequence's first element is not printed while all others are. The condition logic could be extracted into a small boolean method to improve intent clarity. Nesting is minimal, and the overall flow is logical, but the single complex if-statement reduces the action granularity and makes the core rule harder to grasp at a glance.

Run 1

Code Structure: The main sequence-generation logic and membership-check helper are cleanly separated. Nesting: Loop and conditional nesting is shallow and easy to follow. Clarity of intent: Descriptive names and comments explain the basic operations, though the sequence itself is not identified, and 'index' could more clearly indicate the search limit. Code length: Compact without unnecessary complexity; some comments merely repeat the code. Action granularity: Each statement performs a single clear action. Reading flow: Initialization, generation, and output follow a natural order, with the helper below. Repeated subtraction expressions, the duplicated literal 250, and inconsistent spacing around subtraction slightly reduce readability.

Run 2

Code Structure: Logically organized, with sequence generation in main and duplicate checking in a separate helper. Nesting: Limited to straightforward loop-and-conditional combinations. Clarity of intent: Descriptive names and comments clarify operations, but the sequence rule is not explained, and index would be clearer as an exclusive search limit. Code length: Concise overall, though several comments merely repeat the code and the subtraction expression is repeated. Action granularity: Each statement performs one clear action. Reading flow: Initialization, generation, and printing follow a natural order, with an easy-to-follow helper. Readability would improve by replacing the repeated constant 250 with sequence.length, introducing a candidate variable, and consistently spacing array-index expressions.

Run 3

Code Structure: The sequence generation and membership check are logically separated into two methods. Nesting: Loop-and-conditional nesting is shallow and easy to follow. Clarity of intent: Descriptive names and comments clarify the operations, although the sequence itself is not identified and the parameter 'index' could better express the search boundary. Code length: Compact overall, with some redundant comments and repeated subtraction expressions. Action granularity: Each statement performs one clear action. Reading flow: Initialization, generation, and output follow a natural order, with the helper below. Readability could improve by replacing the repeated literal 250 with sequence.length, naming the subtraction candidate, and adding consistent spacing around operators.