Sample
int-de3afbebebf3-I08
Select one of ten high-readability unrelated code templates per class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.85 | 0–1; higher is more readable |
| Dorn | 0.255 | 0–1; higher is more readable |
| Mi | 0.039 | 0–1; higher is more readable |
| LLOC | 46 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 14 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15 | 0–20; mean of three runs |
| BTTF | 0.383 | 0–1; higher is more readable |
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. | 2569.382 | −84.79 |
| Source linesThe number of non-empty source lines. | 126 | +50.4 |
| 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.471 | −6.706 |
Intercept 8.87 + feature contributions = -32.226 (log-odds).
Score = sigmoid(-32.226) = 0.
| Score | 0.85 |
|---|
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. | 127 | −3.46 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 111 | +3.102 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 111 | −2.126 |
| 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. | 119.953 | −1.416 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 125.669 | +1.347 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 113.559 | +1.028 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.057 | +0.385 |
Intercept 0.07 + feature contributions = -1.07 (log-odds).
Score = sigmoid(-1.07) = 0.255.
| Score | 0.039 |
|---|
| Score | 46 |
|---|
Run 1
The code is generally well-structured with a clear class purpose documented in the Javadoc. Methods are short and follow consistent patterns, making the intent clear. However, there is a significant irregularity: an unrelated Fibonacci calculation block appears inside the touch() method, which disrupts reading flow and clarity. Aside from this, nesting is shallow, naming is descriptive, and comments explain non-obvious design decisions regarding reference counting. The implementation would otherwise be highly readable for a Netty buffer wrapper.
Run 2
The code is generally well-structured with clear class purpose and consistent method naming, but has notable readability issues. The main problems are: (1) an unrelated Fibonacci sequence code block inexplicably inserted inside the touch() method, completely breaking logical flow; (2) some methods contain verbose comments explaining why alternative implementations weren't used, which adds length; (3) inconsistent braces - the touch() method has an extra opening brace with nested code before the return statement. Positive aspects include: flat nesting (no deep conditionals), clear wrapper pattern implementation, good use of method delegation, and generally one action per line. The order() method's lazy initialization pattern is readable. Without the extraneous code block and brace issues, this would score higher. The class achieves its intent of wrapping buffers to prevent reference count changes, but the accidental code insertion and formatting inconsistencies significantly impact readability.
Run 3
The code is generally well-structured, with a clear class purpose and mostly one action per line. However, there is a major readability issue: the `touch()` method contains a completely unrelated Fibonacci sequence calculation that should not be there. This breaks the reading flow and makes the intent ambiguous. The nesting level is low, and most methods are concise and straightforward. The comments explaining why `readRetainedSlice` and similar methods delegate to non-retained versions are helpful. The constructor logic is compact but understandable. Overall readability is good except for the erroneous block in `touch()`, which is glaringly out of place and confusing.
Run 1
Code Structure: Most methods form a logically organized buffer wrapper, but the unrelated Fibonacci-style block in touch() disrupts cohesion. Nesting: Generally shallow, with simple conditionals; touch() adds an unnecessary block and loop. Clarity of intent: The class documentation, descriptive method names, and leak-related comments explain reference-count behavior well, but the unused calculation has no apparent purpose. Code length: Methods are concise, although repeated explanatory comments and the irrelevant loop add avoidable length. Action granularity: Most lines perform one action; the chained swappedBuf assignment combines updates and slightly complicates reading. Reading flow: Consistent overrides and straightforward delegation make the class easy to scan, but abruptly inconsistent indentation in touch() interrupts the otherwise natural flow.
Run 2
Code Structure: Mostly well-organized, with short overrides grouped by related buffer operations, but touch() contains an unrelated Fibonacci-style loop. Nesting: Generally shallow; the extra block and loop in touch() introduce unnecessary nesting. Clarity of intent: Class documentation, descriptive method names, and explanatory comments clearly communicate reference-count protection, while the unused calculation obscures touch()'s purpose. Code length: Methods are concise, although repeated explanatory comments and the irrelevant loop add avoidable length. Action granularity: Most lines perform one action; the chained assignment in order() combines local assignment, field assignment, and object creation. Reading flow: Consistent override formatting and predictable delegation make the class easy to scan, but the abruptly misindented block in touch() disrupts the otherwise natural flow.
Run 3
Code Structure: Mostly well-organized, with short overrides grouped by related buffer operations, but touch() contains an unrelated sequence calculation. Nesting: Generally shallow; the unnecessary block and loop in touch() add avoidable nesting. Clarity of intent: Class documentation, descriptive method names, and comments clearly explain reference-count behavior, while the unused calculation obscures touch()'s purpose. Code length: Most methods are concise, though repeated explanatory comments and dead computation add unnecessary length. Action granularity: Usually one action per line; the chained assignment in order() combines local and field updates, slightly reducing clarity. Reading flow: Consistent override formatting and predictable delegation make the class easy to scan, but the poorly indented calculation abruptly disrupts that flow.