Sample
int-eb7ac1a48477-I06
Invert eligible conditions and exchange their branches
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.742 | 0–1; higher is more readable |
| Dorn | 0.224 | 0–1; higher is more readable |
| Mi | 0.589 | 0–1; higher is more readable |
| LLOC | 53 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 15.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs |
| BTTF | 0.466 | 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. | 4468.758 | −147.469 |
| Source linesThe number of non-empty source lines. | 155 | +62 |
| Byte entropyHow varied the bytes in the source text are. Repeated bytes give a lower value; a more even mixture gives a higher value. | 5.014 | −7.52 |
Intercept 8.87 + feature contributions = -84.12 (log-odds).
Score = sigmoid(-84.12) = 0.
| Score | 0.742 |
|---|
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. | 156 | −4.487 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 140 | +4.105 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 140 | −2.792 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 154.892 | +1.755 |
| 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. | 109.968 | −0.993 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 109.962 | +0.97 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.084 | +0.126 |
Intercept 0.07 + feature contributions = -1.245 (log-odds).
Score = sigmoid(-1.245) = 0.224.
| Score | 0.589 |
|---|
| Score | 53 |
|---|
Run 1
The code has clear package/import organization and generally follows consistent formatting, making it readable. However, several issues reduce clarity. The `addDispatchHandler` method contains an unnecessary nested conditional (`if (!((this.dispatchedPath == null)))` could be simplified to `if (this.dispatchedPath != null)`) and redundant parentheses throughout. The `complete()` method has an empty if block with logic in the else, which is awkward and breaks reading flow. Method granularity is good—one action per line mostly—but the presence of synchronized blocks and exception handling adds minor complexity. Intent is mostly clear but hampered by strange boolean logic. The code is not deeply nested overall, but the odd conditionals and empty blocks hurt readability. Overall, it is functional and moderate in clarity, but improvements in conditional simplification would raise the score.
Run 2
The code is generally well-structured with clear fields, constructor, and methods grouped logically. It follows typical Java conventions and keeps nesting shallow. However, readability is hurt by unnecessary negative conditionals like `if (!((this.dispatchedPath == null)))` and `if (!((mockRequest != null))) {} else { ... }`, which invert natural reading and add mental overhead. The empty if-block is particularly confusing. Some methods are straightforward and one action per line is mostly respected, but the `complete()` method mixes control flow awkwardly. Overall intent is understandable but could be clearer with direct positive conditions and minor cleanup.
Run 3
The code is highly readable with clear structure, minimal nesting, and well-defined intent. Methods are concise, each performing a single logical action. The class follows a logical organization: fields, constructor, public methods with overrides grouped together. Nesting is limited to short synchronized blocks and loops. Variable names are descriptive. Two minor readability issues slightly reduce the score: the odd inverted conditional in 'complete()' (`if (!((mockRequest != null))) {} else { ... }`) and in 'addDispatchHandler' (`if (!((this.dispatchedPath == null)))`), which could be simplified to a positive condition. Overall, the code is approachable, maintainable, and follows Spring conventions.
Run 1
Code Structure: Fields and small, focused methods are logically organized, with straightforward interface implementations. Nesting: Mostly shallow; synchronized conditionals and a loop containing try/catch introduce modest nesting. Clarity of intent: Descriptive names, annotations, and documentation communicate purpose well, but redundant negation and parentheses obscure simple conditions. The empty if branch in complete() is particularly distracting. Code length: Generally concise, with some excessive whitespace and verbose timeout documentation. Action granularity: Most lines perform a single action, although the empty if/else construction compresses control flow awkwardly onto one line. Reading flow: Delegating dispatch overloads and consistent method formatting support natural reading, but the unusual conditionals interrupt it. Replacing these with direct null checks would noticeably improve readability.
Run 2
Code Structure: Fields, constructor, and focused interface methods are logically organized. Nesting: Mostly shallow, with modest nesting in synchronization blocks and listener exception handling. Clarity of intent: Descriptive names, annotations, and documentation establish purpose, but redundant negation and parentheses obscure simple null checks; the empty if branch in complete() is especially distracting. Code length: Most methods are concise, though excessive whitespace and convoluted conditions add unnecessary visual overhead. Action granularity: Statements generally perform one action per line, with the compressed empty if/else statement as a notable exception. Reading flow: Delegating dispatch overloads and straightforward accessors read naturally, while inconsistent conditional formatting interrupts an otherwise clean flow.
Run 3
Code Structure: Fields, constructor, and focused interface methods are logically organized. Nesting: Mostly flat, with modest nesting in synchronized dispatch handling and listener completion. Clarity of intent: Descriptive names, overrides, and documentation make the mock's purpose clear, but redundant negation and parentheses obscure conditions, particularly the empty if branch in complete(). Code length: Generally concise; small delegating methods are appropriate, though the timeout documentation is lengthy relative to its setter. Action granularity: Most lines contain a single action, except the compressed empty-if/else construct. Reading flow: Consistent formatting and straightforward delegation support natural reading, but awkward conditional expressions and ignored parameters in interface implementations introduce minor friction.