Sample
int-150ab3369af7-I06
Invert eligible conditions and exchange their branches
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.819 | 0–1; higher is more readable |
| Dorn | 0.744 | 0–1; higher is more readable |
| Mi | 0.195 | 0–1; higher is more readable |
| LLOC | 21 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 15.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16.67 | 0–20; mean of three runs |
| BTTF | 0.63 | 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. | 1892.128 | −62.44 |
| Source linesThe number of non-empty source lines. | 115 | +46 |
| 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.839 | −7.258 |
Intercept 8.87 + feature contributions = -14.828 (log-odds).
Score = sigmoid(-14.828) = 0.
| Score | 0.819 |
|---|
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. | 72 | +1.753 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 114.568 | +1.192 |
| 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.948 | −0.992 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 109.966 | +0.97 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.046 | +0.499 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
Intercept 0.07 + feature contributions = 1.066 (log-odds).
Score = sigmoid(1.066) = 0.744.
| Score | 0.195 |
|---|
| Score | 21 |
|---|
Run 1
The code has clear Javadoc documentation and logical class structure, which aids understanding. However, several issues reduce readability. The constructors are repetitive; the message-building logic is duplicated instead of being centralized. The method `getPersistentClassName()` contains an awkward empty if-block with an else statement, which is confusing and poorly structured. It could be simplified to a single conditional expression. Field declarations use line breaks unnecessarily, increasing length without adding clarity. While the code is generally flat and not deeply nested, the inconsistent formatting and redundant logic interrupt the reading flow. Overall, the intent is clear but the implementation could be more concise and straightforward.
Run 2
The code is well-structured with clear class documentation and organized constructors. It maintains flat nesting and follows Spring conventions. However, there are readability issues: the empty if block in getPersistentClassName() with inverted logic (`if (!(...)) {} else { return ...; }`) is unnecessarily convoluted and breaks the natural reading flow. The repeated pattern of 'Object of class [...] with identifier [...]: not found' across constructors adds minor duplication. Some constructor signatures span multiple lines, slightly affecting scanability. Overall, the intent is clear and methods are concise, but the awkward conditional and minor repetition prevent a higher score.
Run 3
The code is highly readable with clear structure and intent. It follows a standard pattern for exception classes—well-organized constructors, consistent field declarations, and meaningful Javadoc. Nesting is minimal; the only method with conditional logic (getPersistentClassName) uses a slightly awkward empty-if/else construct that reduces clarity. Code length is appropriate for the number of constructors, though some duplication exists in the two 'default message' paths. Action granularity is good—each assignment or return is on its own line. Reading flow is natural: fields, constructors, then accessors. Minor deduction for the odd empty if block and minor constructor duplication, but overall the code is clean, maintainable, and easy to understand.
Run 1
Code Structure: Clearly organized into fields, constructors, and accessors, with related overloads grouped together. Nesting: Almost entirely flat, though getPersistentClassName introduces an unnecessary empty conditional branch. Clarity of intent: Descriptive names, Javadoc, and nullability annotations explain the exception's purpose well; storing either a Class or String in an Object field slightly obscures its representation. Code length: Reasonable for the supported overloads, but repetitive documentation and duplicated message construction add verbosity. Action granularity: Each assignment and return performs a single clear action; multiline constructor calls remain easy to follow. Reading flow: Generally natural and consistent, but the negated instanceof check, excessive parentheses, and empty if followed by else interrupt comprehension. A direct positive instanceof check would improve readability.
Run 2
1. Code Structure: Fields, constructors, and accessors are logically grouped, with helpful documentation. 2. Nesting: Almost entirely flat, although getPersistentClassName uses an awkward negated condition with an empty branch and an else. 3. Clarity of intent: Descriptive names and Javadocs clearly explain the exception's purpose; storing either a Class or String in an Object field slightly obscures its representation. 4. Code length: Reasonably concise, but repeated constructor documentation and message construction add verbosity. 5. Action granularity: Statements generally perform one action per line; constructor delegation and ternary returns remain understandable. 6. Reading flow: Consistent formatting and constructor delegation support natural reading, but the empty conditional branch, redundant parentheses, and long message expressions interrupt it. Replacing the negated empty branch with a straightforward positive instanceof check would noticeably improve readability.
Run 3
Code Structure: Fields, constructors, and getters are logically grouped, with consistent documentation. Nesting: Mostly flat, with only a shallow conditional. Clarity of intent: Descriptive names and Javadoc clearly explain the exception's purpose, though storing either a Class or String in an Object field weakens explicitness. Code length: Reasonably concise, but repeated constructor documentation and message construction add some redundancy. Action granularity: Statements generally perform one action per line; the empty if block and adjoining else are an awkward exception. Reading flow: Constructor delegation and straightforward getters read naturally, but getPersistentClassName disrupts the flow with a negated instanceof check, redundant parentheses, and an empty branch. A direct positive instanceof conditional would be substantially clearer.