Sample
int-d49af0618861-I06
Invert eligible conditions and exchange their branches
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.781 | 0–1; higher is more readable |
| Dorn | 0.731 | 0–1; higher is more readable |
| Mi | 0.516 | 0–1; higher is more readable |
| LLOC | 18 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 17.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 17.33 | 0–20; mean of three runs |
| BTTF | 0.606 | 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. | 2525.522 | −83.342 |
| Source linesThe number of non-empty source lines. | 75 | +30 |
| 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.021 | −6.032 |
Intercept 8.87 + feature contributions = -50.504 (log-odds).
Score = sigmoid(-50.504) = 0.
| Score | 0.781 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 75 | +1.857 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 76 | −1.655 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 74.902 | +0.637 |
| 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.07 | +0.261 |
| 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. | 81 | +0.234 |
Intercept 0.07 + feature contributions = 0.999 (log-odds).
Score = sigmoid(0.999) = 0.731.
| Score | 0.516 |
|---|
| Score | 18 |
|---|
Run 1
The code is well-structured and highly readable. It follows clear organizational patterns with a builder pattern implementation, simple constructor delegation, and straightforward method overrides. Nesting is minimal except in the singletonRequest method where the chained List.of calls create some depth, but this is a common pattern that remains clear. Intent is explicit through descriptive method and variable names. Code length is concise without sacrificing clarity. Action granularity is excellent in most places, with each method performing a single logical operation. The singletonRequest method chains multiple setters but maintains readability through consistent indentation. Reading flow is natural, following a logical progression from class declaration through builder, constructor, and utility methods. Minor deductions for the multi-line chained call in singletonRequest which could be extracted, but overall this code represents production-quality readability.
Run 2
The code is well-structured with clear separation of concerns (Builder, private constructor, static factory methods). Nesting is limited to the fluent API call in singletonRequest, which reads naturally. Intent is explicit—each method has a single responsibility and naming is descriptive. The code is concise without sacrificing clarity. Actions are generally one per line, especially in the fluent chain. Reading flow is logical: class definition, builder, core methods, then utility. Minor deductions: the singletonRequest method has a slightly deep nested structure, and the getErrorResponse method combines error resolution with response construction on one line. Overall, highly readable with only trivial readability concerns.
Run 3
The code is generally well-structured and readable. It follows a clear builder pattern, separates concerns effectively, and maintains a shallow nesting level. Class organization is logical—constructor, data accessor, parse method, and static factory. Intent is mostly clear, though the `getErrorResponse` method's purpose could be slightly more explicit. The `singletonRequest` method uses method chaining effectively but becomes a bit dense with nested `List.of` calls; while it avoids deep indentation, vertical eye movement increases. Action granularity is mostly one action per line, though the chained setters bundle multiple operations per line. Overall, concise and idiomatic Kafka code with no major readability blockers, but the nested list construction slightly reduces clarity.
Run 1
Code Structure: The builder, request data, and helper methods are logically organized with clear responsibilities. Nesting: Most methods are flat, but singletonRequest nests fluent setters and List.of calls, making closing parentheses harder to follow. Clarity of intent: Descriptive method and field names communicate purpose well, although the seven-parameter helper requires careful reading. Code length: The implementation is concise, with little unnecessary code. Action granularity: Most lines perform one assignment, return, or setter operation; nested construction expressions combine several actions but remain reasonably legible. Reading flow: The conventional class layout and short methods support natural reading, while inconsistent indentation in singletonRequest slightly disrupts it.
Run 2
Code Structure: Logically organized into a builder, request state, and focused factory/response methods. Nesting: Most methods are flat; singletonRequest has moderately nested object construction and closing parentheses that require extra attention. Clarity of intent: Descriptive method names, types, and setters make the request's purpose clear, though the seven-parameter factory adds cognitive load. Code length: Concise, with little unnecessary code and appropriate framework boilerplate. Action granularity: Statements generally perform one action, and chained setters appear on separate lines; nested construction combines several related actions in one expression. Reading flow: Natural progression and consistent formatting support easy reading, with minor friction from singletonRequest's indentation and nested fluent chains.
Run 3
Code Structure: Well organized into a builder, request state, and focused construction/response methods. Nesting: Most methods are flat, but singletonRequest nests fluent setters and List.of calls, making parentheses harder to track. Clarity of intent: Descriptive names and conventional request patterns clearly communicate purpose; the seven-parameter factory requires some care to understand. Code length: Concise, with little unnecessary code. Action granularity: Most statements perform a single clear action, and fluent setters generally occupy separate lines, though nested object creation combines several operations in one expression. Reading flow: The class follows a natural progression, but inconsistent indentation and dense closing parentheses in singletonRequest interrupt otherwise smooth reading.