Sample
Schnappinger/argoUML/org.argouml.uml.ui.UMLTreeCellRenderer
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 49.8Δ 21.4 |
| Scalabrino | 0.473 | 0–1; higher is more readable | 7.2Δ 21.2 |
| Dorn | 0.412 | 0–1; higher is more readable | 55.8Δ 27.4 |
| Mi | 0.562 | 0–1; higher is more readable | 46.5Δ 18.2 |
| LLOC | 29 | Logical lines; fewer is more readable | 50.0Δ 21.6 |
| DeepSeek V4 Pro | 15.33 | 0–20; mean of three runs | 41.3Δ 12.9 |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs | 38.9Δ 10.6 |
| BTTF | 0.568 | 0–1; higher is more readable | 52.8Δ 24.4 |
| Human | 3 | 1–4; original rating | 28.4 |
Views
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. | 2622.278 | −86.535 |
| Source linesThe number of non-empty source lines. | 137 | +54.8 |
| 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.962 | −7.444 |
Intercept 8.87 + feature contributions = -30.309 (log-odds).
Score = sigmoid(-30.309) = 0.
| Score | 0.473 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 138 | −3.85 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 84 | +2.168 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 84 | −1.507 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 136.938 | +1.504 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.042 | +0.537 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 77.167 | +0.441 |
| 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. | 79.964 | +0.278 |
Intercept 0.07 + feature contributions = -0.358 (log-odds).
Score = sigmoid(-0.358) = 0.412.
| Score | 0.562 |
|---|
| Score | 29 |
|---|
Run 1
The code is well-structured and readable overall. It follows standard Java conventions, has a clear class purpose documented in Javadoc, and uses meaningful variable names (e.g., 'lab', 'type', 'buf'). The method body is mostly flat with only two nesting levels, and the action granularity is appropriate—one primary action per line. The reading flow is logical: extract user object, delegate to super, then handle icon and tooltip. Minor deductions: the copyright header is verbose and adds visual noise before the code, the mixed use of StringBuffer (when StringBuilder would suffice) is slightly dated, and the conditional chain for setting 'type' could be simplified. Additionally, the superclass call has many parameters that create moderate line-length pressure. Overall, clarity of intent is strong, structure is clean, and nesting is minimal compared to typical Swing renderer implementations.
Run 2
The code is generally well-structured and readable. It has clear organization, moderate nesting (only two levels deep), and good clarity of intent via descriptive variable names like 'lab', 'icon', and 'type'. The method performs a focused single responsibility (rendering a tree cell). However, there are minor readability issues: the initial 'if(value instanceof DefaultMutableTreeNode)' block lacks braces, which can be error-prone, and the string building for the tooltip using StringBuffer is verbose for modern Java. The code length is reasonable, and action granularity is mostly one action per line. Reading flow is natural despite the long license header. Overall, it is maintainable but could be slightly improved with consistent brace usage and using StringBuilder or String.format for tooltip construction.
Run 3
The code is generally clear and well-structured. It has a single method with a logical, sequential flow: unwrap node, call super, set icon, and set tooltip. Nesting is moderate - the main `if (value != null && r instanceof JLabel)` block contains the bulk of the logic, with one secondary else-if inside, which is acceptable. Intent is clear from method and variable names (`lab`, `type`, `icon`) plus comments. However, the tooltip construction section is somewhat verbose: the `StringBuffer` append sequence could be more concise, and separating string building into a helper method would improve readability. The initial node unwrapping and super call are concise, one action per line. The long license header, while not directly affecting method readability, adds noise. Overall, the code is readable but the tooltip building drags it down slightly.
Run 1
Code Structure: The class is logically organized, with a single rendering method that unwraps the node, delegates rendering, and configures the icon and tooltip. Nesting: Conditional depth is moderate; the outer guard contains several branches but remains manageable. Clarity of intent: Documentation, API names, and comments make the purpose clear, though abbreviated variables such as r, lab, and buf reduce clarity. Code length: The implementation is reasonably concise, but verbose tooltip construction and extensive license boilerplate increase reading overhead. Action granularity: Statements generally perform one action per line, making changes easy to follow. Reading flow: Processing follows a natural sequence and ends with a straightforward return; inconsistent indentation and heavily wrapped calls slightly interrupt the flow.
Run 2
Code Structure: A single focused renderer method follows logical stages: unwrap the node, delegate rendering, customize the icon, and set the tooltip. Nesting: Conditional nesting is moderate and easy to follow, although the outer customization guard encloses most logic. Clarity of intent: Class documentation and comments explain the purpose well; abbreviated names such as r, lab, and sel reduce clarity slightly. Code length: Implementation is reasonably concise, but repetitive buffer appends and extensive license headers add visual bulk. Action granularity: Statements generally perform one action per line, making changes easy to inspect. Reading flow: Execution proceeds naturally from obtaining the component to customizing and returning it; inconsistent tab/space indentation and heavily wrapped method arguments mildly interrupt the flow.
Run 3
Code Structure: A single focused renderer method logically separates node unwrapping, default rendering, icon selection, and tooltip construction. Nesting: Moderate nesting remains manageable, although the outer conditional encloses several branches. Clarity of intent: Class documentation and comments explain the rendering purpose; abbreviated names such as r, lab, and buf reduce clarity. Code length: Implementation is reasonably concise, but lengthy license headers and repetitive buffer appends add visual bulk. Action granularity: Statements generally perform one action per line, making individual operations easy to inspect. Reading flow: Execution follows a natural sequence and returns the rendered component at the end; inconsistent indentation and heavily wrapped method calls slightly disrupt scanning.