Sample
Dorn/java/166
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 38.2Δ 15.6 |
| Scalabrino | 0.837 | 0–1; higher is more readable | 90.7Δ 36.9 |
| Dorn | 0.529 | 0–1; higher is more readable | 45.1Δ 8.6 |
| Mi | 0.742 | 0–1; higher is more readable | 91.6Δ 37.9 |
| LLOC | 18 | Logical lines; fewer is more readable | 38.4Δ 15.3 |
| DeepSeek V4 Pro | 14.33 | 0–20; mean of three runs | 69.9Δ 16.2 |
| GPT-6.1 Sol | 15.33 | 0–20; mean of three runs | 58.6Δ 4.9 |
| BTTF | 0.635 | 0–1; higher is more readable | 82.2Δ 28.4 |
| Human | 3.38 | 1–5; original rating | 53.8 |
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. | 1182.411 | −39.02 |
| Source linesThe number of non-empty source lines. | 50 | +20 |
| Byte entropyHow varied the bytes in the source text are. Repeated bytes give a lower value; a more even mixture gives a higher value. | 5.153 | −7.729 |
Intercept 8.87 + feature contributions = -17.879 (log-odds).
Score = sigmoid(-17.879) = 0.
| Score | 0.837 |
|---|
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. | 51 | −0.769 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 42 | +0.716 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 93.902 | +0.711 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 42 | −0.543 |
| 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. | 93.922 | −0.313 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 49.621 | +0.284 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.101 | −0.039 |
Intercept 0.07 + feature contributions = 0.116 (log-odds).
Score = sigmoid(0.116) = 0.529.
| Score | 0.742 |
|---|
| Score | 18 |
|---|
Run 1
The code is generally readable with clear intent and logical structure. The class extends and implements appropriately, and method names are descriptive. Nesting is shallow (one level inside try/catch), and each action is on its own line. The getColor method has a minor issue: it caches null values, potentially causing repeated failed lookups. The empty comment block and single-line comment add noise. The colorMap is a raw type, losing type safety, and no synchronization is shown despite potential multi-threaded use. The structure follows a natural flow, but the code could be more concise by extracting caching logic. Overall, it's readable but has some maintainability concerns.
Run 2
The code is moderately readable with a clear overall structure and straightforward methods. It benefits from short method bodies and basic Javadoc comments. However, it has several issues: use of raw Map type (no generics), an unnecessary initial color assignment, potential null pointer risk when rgb array is empty, and a null value is stored in the colorMap if an exception occurs, which can lead to confusing behavior. The getColor method mixes caching logic with exception handling and multiple paths, slightly reducing clarity. Nesting is shallow and actions are mostly one per line, but naming conventions like 'sID' are slightly unclear. Overall, it is understandable but could be improved with generics, null handling, and simpler logic flow.
Run 3
The code is moderately readable but has several issues. Structure is logical (constructor overloads, override, cache clearing) but the colorMap is static and non-generic, weakening type safety and intent. Nesting is acceptable — only one try-catch and one if-else. Clarity of intent is mixed: the method purpose is clear, but the commented-out error handling and magic number `-1` obscure behavior. Code length is reasonable; no obvious bloat. Action granularity is mostly one action per line, though multiple operations occur in the if-else block. Reading flow is natural: check cache, compute color, store and return. Main deductions: raw Map type, unused classLoader parameter, dead commented code, and lack of null-safety for `rgb` array. Overall, understandable but not polished.
Run 1
Code Structure: Methods are logically separated into construction, color retrieval, and cache clearing. Nesting: Shallow conditionals and a single try/catch keep complexity low; the cache-hit early return helps. Clarity of intent: The caching and color-resolution logic are understandable, but sID, the rgb[0] sentinel, a raw Map, and silent exception handling leave details unclear. Code length: Compact overall, although empty Javadocs and commented-out logging add clutter. Action granularity: Statements generally perform one action per line, with readable method calls. Reading flow: Retrieval proceeds naturally from cache lookup to resolution, caching, and return. Inconsistent comment formatting and the missing final class-closing brace slightly detract from presentation.
Run 2
Code Structure: Constructors, color lookup, and cache clearing are logically separated. Nesting: Shallow conditionals and an early cache return keep complexity manageable. Clarity of intent: Method names communicate purpose, but sID, raw Map usage, the rgb[0] sentinel, and silent exception handling obscure details. Code length: The implementation is concise, though empty documentation and commented-out logging add clutter. Action granularity: Most lines perform one action; chained calls in color creation remain understandable. Reading flow: Cache lookup, color resolution, caching, and return follow a natural sequence. Inconsistent formatting and the missing final class-closing brace reduce polish.
Run 3
Code Structure: Constructors, color retrieval, and cache clearing are logically separated, although the snippet lacks a closing class brace. Nesting: An early cache return keeps nesting modest; the try/catch and RGB conditional are easy to follow. Clarity of intent: Method names communicate their purposes, but sID, raw Map usage, the rgb[0] sentinel, and silent exception handling obscure details. Code length: The implementation is concise, though empty documentation and commented-out logging add clutter. Action granularity: Statements generally perform one action per line, with no compressed multi-statement lines. Reading flow: Retrieval proceeds naturally from cache lookup to color resolution, caching, and return; inconsistent formatting and obsolete comments slightly interrupt that flow.