Sample
int-23d2ef4aa485-I06
Invert eligible conditions and exchange their branches
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.502 | 0–1; higher is more readable |
| Dorn | 0.285 | 0–1; higher is more readable |
| Mi | 0.57 | 0–1; higher is more readable |
| LLOC | 36 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 8.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 12 | 0–20; mean of three runs |
| BTTF | 0.413 | 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. | 5096.387 | −168.181 |
| Source linesThe number of non-empty source lines. | 108 | +43.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. | 5.102 | −7.652 |
Intercept 8.87 + feature contributions = -123.763 (log-odds).
Score = sigmoid(-123.763) = 0.
| Score | 0.502 |
|---|
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. | 109 | −2.823 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 98 | +2.653 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 98 | −1.828 |
| 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. | 113.972 | −1.162 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 107.957 | +1.099 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 114 | +1.035 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.093 | +0.038 |
Intercept 0.07 + feature contributions = -0.918 (log-odds).
Score = sigmoid(-0.918) = 0.285.
| Score | 0.57 |
|---|
| Score | 36 |
|---|
Run 1
The code has severe readability issues. The handleRequestInternal method contains deeply nested conditional logic (3 levels), with multiple actions crammed into single if-else blocks, violating action granularity principles. The condition `if (!((sockJsSession.isNew())))` uses confusing double negatives and unnecessary parentheses, obscuring intent. The getCallbackParam method contains a useless empty if-else block (`if (!((!StringUtils.hasLength(value)))) {} else { return null; }`) that should be inverted and simplified. Comments reference external issues without context. While the class structure follows Spring conventions and imports are organized, the method-level code structure is tangled and hard to follow. The nesting depth forces readers to track multiple branches simultaneously, and the mixture of logging statements within conditional blocks disrupts reading flow. This code would benefit from early returns, method extraction, and elimination of redundant boolean expressions.
Run 2
The code has several readability issues. The most severe is in 'handleRequestInternal', where nested if-else blocks with multiple actions per line create a tangled, hard-to-follow structure. This violates the guidelines for nesting, action granularity, and reading flow. The method mixes bracket styles and places multiple statements on single lines, making the logical flow difficult to trace. Similarly, 'getCallbackParam' uses an awkward empty if block and a redundant else clause, obscuring intent. While imports are organized, class structure is logical, and logging adds clarity, these positives are offset by unnecessary verbosity in some areas and the convoluted conditional logic. The code demonstrates average structure but poor execution in control flow and formatting.
Run 3
The code has some clear structure with logical method separation, but several readability issues exist. The handleRequestInternal method has deeply nested conditional logic (3-4 levels), making it hard to follow the flow. Lines 54-69 contain multiple actions and nested if-else statements that could be flattened or extracted. The getCallbackParam method has an awkward empty if block with an else clause (lines 83-85) that is confusing and should be inverted. The logic is sound but the nesting and unnatural conditional structures impede readability. The code has good naming conventions and appropriate use of abstract methods, but the conditional complexity and some redundant parentheses (like `!((sockJsSession.isNew()))`) reduce clarity. The method lengths are reasonable, but the nested conditionals in handleRequestInternal would benefit from early returns or guard clauses to improve the reading flow. Overall, it's maintainable but requires careful reading to understand the control flow.
Run 1
Code Structure: Responsibilities are sensibly divided into request handling, frame writing, and callback parsing, but malformed-looking conditional formatting obscures organization. Nesting: Request handling has several nested branches and logging checks; redundant parentheses and compressed braces make the hierarchy harder to follow. Clarity of intent: Descriptive method names and types communicate purpose, but double negation and an empty conditional branch in callback validation needlessly obscure simple logic. Code length: Generally compact, though redundant syntax and commented-out code add noise. Action granularity: Most statements occupy separate lines, but multiple conditionals and closing braces share lines in key control-flow sections. Reading flow: Imports, documentation, and method boundaries are conventional; inconsistent indentation and inverted conditions interrupt otherwise natural top-to-bottom reading.
Run 2
Code Structure: Responsibilities are sensibly separated into request handling, frame writing, and callback parsing, but awkward conditional formatting obscures the main handler. Nesting: Session-state branches and logging checks create moderate nesting, worsened by compressed braces. Clarity of intent: Descriptive names and framework types explain most operations; redundant parentheses, double negation, and an empty conditional branch make simple checks confusing. Code length: Generally concise, though obsolete commented-out code and unnecessarily complex conditions add clutter. Action granularity: Most statements occupy separate lines, but combined conditional openings and closing braces undermine this consistency. Reading flow: Method organization is natural, while the inverted new-session check and poorly formatted branches interrupt straightforward top-to-bottom reading.
Run 3
Code Structure: Sensible separation of request handling, frame writing, and callback validation, but the central branching is awkwardly formatted. Nesting: Session-state checks and logging introduce moderate nesting, worsened by inline braces. Clarity of intent: Descriptive method names and types help, but redundant parentheses, negation, and an empty conditional branch obscure otherwise simple checks. Code length: Generally compact, though commented-out code and unnecessarily complex conditions add noise. Action granularity: Most lines express one action, but multiple conditional statements and closing/opening braces share lines in the request handler. Reading flow: Helper methods and consistent naming support navigation, while inverted conditions and inconsistent formatting interrupt the flow.