Sample

JetBrains/b30

Human rating uses the original dataset scale.

DatasetJetBrains
Human0.53
Lines38

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
2.5Δ 17.4
Scalabrino0.2170–1; higher is more readable
8.5Δ 11.4
Dorn0.3540–1; higher is more readable
26.3Δ 6.4
Mi0.0160–1; higher is more readable
5.9Δ 14.0
LLOC26Logical lines; fewer is more readable
7.2Δ 12.7
DeepSeek V4 Pro7.670–20; mean of three runs
5.9Δ 14.0
GPT-6.1 Sol110–20; mean of three runs
1.7Δ 18.2
BTTF0.0380–1; higher is more readable
0.0Δ 19.9
Human0.530–1; original rating
19.9

Views

Source code

public class BowlingScorer { public static void main(String[] args) { for (String game : args) { int[] rolls = new int[21]; int rollIndex = 0; for (char c : game.toCharArray()) { if (c == 'X') { rolls[rollIndex++] = 10; if (rollIndex < 19 && rolls[rollIndex-2] == 10 && rolls[rollIndex-4] ==10) rolls[rollIndex-4] += 10; } else if (c == '/') { rolls[rollIndex-1] = 10 - rolls[rollIndex-2]; } else if (c == '-') { // do nothing, this is a miss } else if (c == 'F') { // do nothing, this is a foul } else { rolls[rollIndex++] = c - '0'; } } int score = 0; for (int frame=0; frame<10; frame++) { int frameScore = rolls[frame*2] + rolls[frame*2+1]; // check for a spare bonus if (frameScore == 10 && frame < 9) { frameScore += rolls[frame*2+2]; } // check for a strike bonus if (rolls[frame*2] == 10 && frame < 9) { frameScore += rolls[frame*2+2] + rolls[frame*2+3]; } else if (rolls[frame*2] == 10 && frame == 9) { frameScore += rolls[frame*2+1] + rolls[frame*2+2]; } score += frameScore; } System.out.println(score); } } }

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.1814.029−59.863
Source linesThe number of non-empty source lines.38+15.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.818−5.727

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

Score0.217

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.119−1.375
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.119+1.116
Indentation frequencyHow rapidly indentation changes from line to line.34+0.439
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.34−0.359
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.38−0.309
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.126−0.285
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.36.8+0.105

Intercept 0.07 + feature contributions = -0.6 (log-odds).
Score = sigmoid(-0.6) = 0.354.

Score0.016
Score26
Run 1

The code has some positive aspects, such as reasonable method length and some attempt at frame-based scoring logic. However, it suffers from significant readability issues. The strike bonus calculation is tangled, with confusing index arithmetic (e.g., rolls[rollIndex-4]) that obscures intent. Magic numbers like 21, 19, and frame*2+3 are unexplained. The variable naming is inconsistent ('c' for character, 'rollIndex' is okay but 'rolls' could be clearer). The action granularity is poor in places, particularly the dense if-statement in the strike bonus logic. Reading flow is disrupted by the confusing conditional block and lack of helper methods or comments explaining the scoring rules. The code lacks abstraction (e.g., no Frame or Roll classes), making it hard to follow the bowling-specific logic. The flat structure is a minor positive, but the complex conditional logic negates this benefit.

Run 2

The code has some positive aspects, such as a relatively flat structure and straightforward main loop, but it suffers from major readability issues. The scoring logic is confusing and likely incorrect: the strike bonus handling in the first loop mutates earlier frames using magical indices (rollIndex-2, rollIndex-4) that are hard to follow. The frame-based scoring loop assumes a fixed two rolls per frame, which breaks for strikes and spares. Multiple long conditionals and embedded bonus logic hurt clarity of intent, while comments are sparse and some branches do nothing but are not self-explanatory. Action granularity is mixed — some lines bundle multiple operations. Overall, the code is short but dense, with tangled scoring logic that makes it difficult to verify correctness at a glance.

Run 3

The code has a clear high-level purpose and prints scores, but readability suffers from several issues. The main loop mixes parsing and scoring, and the strike/spare bonus logic for frame 9 is scattered. The if-else chain for character parsing is flat but has redundant conditions and unclear index arithmetic like `rollIndex < 19` and `rollIndex-4`. Magic numbers (21, 10, 19, 20, etc.) are not named. Nested if statements inside the character loop add complexity. Scoring uses `frame*2` indexing that assumes a specific roll array layout, which is not obvious. Variable names are mostly clear, but actions like incrementing `rollIndex` inside conditions reduce clarity. The code lacks decomposing helper methods, making it harder to follow than necessary. Overall, it is compact but sacrifices clarity and maintainability.

Run 1

Code Structure: Parsing and scoring are logically separated, but both reside in main rather than focused methods. Nesting: Moderate nesting from loops and conditional chains is manageable. Clarity of intent: Class and variable names and bonus comments communicate the goal, but magic numbers, obscure index arithmetic, and the strike-related mutation make the representation difficult to understand. Code length: Reasonably concise, though concision sometimes obscures logic. Action granularity: Most lines perform one action, but assignments combined with index increments and the inline strike adjustment reduce readability. Reading flow: The progression from input parsing to scoring to output is natural, but inconsistent spacing and unexplained indexing interrupt comprehension.

Run 2

Code Structure: Parsing and scoring are logically separated into loops, but both reside in main rather than dedicated methods. Nesting: Moderate nesting through loops and conditional chains is manageable, although the inline strike adjustment is harder to follow. Clarity of intent: Names and bonus comments convey the overall purpose, but magic numbers, unexplained index offsets, and mutation of earlier rolls obscure the scoring model. Code length: Compact overall, though concision sometimes sacrifices clarity. Action granularity: Most lines perform one action, but assignments combined with index increments and the inline conditional update pack multiple operations together. Reading flow: Processing proceeds naturally from parsing to scoring to output, but inconsistent spacing and repeated index arithmetic interrupt readability. Potential negative array indices and ambiguous handling of misses, fouls, and spares also make the intended behavior difficult to trust.

Run 3

Code Structure: Parsing and scoring are separated into sequential loops, but both reside in main rather than focused methods. Nesting: Moderate nesting from loops and conditional branches remains manageable. Clarity of intent: Descriptive variable names and bonus comments help, but magic numbers and opaque index arithmetic obscure the roll representation and strike handling. Code length: Relatively concise, although separate empty miss and foul branches add unnecessary repetition. Action granularity: Most lines contain one action, but assignments with increment operators combine operations, and the inline strike condition and mutation are dense. Reading flow: Parsing, scoring, and output follow a natural sequence, but inconsistent spacing and unexplained array offsets interrupt comprehension.