Sample
int-a73f8a2daaaa-I06
Invert eligible conditions and exchange their branches
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.671 | 0–1; higher is more readable |
| Dorn | 0.843 | 0–1; higher is more readable |
| Mi | 0.324 | 0–1; higher is more readable |
| LLOC | 22 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 17 | 0–20; mean of three runs |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs |
| BTTF | 0.593 | 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. | 2474.179 | −81.648 |
| Source linesThe number of non-empty source lines. | 93 | +37.2 |
| 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.638 | −6.958 |
Intercept 8.87 + feature contributions = -42.536 (log-odds).
Score = sigmoid(-42.536) = 0.
| Score | 0.671 |
|---|
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. | 94 | −2.292 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 87 | +2.272 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 107.926 | +0.937 |
| 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. | 107.968 | −0.908 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 92.844 | +0.888 |
| 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.065 | +0.312 |
Intercept 0.07 + feature contributions = 1.677 (log-odds).
Score = sigmoid(1.677) = 0.843.
| Score | 0.324 |
|---|
| Score | 22 |
|---|
Run 1
The code is well-structured and readable. It uses a clean class layout with clear separation of constructors, static helpers, and instance methods. Nesting is minimal, with no deep conditional or logical blocks. The intent is mostly clear: representing a controller request context, converting timeouts to deadlines, and delegating quota application. Constructor overloads are concise and delegation via `this(...)` avoids duplication. Action granularity is mostly one action per line, though constructor chaining for `RequestHeaderData` is slightly dense but still readable. Naming is descriptive (`deadlineNs`, `partitionChangeQuotaApplier`) and the use of `OptionalLong` is appropriate. The static helper `requestTimeoutMsToDeadlineNs` is clear and concise. Minor reductions in readability come from the `__ -> { }` lambda (intent could be clearer with a named no-op) and the multiple delegating constructors, which may require a brief scan to understand. Overall, the code is maintainable and straightforward.
Run 2
The code is well-structured and readable. It follows a clean class design with clear separation of concerns—static utility method, fields, constructors, getters, and a quota method. Nesting is minimal; the only method chain is the RequestHeaderData builder in one constructor, which remains flat and readable. Intent is clear from naming and documentation, especially the Javadoc on applyPartitionChangeQuota. The code is concise, with no redundant logic or unnecessary length. Action granularity is strong—each line performs a single logical operation, particularly in the builder chain. Reading flow is natural: the class begins with a utility method, then fields, constructors, and finally accessors. The use of no-op lambdas (__ -> {}) is slightly unusual but acceptable for default behavior. Overall, it is highly readable with only minor opportunities for improvement.
Run 3
The code is well-structured with clear separation of concerns, a clean constructor chain, and good naming. Nesting is minimal and the class is concise. The intent of each method is obvious, especially with the Javadoc on the quota method. The static helper method is clearly named and does one thing. Minor deductions: the use of `__ -> { }` as a no-op lambda slightly hurts clarity compared to a named constant like `NO_OP`, and the overloading of constructors adds a little boilerplate. The `requestTimeoutMsToDeadlineNs` conversion is reasonably clear but could benefit from a short comment. Overall, the code reads naturally and has one logical action per line.
Run 1
Code Structure: Well-organized context class with constructor delegation, simple accessors, and a focused quota method; placing the static helper before fields slightly interrupts conventional organization. Nesting: Very shallow, with no complex control flow. Clarity of intent: Descriptive names, explicit time units, and quota documentation communicate purpose clearly, although the no-op lambdas and injected consumer could use brief explanation. Code length: Appropriately concise; constructor overloads add some repetition but support clear initialization paths. Action granularity: Assignments and calls generally occupy individual lines; the fluent header construction separates each configuration step cleanly. Reading flow: Constructors lead naturally into accessors and behavior, though tighter import grouping and wrapping the long deadline calculation would improve scanning.
Run 2
Code Structure: Fields, constructors, accessors, and quota handling are logically grouped, although placing the static utility before the fields slightly interrupts conventional organization. Nesting: Minimal nesting keeps the code easy to scan. Clarity of intent: Descriptive names, explicit time units, and quota documentation communicate purpose well; the '__' parameter and empty lambdas are less immediately clear. Code length: Concise overall, with constructor delegation avoiding duplicated initialization; the overloads add some necessary boilerplate. Action granularity: Statements generally perform one action per line, and the fluent header construction separates each setter clearly. Reading flow: Consistent formatting and straightforward delegation provide a natural progression, though the long deadline-conversion line and tightly packed imports slightly reduce scanability.
Run 3
Code Structure: Fields, delegating constructors, accessors, and quota handling are logically organized, though placing the static helper before fields slightly interrupts conventional ordering. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: Descriptive names, explicit time units, and quota documentation communicate purpose well; the '__' lambda parameter and undocumented no-op quota behavior are less clear. Code length: Concise overall, with constructor overloads avoiding duplicated initialization. Action granularity: Assignments and method calls generally occupy separate lines; the fluent header-building chain remains readable. Reading flow: Constructor delegation and straightforward accessors create a natural flow, although tightly packed imports and the long deadline-conversion expression slightly reduce readability.