Sample
JetBrains/b54
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 38.1Δ 23.3 |
| Scalabrino | 0.255 | 0–1; higher is more readable | 11.0Δ 50.4 |
| Dorn | 0.564 | 0–1; higher is more readable | 60.2Δ 1.3 |
| Mi | 0.393 | 0–1; higher is more readable | 36.4Δ 25.0 |
| LLOC | 16 | Logical lines; fewer is more readable | 38.6Δ 22.9 |
| DeepSeek V4 Pro | 12.67 | 0–20; mean of three runs | 20.8Δ 40.7 |
| GPT-6.1 Sol | 14 | 0–20; mean of three runs | 10.2Δ 51.3 |
| BTTF | 0.446 | 0–1; higher is more readable | 40.7Δ 20.8 |
| Human | 0.8 | 0–1; original rating | 61.4 |
Views
Loading feature diagnosis…
Source regions
Feature contributions
Feature contributions
| Feature | Value | Contribution (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.
| Score | 0.255 |
|---|
Feature contributions
| Feature | Value | Contribution (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.
| Score | 0.393 |
|---|
| Score | 16 |
|---|
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.