Sample
JetBrains/i38
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 8.5Δ 14.4 |
| Scalabrino | 0.188 | 0–1; higher is more readable | 4.2Δ 18.6 |
| Dorn | 0.489 | 0–1; higher is more readable | 41.5Δ 18.6 |
| Mi | 0.692 | 0–1; higher is more readable | 95.8Δ 72.9 |
| LLOC | 29 | Logical lines; fewer is more readable | 5.1Δ 17.8 |
| DeepSeek V4 Pro | 14 | 0–20; mean of three runs | 35.2Δ 12.3 |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs | 26.7Δ 3.8 |
| BTTF | 0.44 | 0–1; higher is more readable | 37.3Δ 14.4 |
| Human | 0.56 | 0–1; original rating | 22.9 |
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. | 1466.411 | −48.392 |
| Source linesThe number of non-empty source lines. | 33 | +13.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.774 | −5.661 |
Intercept 8.87 + feature contributions = -31.983 (log-odds).
Score = sigmoid(-31.983) = 0.
| Score | 0.188 |
|---|
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. | 49.909 | +1.551 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 1 | +1.001 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.185 | −0.855 |
| 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 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 33 | −0.336 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 31.745 | +0.034 |
Intercept 0.07 + feature contributions = -0.042 (log-odds).
Score = sigmoid(-0.042) = 0.489.
| Score | 0.692 |
|---|
| Score | 29 |
|---|
Run 1
The code is fairly concise and follows a clear spiral-filling algorithm. Variable names like row, col, and layer help convey intent, and the main loop structure is logical. However, readability is hampered by several factors: the four directional fills are tightly packed with index expressions like n-layer-2 and n-layer-1, requiring careful mental tracking. There is no helper method to isolate the spiral logic from printing, making the main method do too much. Action granularity is mostly one action per line, but some lines mix assignment and increment, which slightly reduces clarity. Nesting is moderate—while loops and for loops are present but not deeply nested. The initial setup is straightforward, but the algorithm’s boundary conditions are not explained, making it harder to grasp at a glance. Overall, it is readable for someone familiar with matrix operations but could be improved with comments or extracted methods.
Run 2
The code solves a complex problem in a compact manner but falls short on readability. The structure is logical, following the four-direction spiral pattern, but the intent of the boundary updates is not immediately obvious without comments or named constants. The while loop with four separate for loops is moderately nested (2 levels), not deeply problematic. Variable names like n, num, row, col, layer are terse but acceptable in a numerical algorithm. The main issue is the lack of explanation for the -1 and -2 offsets, and the compact but non-obvious layer progression (incrementing layer, row and col together). The output loop is straightforward. Action granularity is generally one statement per line, with multi-step array indexing on a single line in some loops. Reading flow is decent for someone familiar with spiral matrix generation, but opaque for a fresh reader; comments would greatly enhance clarity.
Run 3
The code generates a spiral grid with reasonable structure but lacks clarity. It uses flat loops, one action per line, and concise variable names, which helps readability. However, the spiral logic is non-obvious: loop boundaries depend on `layer`, `row`, and `col`, and the four directional fills are not visually distinguished or commented. The intent is not immediately clear without mental simulation. Variable names are short but somewhat ambiguous (`n`, `num`, `row`, `col`, `layer`). The printing loop is straightforward. Overall, the code is moderately readable but would benefit from comments or a helper method to explain the spiral algorithm.
Run 1
Code Structure: Initialization, spiral generation, and output are logically ordered, though generation could be extracted into a method. Nesting: Loop nesting is shallow and easy to follow. Clarity of intent: The class name and grid operations convey the purpose, but the four traversal directions are unlabeled, and boundary expressions require some mental tracing. Code length: Compact without substantial unnecessary code, although row, col, and layer track the same progression redundantly. Action granularity: Most lines perform one action; assignments using num++ combine storage and increment but remain idiomatic. Reading flow: The clockwise traversal reads naturally, followed by printing. Consistent spacing around arithmetic operators and blank lines between phases would improve scanning.
Run 2
Code Structure: Initialization, spiral filling, and output are logically ordered, though separate methods would improve organization. Nesting: Loop nesting is shallow and manageable. Clarity of intent: The class name and grid operations convey the purpose, but directional comments and explicit boundary names would clarify the four traversal loops. Tracking row, col, and layer together adds mental overhead. Code length: Compact without unnecessary verbosity, although some boundary expressions repeat. Action granularity: Most lines perform one action; assigning num++ combines assignment and increment but is conventional and understandable. Reading flow: The clockwise traversal followed by printing reads naturally. Inconsistent spacing around arithmetic operators and the lack of visual separation between traversal stages slightly reduce readability.
Run 3
Code Structure: Initialization, spiral filling, and output are logically organized, though extracting filling and printing into methods would improve separation. Nesting: Loop nesting is shallow and manageable. Clarity of intent: The class name and four directional loops convey spiral generation, but uncommented boundary calculations and overlapping row, col, and layer variables require interpretation. Code length: Compact without substantial unnecessary code. Action granularity: Most lines perform one action, although assignments combine storage with num increments. Reading flow: Traversal follows a natural clockwise sequence, followed by printing; consistent spacing around arithmetic operators and brief directional comments would make it easier to scan.