Sample
Scalabrio151
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0.002 | 0–1; higher is more readable | 77.4Δ 17.3 |
| Scalabrino | 0.773 | 0–1; higher is more readable | 81.4Δ 13.3 |
| Dorn | 0.634 | 0–1; higher is more readable | 70.4Δ 24.4 |
| Mi | 0.651 | 0–1; higher is more readable | 86.9Δ 7.8 |
| LLOC | 12 | Logical lines; fewer is more readable | 57.3Δ 37.4 |
| DeepSeek V4 Pro | 15.67 | 0–20; mean of three runs | 72.9Δ 21.9 |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs | 83.7Δ 11.1 |
| BTTF | 0.572 | 0–1; higher is more readable | 64.8Δ 29.9 |
| Human | 4.56 | 1–5; original rating | 94.7 |
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. | 610.496 | −20.146 |
| Source linesThe number of non-empty source lines. | 30 | +12 |
| 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.718 | −7.078 |
Intercept 8.87 + feature contributions = -6.354 (log-odds).
Score = sigmoid(-6.354) = 0.002.
| Score | 0.773 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 92.833 | +0.693 |
| 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. | 92.9 | −0.27 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 24 | −0.13 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.084 | +0.124 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 23 | +0.058 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 29 | +0.01 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 28.745 | −0.008 |
Intercept 0.07 + feature contributions = 0.548 (log-odds).
Score = sigmoid(0.548) = 0.634.
| Score | 0.651 |
|---|
| Score | 12 |
|---|
Run 1
The code is fairly readable, with clear comments and logical separation of concerns. The structure is reasonable: it first handles buffered reads, then reads from the parent, with buffering logic afterward. Nesting is shallow (max two levels), which is good. Clarity of intent is moderately strong, though the double use of 'eventLimit' for both a boolean and a size limit is slightly confusing. Code length is appropriate. Action granularity is mostly clean, but the comment on line 13 says 'reset was called' without explaining the context, and the fallthrough logic could be more explicit. The main weakness is the reliance on comments to explain control flow rather than self-documenting code. Reading flow is natural but interrupted by slightly verbose inline comments. Minor improvements could make the buffering logic clearer.
Run 2
The code is generally readable with clear intent and logical structure. It uses early returns to avoid deep nesting, and each action is on its own line. Comments explain non-obvious behavior (buffer iterator handling, trimming). Minor issues: the nested conditional for buffer trimming adds slight complexity, and terminology like 'bufferReader' vs 'eventBuffer' could be more consistent. Overall, the method reads naturally and is easy to follow.
Run 3
The code is well-structured and readable. It follows a clear logical flow: first handling the buffered reader case, then reading from the parent, and conditionally buffering. Nesting is minimal, with only one level of indentation within each conditional block. Comments are concise and explain intent without being excessive. Each action is generally on its own line, improving readability. The method is appropriately short and focused on a single responsibility. Variable names like bufferReader, eventBuffer, and eventLimit clearly convey their purpose. The reading flow is natural—checking buffer, falling through to direct reading, then processing the result. Minor improvements could include extracting the buffer-trimming logic into a helper method, but overall the code maintains strong clarity with low complexity and good separation of concerns.
Run 1
Code Structure: Clearly separates buffered replay from reading and buffering new events. Nesting: Shallow, with an early return keeping the main path straightforward. Clarity of intent: Descriptive names and comments explain the behavior, though the opening comment is awkward and the zero/negative eventLimit conventions are implicit. Code length: Concise for its responsibilities, with some comments repeating obvious operations. Action granularity: Each statement performs one clear action. Reading flow: Natural progression from replay to direct reading, optional buffering, trimming, and return. The comment about falling through is slightly misleading because the current call returns the buffered event; direct reading resumes on a later call.
Run 2
Code Structure: Logically separates buffered replay from reading and buffering new events. Nesting: Shallow, with at most two conditional levels and an early return simplifying control flow. Clarity of intent: Descriptive names and comments explain behavior, although the first comment is grammatically awkward and the meaning of zero versus negative eventLimit values is implicit. Code length: Concise and appropriate for its responsibilities, with a few comments merely restating operations. Action granularity: Each statement performs one clear action. Reading flow: Natural progression from replay to direct reading, optional buffering, trimming, and return. The comment about falling through is slightly misleading because the method returns the buffered event; direct reading occurs on the next invocation.
Run 3
Code Structure: Logically separates buffered replay from underlying-reader access and buffering. Nesting: Shallow, with at most two conditional levels and an early return. Clarity of intent: Descriptive identifiers make the purpose clear, although eventLimit's zero and negative semantics are implicit, and the 'fall through' comment is misleading because the method returns. Code length: Concise and appropriate for the functionality; some comments repeat obvious operations. Action granularity: Each statement performs a single clear action. Reading flow: Natural progression from replaying buffered events to reading, optionally buffering, trimming, and returning.