Sample
Buse/89
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0.965 | 0–1; higher is more readable | 97.0Δ 2.0 |
| Scalabrino | 0.887 | 0–1; higher is more readable | 89.4Δ 9.6 |
| Dorn | 0.883 | 0–1; higher is more readable | 98.0Δ 1.0 |
| Mi | 0.685 | 0–1; higher is more readable | 75.8Δ 23.2 |
| LLOC | 3 | Logical lines; fewer is more readable | 88.9Δ 10.1 |
| DeepSeek V4 Pro | 15.67 | 0–20; mean of three runs | 69.7Δ 29.3 |
| GPT-6.1 Sol | 14.67 | 0–20; mean of three runs | 27.8Δ 71.2 |
| BTTF | 0.76 | 0–1; higher is more readable | 100.0Δ 1.0 |
| Human | 4.29 | 1–5; original rating | 99.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) |
|---|---|---|
| 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.972 | −5.958 |
| Source linesThe number of non-empty source lines. | 11 | +4.4 |
| Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones. | 120.928 | −3.991 |
Intercept 8.87 + feature contributions = 3.321 (log-odds).
Score = sigmoid(3.321) = 0.965.
| Score | 0.887 |
|---|
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. | 42 | +1.886 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 9 | +0.718 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.059 | +0.365 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 11 | −0.357 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 10.814 | −0.259 |
Intercept 0.07 + feature contributions = 2.018 (log-odds).
Score = sigmoid(2.018) = 0.883.
| Score | 0.685 |
|---|
| Score | 3 |
|---|
Run 1
The code is highly readable. It uses a clear and logical structure with a switch statement to map state constants to string names. Nesting is minimal, with only one level inside the switch. Intent is obvious: convert a state integer to a descriptive string. Code length is concise and appropriate for the task. Action granularity is good, with separate lines for state retrieval and each return statement. Reading flow is natural and easy to follow. Minor deductions: no default case (could be intentional but slightly reduces robustness), and the snippet appears incomplete (missing closing braces).
Run 2
The code is generally readable due to its simple structure, clear switch statement, and good indentation. Each case returns a distinct string, making intent obvious. However, the code is incomplete—a closing brace and default/return statement are missing, which would cause compilation errors and lower readability. Nesting is flat and action granularity is appropriate, but the lack of error handling or a default case makes the state-to-string mapping incomplete. Overall readability is solid but hindered by missing logic.
Run 3
The code is highly readable. It uses a clear method name, a well-named variable, and a straightforward switch statement with flat structure. Each case performs one action (returning a string literal), and the reading flow is natural. However, it is incomplete (missing closing braces and a default case), and the string literals duplicate the constant names, which could be refactored for maintainability. Overall, the intent is unambiguous and the structure is logical, but the incompleteness slightly detracts from full readability.
Run 1
Code Structure: A straightforward switch organizes state-to-string mappings logically, but the snippet is incomplete, lacking closing braces and a fallback. Nesting: Shallow and easy to follow. Clarity of intent: The method name, state variable, and matching constants clearly communicate the purpose. Code length: Concise, although frequent blank lines add unnecessary visual length. Action granularity: Each statement performs one action, with separate return statements for each case. Reading flow: Retrieving the state and then mapping it to a string is natural; the abrupt ending interrupts that flow and leaves handling of other states unclear.
Run 2
Code Structure: The method uses a logically organized switch to map states to strings, but the snippet is incomplete. Nesting: Shallow method and switch nesting makes it easy to follow. Clarity of intent: The method name, state variable, and descriptive constants clearly communicate the purpose. Code length: Concise, though excessive blank lines spread out a small amount of logic. Action granularity: Each statement performs one action, and each case returns a single value. Reading flow: The state retrieval followed by explicit mappings reads naturally, but missing closing braces and handling for other states prevent assessment of the complete method.
Run 3
Code Structure: The method and switch logically organize state-to-string mapping, but the snippet is incomplete, lacking closing braces and handling for other states. Nesting: Shallow nesting makes the visible code easy to follow. Clarity of intent: The method name, state constants, and returned strings clearly communicate the purpose. Code length: The visible implementation is concise, though excessive blank lines add unnecessary vertical space. Action granularity: Each declaration and return occupies its own line. Reading flow: Retrieving the state and then selecting its string representation is natural, but the abrupt ending prevents assessing the complete control flow.