Sample
int-4790f5c8aba1-I06
Invert eligible conditions and exchange their branches
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.873 | 0–1; higher is more readable |
| Dorn | 0.797 | 0–1; higher is more readable |
| Mi | 0.033 | 0–1; higher is more readable |
| LLOC | 39 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 10 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15.67 | 0–20; mean of three runs |
| BTTF | 0.636 | 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. | 2331.498 | −76.939 |
| 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.439 | −6.659 |
Intercept 8.87 + feature contributions = -28.328 (log-odds).
Score = sigmoid(-28.328) = 0.
| Score | 0.873 |
|---|
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.537 | +1.205 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 114.932 | +1.05 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| 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 = 1.369 (log-odds).
Score = sigmoid(1.369) = 0.797.
| Score | 0.033 |
|---|
| Score | 39 |
|---|
Run 1
The code has significant readability issues. The most problematic is the `order()` method, which uses inverted boolean logic with empty if-blocks and else-clauses, making the flow difficult to parse: `if (!(condition)) {} else { return this; }`. This pattern is unnecessarily convoluted. The constructor's nested ternary with unwrap adds minor complexity. While the class structure is logical and most methods are concise with clear intent, the comments explaining why retained methods delegate to non-retained versions are helpful but repetitive. The code would benefit from direct boolean checks and extracting the negative logic into positive conditions. Overall, the code is functional but the unnatural conditionals significantly reduce readability.
Run 2
The code is mostly structured and purpose is clear, but readability suffers due to inverted conditional patterns like `if (!(x)) {} else { ... }` instead of direct positive conditions, especially in the `order` method. This creates unnatural reading flow and unnecessary nesting. The class has clear intent and concise, one-action-per-line style in most methods, but some conditional logic is awkwardly phrased. Comments are helpful in explaining non-obvious behavior. Overall, the code is maintainable but could be significantly improved with cleaner conditionals.
Run 3
The code has a clear purpose and good documentation, but readability is significantly hurt by inconsistent conditional formatting. Several if statements use awkward structures like `if (!(condition)) {} else { ... }`, which are confusing and should be simplified to standard `if (condition == false)` or early returns. The `order()` method has convoluted logic and unnecessary null-check patterns. While the class structure is logical and method names are clear, the action granularity suffers from the multi-line conditional expressions. The repetitive comments about leak records are verbose and could be consolidated. The nesting is minimal (flat), which is positive, but the unusual if-else patterns create artificial cognitive overhead. The code length is reasonable and the overall intent is understandable, but the conditional syntax choices make it less readable than it should be.
Run 1
Code Structure: Methods are logically grouped around buffer views and reference-count operations. Nesting: Most methods are flat, with only shallow conditionals in order(). Clarity of intent: Class documentation, descriptive method names, and explanatory comments establish the wrapper's purpose, but negated conditions with empty branches obscure otherwise simple checks. Code length: Methods are concise; repeated leak-explanation comments add avoidable verbosity, though many overrides are necessary. Action granularity: Most lines perform one action, but chained assignment and validation embedded in a condition combine operations. Reading flow: Consistent overrides and straightforward delegation support natural reading, while excessive parentheses, empty branches, and local-field name shadowing interrupt the flow in order().
Run 2
Code Structure: Methods are logically grouped around buffer views and reference-count operations, with consistent overrides. Nesting: Mostly flat, although order() uses confusing negated conditions with empty branches and else blocks. Clarity of intent: The class documentation, descriptive method names, and leak-related comments explain the wrapper's purpose well; excessive parentheses and local-field shadowing obscure order(). Code length: Most methods are concise, but repeated explanatory comments add avoidable length. Action granularity: Generally one action per line, except the chained field/local assignment and inline validation within a condition. Reading flow: Consistent formatting and straightforward delegation make most of the class easy to scan, but the inverted control flow in order() interrupts otherwise natural reading.
Run 3
Code Structure: Logically organized around buffer wrapping, derived views, and reference-count operations, with consistent overrides. Nesting: Mostly flat, though order() uses confusing empty if branches and else blocks instead of straightforward guards. Clarity of intent: The class documentation, descriptive method names, and explanatory comments establish its purpose; negated conditions and excessive parentheses obscure order(). Code length: Methods are concise, but repeated lengthy comments add unnecessary bulk. Action granularity: Most lines perform one action; the chained assignment and embedded null check combine operations and increase reading effort. Reading flow: Consistent formatting and predictable delegation make most methods easy to scan, while local field-name shadowing and inverted branching interrupt the flow in order().