Sample
Scalabrio164
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0.042 | 0–1; higher is more readable | 84.4Δ 1.5 |
| Scalabrino | 0.82 | 0–1; higher is more readable | 86.9Δ 4.0 |
| Dorn | 0.632 | 0–1; higher is more readable | 69.3Δ 13.6 |
| Mi | 0.757 | 0–1; higher is more readable | 94.5Δ 11.6 |
| LLOC | 10 | Logical lines; fewer is more readable | 68.6Δ 14.3 |
| DeepSeek V4 Pro | 15.33 | 0–20; mean of three runs | 66.6Δ 16.3 |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs | 58.5Δ 24.4 |
| BTTF | 0.609 | 0–1; higher is more readable | 73.9Δ 9.0 |
| Human | 4.22 | 1–5; original rating | 82.9 |
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. | 487.282 | −16.08 |
| Source linesThe number of non-empty source lines. | 28 | +11.2 |
| 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.745 | −7.118 |
Intercept 8.87 + feature contributions = -3.128 (log-odds).
Score = sigmoid(-3.128) = 0.042.
| Score | 0.82 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 1 | −0.703 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 71.5 | +0.349 |
| 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 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.083 | +0.136 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 28 | +0.045 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 26.827 | −0.035 |
Intercept 0.07 + feature contributions = 0.539 (log-odds).
Score = sigmoid(0.539) = 0.632.
| Score | 0.757 |
|---|
| Score | 10 |
|---|
Run 1
The code is generally clear with good documentation and logical structure. It has a single try-catch with flat nesting and one action per line, aligning with criteria 2, 5, and 6. Intent is explicit. However, the exception handling pattern is awkward: catching a broad `CacheException` then checking `instanceof NonStopCacheException` could be split into separate catch blocks for better readability and to reduce unnecessary type casting. The `else` blocks after `return` statements add minor verbosity—`if (element == null) return null;` followed directly by `return element.getObjectValue()` would shorten the method without losing clarity. Overall the method is easy to follow, but slight structural refinements would improve it.
Run 2
The code is well-structured and readable. It has a clear, single-purpose method with good documentation. Nesting is moderate: a try-catch with an if-else inside, and another if-else inside the catch — acceptable but slightly deeper than ideal. The reading flow is natural: fetch, check null, return value, handle exception. Action granularity is good — most lines do one thing. Length is appropriate for the logic. The main readability improvements would be flattening the nested if-else (using early returns) and extracting the exception type check, but overall the code is clear and maintainable.
Run 3
The code structure is logically organized, with a clear try-catch flow and straightforward retrieval logic. Nesting is low, making it easy to follow. The intent is generally clear, though the exception handling introduces some ambiguity: the separate `instanceof` check inside the catch block is redundant and slightly disrupts flow. Action granularity is mostly good, with one action per line, but the exception handler call spans multiple lines unnecessarily. The reading flow is natural, except for the awkward catch-block branching. Code length is concise overall, but could be trimmed by consolidating the exception logic. Removing the redundant `instanceof` check and simplifying the exception handling would improve both clarity and code length.
Run 1
Code Structure: Logically separates cache lookup from exception handling. Nesting: Moderate try/catch and conditional nesting; unnecessary else blocks after returns could be removed. Clarity of intent: Documentation and descriptive API names clearly convey retrieval behavior, though returning null after a non-stop cache exception is less obvious from the documentation. Code length: Compact overall, with minor opportunities to simplify control flow. Action granularity: Each statement performs one clear action; the wrapped handler call remains understandable. Reading flow: Lookup, missing-value handling, and value return follow naturally, followed by specific exception handling and wrapping. Fully qualified exception naming and verbose handler names slightly interrupt the otherwise straightforward flow.
Run 2
Code Structure: The method logically separates cache retrieval from exception handling. Nesting: Moderate nesting from try/catch and conditionals remains manageable; redundant else blocks after returns could be removed. Clarity of intent: The documentation, descriptive names, and explicit return paths clearly convey lookup behavior, although returning null after a non-stop cache exception is not documented. Code length: Short and focused, with minor opportunities to simplify control flow. Action granularity: Each statement performs a distinct action; the wrapped handler call remains readable. Reading flow: Execution proceeds naturally from retrieval to result handling and then exception handling, with only slight disruption from verbose exception names and inconsistent spacing.
Run 3
Code Structure: Logically separates cache retrieval from exception handling. Nesting: Moderate nesting from try/catch and conditionals; redundant else blocks after returns could be removed. Clarity of intent: Documentation and descriptive names clearly explain retrieval and missing-value behavior, though specialized exception handling requires domain knowledge. Code length: Compact overall, with minor verbosity from unnecessary else branches and the fully qualified exception type. Action granularity: Statements generally perform one action each; the chained handler call remains readable across lines. Reading flow: Follows a natural lookup, null check, value return, and error-handling sequence, with consistent formatting.