Sample
int-ea5987f6ce90-I11
Split eligible integer literals into pairs of short-named intermediate variables
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.876 | 0–1; higher is more readable |
| Dorn | 0.803 | 0–1; higher is more readable |
| Mi | 0.039 | 0–1; higher is more readable |
| LLOC | 39 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 16.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs |
| BTTF | 0.644 | 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. | 2218.293 | −73.204 |
| Source linesThe number of non-empty source lines. | 116 | +46.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.432 | −6.647 |
Intercept 8.87 + feature contributions = -24.581 (log-odds).
Score = sigmoid(-24.581) = 0.
| Score | 0.876 |
|---|
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. | 116 | −3.071 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 101 | +2.756 |
| 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. | 115.62 | +1.206 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 114.932 | +1.05 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.055 | +0.411 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
Intercept 0.07 + feature contributions = 1.405 (log-odds).
Score = sigmoid(1.405) = 0.803.
| Score | 0.039 |
|---|
| Score | 39 |
|---|
Run 1
The code is well-structured with clear purpose, demonstrating good readability. The class has a focused responsibility (preventing reference count changes) and follows logical organization with methods grouped by related functionality. Nesting is minimal, with only one conditional in the order() method. Variable naming is descriptive (swappedBuf, endianness) and the constructor cleverly unwraps nested instances. Comments explain non-obvious design decisions, particularly regarding potential memory leaks. The code length is appropriate, avoiding unnecessary verbosity while providing meaningful overrides. Action granularity is mostly one action per line. Reading flow is natural, with related methods grouped together. Minor improvements could include extracting the repeated leak-prevention comment into a class-level javadoc, but this doesn't significantly impact readability.
Run 2
The class is well-structured with a clear single responsibility: wrapping a ByteBuf to prevent reference count changes. Each method is concise and follows a consistent pattern, making the code predictable. Nesting is minimal—only the constructor and order() method have conditional logic, and it remains shallow. The intent is explicit through method names and a class name that clearly communicates its purpose. Comments are used sparingly but effectively to explain non-obvious decisions about avoiding leaks. Action granularity is appropriate, with one logical operation per line (e.g., wrapping and calling a delegate method). Reading flow is natural; methods are grouped by logical concern (creation methods first, then no-op lifecycle methods). Minor deductions: repeated comments and method patterns could be reduced with helper methods, and the class could benefit from a class-level Javadoc explaining broader design rationale.
Run 3
The code is highly readable. It uses a clear class name (`UnreleasableByteBuf`) and straightforward constructor logic that handles wrapping of already-unreleasable buffers. Methods are short, focused, and delegate to the wrapped buffer with minimal nesting. The pattern of overriding release/retain/touch methods to return `this` or `false` clearly communicates intent. The repeated comments in `readRetainedSlice`, `retainedSlice`, `retainedSlice(int,int)`, and `retainedDuplicate` explain non-obvious design decisions, improving clarity without excessive length. The `order` method’s lazy initialization of `SwappedByteBuf` is readable, with only a single level of nesting. Overall, the code follows best practices for a wrapper class: flat structure, consistent delegation, and purposeful comments without clutter.
Run 1
Code Structure: Logically organized wrapper methods keep buffer-view operations and reference-count overrides easy to locate. Nesting: Very shallow, with simple conditionals and early returns. Clarity of intent: The class documentation, descriptive method names, and explanatory comments clearly communicate why reference-count changes are suppressed. Code length: Methods are concise, though repeated leak-related comments add avoidable length. Action granularity: Most lines perform a single action; the chained assignment in order() combines local assignment, field assignment, and construction, slightly reducing readability. Reading flow: Consistent formatting and predictable override patterns support natural reading, although local field-name shadowing and repeated comments introduce minor friction.
Run 2
Code Structure: Well-organized wrapper class with small, focused overrides and related operations grouped together. Nesting: Very shallow; simple conditionals and early returns keep control flow easy to follow. Clarity of intent: Class documentation, descriptive method names, and explanatory comments clearly convey the reference-count protection behavior. Code length: Methods are concise, although repeated leak-explanation comments add avoidable verbosity. Action granularity: Most lines perform one action; the chained assignment in order() and inline null validation slightly reduce clarity. Reading flow: Consistent formatting and predictable delegation make the code natural to scan, though local field shadowing in order() requires extra attention.
Run 3
Code Structure: A focused wrapper class with logically grouped overrides and consistent formatting. Nesting: Very shallow; simple conditionals and early returns keep methods easy to follow. Clarity of intent: The class documentation, descriptive method names, and explanatory comments clearly communicate reference-count protection and retained-view behavior. Code length: Methods are concise, although repeated leak-explanation comments add avoidable length. Action granularity: Most lines perform one action; the chained assignment in order() combines cache initialization and local assignment, slightly reducing clarity. Reading flow: Predictable delegation patterns and short methods support natural reading, though local-field name shadowing in order() requires extra attention.