Sample

JetBrains/b54

Human rating uses the original dataset scale.

DatasetJetBrains
Human0.8
Lines20

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
38.1Δ 23.3
Scalabrino0.2550–1; higher is more readable
11.0Δ 50.4
Dorn0.5640–1; higher is more readable
60.2Δ 1.3
Mi0.3930–1; higher is more readable
36.4Δ 25.0
LLOC16Logical lines; fewer is more readable
38.6Δ 22.9
DeepSeek V4 Pro12.670–20; mean of three runs
20.8Δ 40.7
GPT-6.1 Sol140–20; mean of three runs
10.2Δ 51.3
BTTF0.4460–1; higher is more readable
40.7Δ 20.8
Human0.80–1; original rating
61.4

Views

Source code

public class KolakoskiSequence { public static void main(String[] args) { int[] sequence = new int[1000]; sequence[0] = 1; sequence[1] = 2; int index = 2; int runLength = 1; int currentNumber = 2; while (index < 1000) { for (int i = 0; i < runLength; i++) { sequence[index++] = currentNumber; } currentNumber = currentNumber == 1 ? 2 : 1; runLength = sequence[runLength] == 1 ? 2 : 1; } for (int i = 0; i < sequence.length; i++) { System.out.print(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.771.487−25.459
Source linesThe number of non-empty source lines.20+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.775−5.663

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

Score0.255

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.61+1.082
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
Indentation frequencyHow rapidly indentation changes from line to line.1−0.703
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.117−0.2
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.18.694−0.149
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.20−0.038

Intercept 0.07 + feature contributions = 0.259 (log-odds).
Score = sigmoid(0.259) = 0.564.

Score0.393
Score16
Run 1

The code is relatively short and has a clear overall purpose: generating the Kolakoski sequence. Structure and nesting are adequate—only one while loop and one inner for loop. However, clarity of intent suffers because variable names like 'index', 'runLength', and 'currentNumber' do not fully convey their roles, and the Kolakoski rule update is not obvious. The line 'runLength = sequence[runLength] == 1 ? 2 : 1;' is cryptic, performing two conceptually separate operations (reading the next run length and advancing the run-length pointer) without a separate index. Action granularity is mostly one action per line, but the compressed ternary assignment reduces readability. Reading flow is natural except for that unclear update step. Code length is concise but at the cost of explaining the algorithm. Overall, it reads like a compact solver rather than a clearly documented implementation.

Run 2

The code is relatively concise and logically structured, but readability suffers due to ambiguous variable names and a subtle logical flaw. The structure is flat without unnecessary nesting, and action granularity is mostly one operation per line. However, the intent is unclear: variables like 'index' and 'runLength' are not self-explanatory, and 'runLength = sequence[runLength] == 1 ? 2 : 1;' is confusing because it reads from the sequence using runLength as an index, while also updating runLength. Additionally, the initial setup and loop logic lack comments explaining the Kolakoski sequence rule. The code length is reasonable but could be shortened with helper methods or constants. Overall, it is moderately readable but requires domain knowledge and careful tracing to understand.

Run 3

The code is logically organized and relatively flat, but clarity of intent is weak. The algorithm is not obvious without domain knowledge of the Kolakoski sequence. Variables like runLength and currentNumber are reasonably named, but their initialization and updates feel opaque. The main while loop has a nested for loop, but nesting is not deep. The code is concise, but it lacks comments explaining the algorithm or the meaning of initial values. Several actions occur per line, especially in the while loop (sequence[index++] = currentNumber), reducing readability. The final print loop is clear, but the overall reading flow is disrupted by the initial hardcoded values and the unclear update of runLength from the sequence array. The code would benefit from comments and minor restructuring.

Run 1

Code Structure: Initialization, generation, and output are logically ordered, though all logic resides in main. Nesting: A for loop inside a while loop adds modest, manageable nesting. Clarity of intent: The class and variable names suggest sequence generation, but the runLength update is non-obvious and lacks explanation; the repeated magic number 1000 also reduces clarity. Code length: Short and largely concise, without unnecessary boilerplate. Action granularity: Most lines perform one action, but sequence[index++] combines assignment and index advancement. Reading flow: Execution proceeds naturally from setup to generation to printing, although the unexplained relationship between runLength and sequence indexing interrupts understanding. The inner loop's lack of an explicit array-bound check also makes the generation logic harder to confidently follow.

Run 2

Code Structure: Initialization, generation, and output are logically ordered, though all reside in main. Nesting: A for loop inside a while loop adds only moderate nesting. Clarity of intent: The class name and variable names suggest sequence generation, but the run-length update is difficult to interpret without comments or a separate read pointer. Code length: Short and mostly concise, although the repeated 1000 literal should use sequence.length or a named constant. Action granularity: Most lines perform one action, but sequence[index++] combines assignment and index advancement. Reading flow: Execution follows a natural progression, but the unexplained initial state and reuse of runLength as an array index interrupt understanding of the algorithm.

Run 3

Code Structure: Initialization, sequence generation, and output are logically ordered, though all reside in main. Nesting: The while/for nesting is shallow and easy to follow. Clarity of intent: The class and variable names suggest sequence generation, but the runLength update is confusing because it also uses runLength as an array index; the algorithm lacks explanatory comments. Code length: Compact, with little unnecessary code, although 1000 is repeated instead of using sequence.length. Action granularity: Most lines perform one action, but sequence[index++] combines assignment and index advancement. Reading flow: Execution proceeds naturally from setup to generation to printing, but the unexplained state transitions make the core logic harder to understand.