Sample
Dorn/java/170
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0.006 | 0–1; higher is more readable | 66.3Δ 7.0 |
| Scalabrino | 0.716 | 0–1; higher is more readable | 78.7Δ 19.4 |
| Dorn | 0.556 | 0–1; higher is more readable | 48.5Δ 10.9 |
| Mi | 0.732 | 0–1; higher is more readable | 89.7Δ 30.4 |
| LLOC | 15 | Logical lines; fewer is more readable | 46.5Δ 12.8 |
| DeepSeek V4 Pro | 13.67 | 0–20; mean of three runs | 62.8Δ 3.5 |
| GPT-6.1 Sol | 15.67 | 0–20; mean of three runs | 61.6Δ 2.2 |
| BTTF | 0.632 | 0–1; higher is more readable | 80.8Δ 21.4 |
| Human | 3.45 | 1–5; original rating | 59.3 |
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. | 574.48 | −18.958 |
| 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.737 | −7.105 |
Intercept 8.87 + feature contributions = -5.193 (log-odds).
Score = sigmoid(-5.193) = 0.006.
| Score | 0.716 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| 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. | 70 | +0.7 |
| 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.133 | −0.347 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 29 | +0.266 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 31 | −0.061 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 29.62 | +0.004 |
Intercept 0.07 + feature contributions = 0.226 (log-odds).
Score = sigmoid(0.226) = 0.556.
| Score | 0.732 |
|---|
| Score | 15 |
|---|
Run 1
The code demonstrates a moderate level of readability. The structure is logical with clear method separation, and the nesting depth is minimal. However, several issues impact readability: inconsistent indentation (mixed tabs and spaces), unclear variable naming like '_app' and '_listener' without showing their declarations, and missing access modifiers that make intent less clear. The paintComponent method actually calls setPreferredSize, which is unusual and potentially confusing as it's not the typical place for layout management. Action granularity is generally good with simple operations, but the addImpl method modifies state before the super call, which could be considered a subtle anti-pattern. The code is relatively concise but could benefit from better documentation and consistent formatting.
Run 2
The code is relatively readable but has inconsistencies. The class structure is logical with overridden methods for component management, and each method performs a distinct action. Nesting is acceptable with single-level conditionals. However, readability suffers from inconsistent indentation - the first method's opening brace is misaligned, and the 'super.remove(comp)' line uses spaces instead of tabs. The paintComponent method's call to setPreferredSize() on every paint is unclear without context, making intent ambiguous. Action granularity is mostly good except for addImpl where revalidate() is called before super.addImpl(), which may confuse readers about ordering. The code length is concise, but the missing method declaration for the first block and the _app/_listener variables without context reduce clarity. Overall, it's understandable but could benefit from consistent formatting and clearer separation of concerns.
Run 3
The code is generally readable but has several issues. The structure is logical with clear method separation, and the intent is mostly understandable for Swing component management. Nesting is acceptable with only one level. However, there are concerns: inconsistent indentation (mismatched braces and spacing before 'super.remove'), redundant calls like setPreferredSize inside paintComponent which may cause performance issues, and unclear action granularity - some lines combine multiple operations. The reading flow is disrupted by the revalidate/repaint calls placed before super.addImpl, and the remove method calls revalidate/repaint even when the component is null. Missing documentation about the class context and _listener initialization makes the purpose less clear. Overall, the code is understandable but could benefit from improved consistency and clarity.
Run 1
Code Structure: Methods are logically separated by painting, removal, and addition responsibilities, though the opening fragment lacks context. Nesting: Shallow null checks keep the code easy to follow. Clarity of intent: Method names and listener operations communicate purpose, but changing preferred size during painting and differing revalidation behavior may require explanation. Code length: Concise, with no substantial unnecessary code. Action granularity: Each statement performs one action on its own line. Reading flow: Operations follow understandable sequences, but inconsistent indentation, mixed whitespace, and the incomplete opening disrupt readability.
Run 2
Code Structure: Methods are logically separated by responsibility, though the fragment begins with an incomplete preceding method and indentation is inconsistent. Nesting: Only shallow null checks are used, making control flow easy to follow. Clarity of intent: Standard Swing method names and explicit listener management communicate purpose; changing preferred size during painting is less intuitive. Code length: The implementation is concise without unnecessary repetition. Action granularity: Each statement performs one action and occupies its own line. Reading flow: Operations within each method are straightforward, but inconsistent formatting and different placement of revalidate calls slightly reduce coherence.
Run 3
Code Structure: Methods are logically separated by responsibility, though the fragment starts with an incomplete preceding method. Nesting: Shallow null checks keep control flow easy to follow. Clarity of intent: Method names and listener operations clearly communicate component lifecycle handling; changing preferred size during painting is less intuitive. Code length: Concise, with little unnecessary code. Action granularity: Each statement performs one action on its own line. Reading flow: Generally natural, but inconsistent indentation and the truncated opening interrupt readability.