Sample
int-6170b7536ce0-I09
Select one of ten low-readability unrelated code templates per class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.838 | 0–1; higher is more readable |
| Dorn | 0.281 | 0–1; higher is more readable |
| Mi | 0.039 | 0–1; higher is more readable |
| LLOC | 43 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 15.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15 | 0–20; mean of three runs |
| BTTF | 0.328 | 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. | 2533.017 | −83.59 |
| Source linesThe number of non-empty source lines. | 118 | +47.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.523 | −6.785 |
Intercept 8.87 + feature contributions = -34.304 (log-odds).
Score = sigmoid(-34.304) = 0.
| Score | 0.838 |
|---|
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. | 118 | −3.142 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 103 | +2.826 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 103 | −1.943 |
| 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.966 | −1.416 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 117.686 | +1.235 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 115.042 | +1.052 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.058 | +0.377 |
Intercept 0.07 + feature contributions = -0.941 (log-odds).
Score = sigmoid(-0.941) = 0.281.
| Score | 0.039 |
|---|
| Score | 43 |
|---|
Run 1
The code is mostly readable with clear intent and good structure, but contains a significant readability flaw. The class serves a clear purpose (preventing reference count changes on a wrapped ByteBuf) and uses descriptive method names. Most methods are concise and follow a consistent pattern of wrapping operations. Comments effectively explain non-obvious decisions, particularly for retainedSlice/duplicate methods. However, the suspicious obfuscated code block in the touch(Object hint) method - an unnecessary switch statement with a meaningless variable name - sharply breaks reading flow and appears malicious or accidental. This single element undermines trust and clarity. Nesting is minimal, and the code length is appropriate for its purpose. Without the obfuscated block, the code would score much higher, around 17-18.
Run 2
The code is well-structured and readable overall. It follows a clear pattern of wrapping operations to preserve the 'unreleasable' behavior. The methods are short and focused, each performing a single logical action. Nesting is minimal, with only one conditional in the order() method. Comments effectively explain non-obvious decisions about avoiding reference count leaks in tests. The constructor handles the case of nested UnreleasableByteBuf cleanly. However, the code loses points due to the presence of an obfuscated, dead code snippet in the touch(Object hint) method - a switch statement with bitwise operations that serves no purpose. This appears to be either leftover debugging code or deliberate obfuscation, which significantly hurts readability and clarity of intent. Without this anomaly, the code would score 19 or 20. The reading flow is natural, moving from construction through various slicing/duplication methods to reference count management methods.
Run 3
The code is generally well-structured and readable: classes and methods are logically organized, nesting is minimal, and most methods follow a clear one-action-per-line pattern. Comments explain non-obvious design decisions, improving clarity of intent. However, readability is significantly compromised by an obfuscated block of code in the `touch(Object hint)` method, which appears to be dead or decorative code using variable names like `lI0O_0b0d6afc`. This creates confusion and disrupts the natural reading flow. Additionally, the repeated comments about leak records are slightly verbose and could be condensed. Overall the code is maintainable and understandable for an experienced developer, but the injected obfuscation and some redundancy prevent a higher score.
Run 1
Code Structure: Most methods are logically grouped, small overrides supporting a clear wrapper abstraction, but touch(Object) contains an unrelated obfuscated block. Nesting: Generally flat, with only shallow conditionals; the injected block adds unnecessary block and switch nesting. Clarity of intent: Class documentation, descriptive method names, and explanatory comments establish the reference-counting behavior, while the cryptic variable and meaningless bitwise operations obscure intent locally. Code length: Most implementations are concise; repeated explanatory comments and the no-op block add avoidable length. Action granularity: Usually one action per line, but the chained assignment in order() and the compressed multi-statement block reduce readability. Reading flow: Consistent annotations, spacing, and predictable delegation make most of the class easy to scan, but the unformatted block abruptly disrupts that flow.
Run 2
Code Structure: Methods are logically organized around buffer wrapping and reference-count prevention, but an unrelated no-op block in touch(Object) disrupts coherence. Nesting: Most methods are flat; the injected block adds unnecessary block and switch nesting. Clarity of intent: Documentation, standard method names, and explanatory comments clearly establish the wrapper's purpose, whereas the cryptic variable and hexadecimal operations obscure intent. Code length: Implementations are concise, although repeated comments and the pointless switch add avoidable length. Action granularity: Most lines perform one action, but the chained assignment and densely packed switch block combine multiple operations. Reading flow: Consistent overrides and formatting make the class easy to scan until the unformatted, obfuscated block abruptly interrupts the flow.
Run 3
Code Structure: The wrapper is logically organized into short overrides, but touch(Object hint) contains an unrelated, obfuscated no-op block. Nesting: Most methods are flat; the unnecessary block and switch introduce localized complexity. Clarity of intent: The class documentation, method names, and leak-related comments explain the purpose well, whereas the cryptic variable and hexadecimal operations obscure intent. Code length: Implementations are concise, though repeated explanatory comments add bulk and the no-op code is entirely unnecessary. Action granularity: Most lines perform one action; the chained assignment in order() and the compressed switch block combine multiple operations. Reading flow: Consistent formatting and straightforward delegation make most of the class easy to follow, but the unformatted injected block sharply interrupts that flow.