Sample
int-f8024c44cb26-I06
Invert eligible conditions and exchange their branches
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0.002 | 0–1; higher is more readable |
| Scalabrino | 0.907 | 0–1; higher is more readable |
| Dorn | 0.815 | 0–1; higher is more readable |
| Mi | 0.616 | 0–1; higher is more readable |
| LLOC | 27 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 16.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs |
| BTTF | 0.573 | 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. | 1881.464 | −62.088 |
| Source linesThe number of non-empty source lines. | 136 | +54.4 |
| 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.883 | −7.325 |
Intercept 8.87 + feature contributions = -6.143 (log-odds).
Score = sigmoid(-6.143) = 0.002.
| Score | 0.907 |
|---|
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. | 137 | −3.814 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 82 | +2.099 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 135.817 | +1.489 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.045 | +0.502 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 80.92 | +0.501 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| 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. | 80.964 | +0.236 |
Intercept 0.07 + feature contributions = 1.481 (log-odds).
Score = sigmoid(1.481) = 0.815.
| Score | 0.616 |
|---|
| Score | 27 |
|---|
Run 1
The code is generally well-structured and readable. It follows a clear, logical organization with fields, constructors, and methods grouped logically. Nesting is minimal, with only one synchronized block containing a single if-else. The intent is clear due to good naming and comprehensive Javadoc. Code length is concise for the functionality provided. Action granularity is mostly one action per line. The reading flow is natural and follows standard Java conventions. However, there are a few minor readability issues: the `if (!((this.pointcut == null))) {} else { ... }` in `getPointcut()` is awkward and harder to parse than a standard `if (this.pointcut == null) { ... }` would be. Additionally, the `@SuppressWarnings("serial")` annotation and the `SerializableMonitor` class add a small amount of complexity that could be simplified. Overall, the code is highly readable but could be improved slightly.
Run 2
The code is generally well-structured and readable. It clearly separates constructors, setters, and overridden methods with logical grouping. Nesting is minimal, with only one synchronized block containing a simple if-else. The intent of each method and field is documented with concise Javadoc, and method names clearly convey their purpose. Code length is appropriate for the functionality provided. However, the readability score is slightly reduced by the awkward `if (!((this.pointcut == null))) {} else { ... }` construct, which is unnecessarily convoluted and non-standard; a simple `if (this.pointcut == null) { ... }` would be clearer. Additionally, the placement of type-use annotations (`String @Nullable []`) may be slightly less intuitive for some readers, and the empty default constructor is redundant, adding minor noise. Overall, the class is highly readable with only minor stylistic issues.
Run 3
The code is well-structured with clear separation of concerns, logical method organization, and comprehensive Javadoc documentation. Class fields are logically grouped, and constructors are neatly arranged by complexity. Nesting is minimal, with only one synchronization block and a single conditional. The intent of each method is clear from its name and documentation. However, the conditional logic in getPointcut() is unnecessarily awkward: the negated condition with an empty if-block and else-branch hurts readability and should simply use a direct null check. The code is mostly concise, though the toString() method has a slightly unnatural line break. Action granularity is generally good, with one meaningful operation per line. Reading flow follows a natural top-down progression from fields to constructors to methods. Minor improvements could be made by simplifying the null-check logic in getPointcut() and slightly restructuring the return statement formatting.
Run 1
Code Structure: Fields, constructors, setters, initialization, and helpers are logically grouped. Nesting: Mostly shallow, although getPointcut nests synchronization and two conditionals. Clarity of intent: Descriptive names and useful Javadoc explain the advisor's purpose, but the negated null check with redundant parentheses and an empty if branch obscures straightforward lazy initialization. Code length: Methods are concise; constructor overloads and documentation add length but serve clear purposes. Action granularity: Statements generally perform one action per line, though the compressed empty if/else reduces readability. Reading flow: Consistent formatting and method ordering support natural reading, interrupted primarily by the unusual conditional in getPointcut. Replacing it with a direct if (this.pointcut == null) would substantially improve clarity.
Run 2
Code Structure: Fields, constructors, configuration methods, and helper methods are logically organized. Nesting: Mostly shallow, although synchronized lazy initialization adds several levels. Clarity of intent: Descriptive names and useful Javadoc clearly explain the advisor and pattern configuration, but the negated null check, redundant parentheses, and empty if branch obscure getPointcut(); a direct if (this.pointcut == null) would be clearer. Code length: Implementation methods are concise, though repeated constructor documentation adds some bulk. Action granularity: Most lines perform one action; the compressed empty if/else statement is a notable exception. Reading flow: Consistent formatting and sensible method ordering support natural reading, interrupted primarily by the awkward initialization conditional.
Run 3
Code Structure: Fields, constructors, configuration methods, and helpers are logically organized. Nesting: Generally shallow, although getPointcut nests initialization and pattern configuration within synchronization. Clarity of intent: Descriptive names and useful Javadoc explain the advisor's purpose, but the negated null check with redundant parentheses and an empty if branch obscures straightforward lazy initialization. Code length: Implementation methods are concise; repeated constructor documentation adds some bulk. Action granularity: Statements generally perform one action per line, making operations easy to follow. Reading flow: Consistent formatting and method ordering support natural reading, but the unusual if/else in getPointcut interrupts the flow; a direct if (this.pointcut == null) would be clearer.