Sample
Buse/35
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0.021 | 0–1; higher is more readable | 22.2Δ 21.2 |
| Scalabrino | 0.518 | 0–1; higher is more readable | 15.2Δ 14.1 |
| Dorn | 0.514 | 0–1; higher is more readable | 36.4Δ 35.4 |
| Mi | 0.036 | 0–1; higher is more readable | 3.0Δ 2.0 |
| LLOC | 4 | Logical lines; fewer is more readable | 59.6Δ 58.6 |
| DeepSeek V4 Pro | 12.67 | 0–20; mean of three runs | 33.8Δ 32.8 |
| GPT-6.1 Sol | 15.33 | 0–20; mean of three runs | 39.9Δ 38.9 |
| BTTF | 0.536 | 0–1; higher is more readable | 54.5Δ 53.5 |
| Human | 2.01 | 1–5; original rating | 1.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. | 293.438 | −9.683 |
| 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.964 | −7.446 |
| Source linesThe number of non-empty source lines. | 11 | +4.4 |
Intercept 8.87 + feature contributions = -3.859 (log-odds).
Score = sigmoid(-3.859) = 0.021.
| Score | 0.518 |
|---|
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. | 118.917 | −1.372 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 119 | +1.116 |
| 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 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.065 | +0.311 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 6 | +0.283 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 10.767 | −0.259 |
Intercept 0.07 + feature contributions = 0.058 (log-odds).
Score = sigmoid(0.058) = 0.514.
| Score | 0.036 |
|---|
| Score | 4 |
|---|
Run 1
The code lacks structural clarity: the constructor body is tightly coupled with superclass configuration and UI setup, making it difficult to discern the logical flow. There is moderate nesting due to method chaining within the putValue calls, and some lines wrap awkwardly to accommodate long method invocations, reducing readability. The intent is partially clear (creating a DisbandUnitAction with a label, keystroke, and icons), but the magic numbers ('D', 0, 1) and hardcoded strings obscure purpose. The code length is reasonable, but action granularity is inconsistent—multiple operations are packed into single lines, while others wrap unnecessarily. Reading flow is disrupted by inconsistent formatting and lack of spacing or grouping. Overall, this snippet is fairly unreadable due to unclear magic values, poor line breaks, and mixed abstraction levels within a small block.
Run 2
The code is well-structured and readable. It follows a logical order: constructor calls super with clear parameters, then configures button images. Nesting is minimal, with only one level of method call chaining. Intent is clear—creating a DisbandUnitAction and setting its visual states. The code is concise, avoiding unnecessary verbosity. Each action (super call, image setting) is on its own line, maintaining good action granularity. Reading flow is natural, from constructor initialization to UI configuration. Minor improvements could include better line wrapping for the second putValue call to avoid the awkward split, but overall the code is highly maintainable and understandable.
Run 3
The code is moderately readable. It follows a clear structure with a constructor that initializes a superclass and sets button images. The intent of creating a DisbandUnitAction is evident from the class and method names, and the Javadoc comment clarifies the parameter. However, the line calling putValue with getUnitButtonImageIcon is quite long and wraps awkwardly, disrupting the reading flow. The action granularity is reasonable, but the long method call could be broken down for better readability. Overall, the code is understandable but would benefit from formatting adjustments.
Run 1
Code Structure: The constructor logically groups superclass initialization and button-image configuration, but the snippet lacks its closing brace. Nesting: Flat control flow makes it easy to follow, although chained method calls add visual complexity. Clarity of intent: The constructor name, documentation, and image constants convey its purpose; the string "unit.state.8" and numeric image variants are less self-explanatory. Code length: Concise, with minor repetition in image-library access. Action granularity: Each statement performs one initialization or configuration action. Reading flow: Initialization proceeds naturally, but inconsistent line wrapping, especially the isolated 0 argument, interrupts readability.
Run 2
Code Structure: The constructor logically groups superclass initialization and button-image configuration, although the snippet lacks a closing brace. Nesting: Flat statements with no nested control flow make it easy to follow. Clarity of intent: The constructor documentation and descriptive identifiers communicate its purpose, but the string "unit.state.8" and numeric image-state arguments are unexplained magic values. Code length: Short and focused, though repeated image-library access adds minor verbosity. Action granularity: Each statement performs one initialization or configuration action. Reading flow: Initialization proceeds naturally, but long chained calls and inconsistent line wrapping slightly interrupt scanning.
Run 3
Code Structure: A logically organized constructor groups superclass initialization and button-image setup, though the snippet lacks its closing brace. Nesting: Flat control flow; chained and nested method calls add only modest complexity. Clarity of intent: The constructor name, documentation, and named image constants clearly indicate a disband action, but "unit.state.8" and numeric image-state arguments obscure details. Code length: Concise, with some repeated image-library access. Action granularity: Each statement performs one initialization action. Reading flow: Initialization proceeds naturally, but long calls and inconsistent line wrapping interrupt scanning.