Sample
int-c9dd6f20458e-SRC
Unmodified source class
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 | 0–20; mean of three runs |
| GPT-6.1 Sol | 17 | 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 with clear separation of concerns between the Builder, request, and parsing logic. It follows common Kafka patterns, making intent relatively clear. The nesting in singletonRequest is moderate but controlled, using method chaining that is readable. Action granularity is generally one property per line in the chained setters, which aids readability. However, the singletonRequest method is somewhat long and indentation-heavy, though not excessive. The Builder and parse methods are concise. Overall, the code is readable but could be slightly improved with better formatting or extracted helpers in the factory method.
Run 2
The code is well-structured, with a clear separation between the builder, request data, and factory methods. It follows a flat, non-deeply nested style; the only minor nesting is in `singletonRequest`, where building nested `TopicData` and `PartitionData` requires some indentation, but it remains readable. Clarity of intent is high: method and class names are self-explanatory, and the purpose of each method is obvious. Code length is appropriate — no excessive boilerplate beyond what the framework requires. Action granularity is good: each builder call is on its own line, improving readability. Reading flow is natural, with fields, constructors, and methods ordered logically. Minor deductions: `singletonRequest` returns a `VoteRequestData` rather than a `VoteRequest`, which slightly breaks intuitive naming, and imports are not formatted with blank lines between packages. Overall, highly readable.
Run 3
The code is highly readable with a clear, logical structure. The Builder pattern is properly separated from the request class, and methods are concise with single responsibilities. Nesting is minimal and intentional, appearing only in the singletonRequest factory method where it mirrors the natural data hierarchy. Intent is immediately clear through descriptive method and parameter names. Code length is efficient without sacrificing clarity. The main readability challenge is the singletonRequest method's chained builder pattern, which, while fluent, creates moderate nesting depth. Additionally, the error response method performs multiple actions (creating response, setting error code) in a single expression, slightly reducing action granularity. Overall, the code follows Kafka's standard patterns well and would be easily understood by developers familiar with the codebase.
Run 1
Code Structure: Well organized into a builder, request state, and focused factory/override methods. Nesting: Most methods are flat, but singletonRequest nests topic and partition construction, making closing parentheses harder to follow. Clarity of intent: Descriptive method names and explicit setters communicate purpose clearly; the seven-parameter factory adds some cognitive load. Code length: Concise, with little unnecessary code. Action granularity: Most statements and setter calls occupy separate lines, although nested object creation combines several construction steps into one expression. Reading flow: Methods follow a natural progression, but inconsistent indentation and the deeply chained singletonRequest expression slightly interrupt readability.
Run 2
Code Structure: Logically organized into a builder, request state, and focused request methods. Nesting: Most methods are flat, but singletonRequest contains nested constructors and List.of calls that require careful tracking. Clarity of intent: Descriptive class, method, and setter names make the purpose clear; the seven-parameter helper adds some cognitive load. Code length: Concise, with little unnecessary code and appropriately short methods. Action granularity: Most lines perform one assignment or setter operation, although nested object construction combines several actions within one expression. Reading flow: The class follows a natural progression, but inconsistent indentation and clustered closing parentheses in singletonRequest interrupt otherwise smooth reading.
Run 3
Code Structure: Well organized around a request class, nested builder, and focused construction, parsing, and response methods. Nesting: Most methods are flat, but singletonRequest nests fluent calls and List.of expressions, making closing parentheses harder to follow. Clarity of intent: Descriptive method names, types, and setters communicate purpose clearly; the seven-parameter factory requires some effort to track. Code length: Concise overall, with conventional builder boilerplate and no obvious unnecessary logic. Action granularity: Assignments and most setter calls occupy separate lines, though nested object creation combines several operations within one expression. Reading flow: Natural and consistent through most of the class, with uneven indentation and deeply chained construction disrupting flow near the end.