Sample
int-a127c62f9f43-I05
Rewrite eligible decimal integer literals in hexadecimal notation
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 | 17.33 | 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 code is highly readable with clear structure and intent. The class serves a single, well-documented purpose: wrapping ByteBuf to prevent reference count changes. Methods are logically organized, flat (no deep nesting), and concise—each method performs one clear action. The use of delegation methods like `slice()`, `duplicate()`, and `readSlice()` is straightforward, though there is minor repetition in comments for retained methods. The constructor handles unwrapping gracefully, and the `order()` method is efficient with proper null checks. Action granularity is excellent—one operation per line. Reading flow is natural, with names clearly expressing intent. Minor improvements could reduce comment repetition, but overall this is exemplary maintainable code.
Run 3
The code is highly readable due to its clear structure, flat nesting, and consistent one-action-per-line granularity. The class purpose is well-documented, and method names clearly express intent. Redundant comments are repeated but helpful in explaining non-obvious design decisions regarding leak prevention. The `order()` method has slightly more complex nesting with lazy initialization, but remains understandable. Overall, the code is concise, logically organized, and follows a natural reading flow.
Run 1
Code Structure: Logically organized wrapper class, with related buffer operations grouped before reference-count methods. Nesting: Very shallow; simple conditionals and early returns keep methods easy to follow. Clarity of intent: Descriptive names, class documentation, and explanatory comments clearly communicate the unreleasable behavior and retained-operation choices. Code length: Methods are concise, although repeated leak-related comments add avoidable length. Action granularity: Most lines perform one clear action; the chained assignment in order() combines local and field updates, slightly reducing readability. Reading flow: Consistent overrides and predictable delegation produce a natural flow. Minor friction comes from the local variable shadowing swappedBuf and compact ternary expressions, but overall readability is high.
Run 2
Code Structure: Well-organized wrapper class with related operations grouped coherently and small, focused overrides. Nesting: Very shallow; simple conditionals and early returns make control flow easy to follow. Clarity of intent: The class documentation, descriptive method names, and explanatory comments clearly establish reference-count suppression and wrapping behavior. Code length: Methods are concise, although repeated leak-explanation comments add avoidable length. Action granularity: Most lines perform a single action; the chained assignment in order() combines cache and local-variable updates, slightly reducing clarity. Reading flow: Consistent formatting and predictable delegation create a natural flow. Minor friction comes from the local variable shadowing the swappedBuf field and repeated comments, but overall readability is high.
Run 3
Code Structure: Well-organized wrapper class with small, focused overrides and related operations grouped together. Nesting: Very shallow; simple conditionals and early returns make control flow easy to follow. Clarity of intent: The class documentation, descriptive method names, and explanatory comments clearly communicate reference-count suppression and wrapper behavior. Code length: Methods are concise, although repeated leak-related comments add unnecessary length. Action granularity: Most lines perform one action, but the chained assignment in order() combines cache initialization and local assignment, slightly reducing clarity. Reading flow: Consistent formatting and predictable delegation patterns support natural reading. Minor friction comes from the local swappedBuf shadowing the field and the constructor's compact conditional expression.