Sample
Buse/10
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0.169 | 0–1; higher is more readable | 42.4Δ 5.6 |
| Scalabrino | 0.873 | 0–1; higher is more readable | 83.3Δ 35.4 |
| Dorn | 0.847 | 0–1; higher is more readable | 94.9Δ 47.0 |
| Mi | 0.629 | 0–1; higher is more readable | 61.6Δ 13.6 |
| LLOC | 4 | Logical lines; fewer is more readable | 59.6Δ 11.6 |
| DeepSeek V4 Pro | 15 | 0–20; mean of three runs | 60.6Δ 12.6 |
| GPT-6.1 Sol | 14 | 0–20; mean of three runs | 24.7Δ 23.2 |
| BTTF | 0.557 | 0–1; higher is more readable | 61.6Δ 13.6 |
| Human | 3.35 | 1–5; original rating | 48.0 |
Views
Select the downloaded ZIP or its extracted folder. Files stay in your browser.
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. | 269.212 | −8.884 |
| Byte entropyHow varied the bytes in the source text are. Repeated bytes give a lower value; a more even mixture gives a higher value. | 4.252 | −6.378 |
| Source linesThe number of non-empty source lines. | 12 | +4.8 |
Intercept 8.87 + feature contributions = -1.592 (log-odds).
Score = sigmoid(-1.592) = 0.169.
| Score | 0.873 |
|---|
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. | 51.923 | +1.466 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 1 | −0.703 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 12 | +0.611 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 11.679 | −0.247 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.089 | +0.079 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 52 | +0.035 |
Intercept 0.07 + feature contributions = 1.71 (log-odds).
Score = sigmoid(1.71) = 0.847.
| Score | 0.629 |
|---|
| Score | 4 |
|---|
Run 1
The code is generally readable, with clear structure and intent. It uses early return to avoid nesting, a switch statement to organize key events, and concise comments. However, the switch cases lack a default case, and the method appears incomplete (missing closing braces and handling for other keys). The action granularity is good—one action per line—but the reading flow is slightly disrupted by the incomplete code. Overall, it's easy to follow and maintain, though the missing parts prevent a perfect score.
Run 2
The code is generally readable: it uses clear early return, a flat switch statement, and concise method structure. Intent is mostly clear (handling movement keys), and each case maps to one action. However, the snippet is incomplete—only one movement direction is shown, with a dangling comment and no visible default or closing brace, making the full logic ambiguous. The '// main menu' comment under ESCAPE is unclear without surrounding context. Action granularity and reading flow are good, but the lack of the full switch body slightly reduces clarity.
Run 3
The code starts with a clear guard clause and uses a switch statement for key handling, which is good for flat structure and readability. However, the snippet is incomplete, so it's difficult to fully assess the action granularity and reading flow. The indentation is consistent, and the intent is fairly clear—handling unit movement via key events. Still, the lack of a default case and the incomplete switch block reduce clarity. Overall, it is moderately readable but would benefit from more context and a complete structure.
Run 1
Code Structure: The guard clause followed by a key-code switch is logically organized, though the snippet is incomplete. Nesting: Shallow nesting makes it easy to follow. Clarity of intent: Method and controller names clearly convey unit movement, but the Escape case suggests a main-menu action without implementing it. Code length: Concise, with no unnecessary logic. Action granularity: Each statement performs one action; grouped cases clearly share movement behavior. Reading flow: The progression from checking permissions to handling keys is natural, although case indentation and the missing closing structure reduce readability.
Run 2
Code Structure: The guard clause followed by a key-code switch is logically organized, but the snippet ends without closing braces, leaving the structure incomplete. Nesting: Shallow nesting and an early return keep complexity low. Clarity of intent: moveUnit, descriptive constants, and moveActiveUnit clearly convey keyboard-driven movement; the Escape case is only a placeholder. Code length: Concise, with no unnecessary verbosity. Action granularity: Each statement performs one action, and grouped case labels clearly share behavior. Reading flow: The enabled-state check naturally precedes dispatch, though inconsistent case indentation and the abrupt ending hinder readability. No break is shown after movement, so whether fall-through is intended cannot be determined.
Run 3
Code Structure: A guard clause followed by a key-code switch provides logical organization. Nesting: Shallow nesting makes the visible control flow easy to follow. Clarity of intent: moveUnit and moveActiveUnit clearly communicate movement handling, though the Escape case is only a placeholder. Code length: The excerpt is concise, without unnecessary statements. Action granularity: Each statement performs one action, and grouped case labels clearly share behavior. Reading flow: The progression from checking whether actions are enabled to handling keys is natural, although case indentation could better distinguish switch contents. The excerpt ends before the case and method are completed, preventing assessment of the remaining branches and whether fall-through is intentional.