Sample

Buse/35

Human rating uses the original dataset scale.

DatasetBuse
Human2.01
Lines11

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett0.0210–1; higher is more readable
22.2Δ 21.2
Scalabrino0.5180–1; higher is more readable
15.2Δ 14.1
Dorn0.5140–1; higher is more readable
36.4Δ 35.4
Mi0.0360–1; higher is more readable
3.0Δ 2.0
LLOC4Logical lines; fewer is more readable
59.6Δ 58.6
DeepSeek V4 Pro12.670–20; mean of three runs
33.8Δ 32.8
GPT-6.1 Sol15.330–20; mean of three runs
39.9Δ 38.9
BTTF0.5360–1; higher is more readable
54.5Δ 53.5
Human2.011–5; original rating
1.0

Views

Download official ZIP ↗

Select the downloaded ZIP or its extracted folder. Files stay in your browser.

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(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.

Score0.518

Feature contributions

FeatureValueContribution
(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.

Score0.036
Score4
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.