Sample

int-29c662ce6c48-I06

Invert eligible conditions and exchange their branches

Matched original source

Lines45

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.7520–1; higher is more readable
Dorn0.3940–1; higher is more readable
Mi0.530–1; higher is more readable
LLOC22Logical lines; fewer is more readable
DeepSeek V4 Pro10.330–20; mean of three runs
GPT-6.1 Sol15.330–20; mean of three runs
BTTF0.590–1; higher is more readable

Views

Source code

package org.springframework.cglib.transform; import org.springframework.asm.ClassVisitor; import org.springframework.asm.MethodVisitor; import org.springframework.cglib.core.ClassTransformer; public class ClassTransformerChain extends AbstractClassTransformer { private ClassTransformer[] chain; public ClassTransformerChain(ClassTransformer[] chain) { this.chain = chain.clone(); } @Override public void setTarget(ClassVisitor v) { super.setTarget(chain[0]); ClassVisitor next = v; for (int i = chain.length - 1; i >= 0; i--) { chain[i].setTarget(next); next = chain[i]; } } @Override public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) { return cv.visitMethod(access, name, desc, signature, exceptions); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("ClassTransformerChain{"); for (int i = 0; i < chain.length; i++) { if (!((i > 0))) {} else { sb.append(", "); } sb.append(chain[i].toString()); } sb.append("}"); return sb.toString(); } }

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(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.1613.178−53.235
Source linesThe number of non-empty source lines.45+18
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.344−6.516

Intercept 8.87 + feature contributions = -32.88 (log-odds).
Score = sigmoid(-32.88) = 0.

Score0.752

Feature contributions

FeatureValueContribution
(log-odds)
Indentation frequencyHow rapidly indentation changes from line to line.45+0.819
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.45−0.612
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.46−0.592
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.72.913+0.577
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.44.838+0.217
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.108−0.105

Intercept 0.07 + feature contributions = -0.43 (log-odds).
Score = sigmoid(-0.43) = 0.394.

Score0.53
Score22
Run 1

The code is partially readable but has notable issues. The class structure is logical, but method implementations are inconsistent. The toString() method contains an awkward conditional loop that reduces clarity—'if (!((i > 0))) {} else' is overly convoluted. Indentation is inconsistent, especially around annotations and method signatures. visitMethod is simply a delegation and could be clearer about intent. The setTarget method reverses the chain order in a non-obvious way. Variable names like 'v' and 'cv' are ambiguous. While the class is short, it mixes formatting styles and lacks clear separation of concerns. Nesting is shallow, which helps, but the overall reading flow is hindered by formatting inconsistencies and unclear conditional logic.

Run 2

The code has a clear overall structure, with a single class and a few short overridden methods. However, readability suffers from inconsistent indentation, tangled logic in setTarget (it assigns super.setTarget(chain[0]) while also iterating in reverse to rewire targets), and an awkward if condition in toString that obscures simple separator logic. The visitMethod override is redundant but concise. Nesting is shallow, and action granularity is mostly one action per line, yet the reading flow is disrupted by formatting inconsistencies and the confusing setTarget sequence. The purpose of chaining transformers is clear from the class name, but the reverse iteration and target assignment could be simplified for clarity.

Run 3

The code has a clear overall structure with a single class and a few methods, but several readability issues lower its score. The formatting is inconsistent (mixed tabs and spaces, misaligned method signatures), which disrupts the reading flow. The toString method contains an unnecessarily convoluted condition: `if (!((i > 0))) {} else { ... }` is a confusing way to express `if (i > 0)`. The setTarget method uses a reversed loop that, while functional, is not immediately clear in intent. However, the logic is fairly flat, methods are short, and action granularity is acceptable. Overall the code is understandable but would benefit from cleaner formatting and simpler conditional logic.

Run 1

Code Structure: The class is logically organized into construction, target wiring, method delegation, and string representation. Nesting: Mostly shallow, with only a loop and conditional in toString. Clarity of intent: Method names and types communicate purpose, but reverse chain wiring requires some thought, and the empty if branch with a double-negated condition unnecessarily obscures separator handling. Code length: Compact overall, though the separator conditional could be simplified to if (i > 0). Action granularity: Each statement generally performs one action per line. Reading flow: Methods follow a natural order, but inconsistent indentation, excessive parentheses, and the empty branch interrupt smooth reading.

Run 2

Code Structure: The class is logically organized into construction, target wiring, method delegation, and string representation. Nesting: Mostly shallow, with only a loop and conditional in toString. Clarity of intent: Names and delegation are clear, but reverse chain wiring requires some thought, and the empty if branch with double parentheses obscures a simple separator condition. Code length: Generally concise, though the separator logic is unnecessarily verbose. Action granularity: Each statement performs a single action; the empty conditional is awkward rather than overloaded. Reading flow: Method order is natural, but inconsistent indentation and parameter alignment interrupt scanning. Replacing the separator logic with if (i > 0) and standardizing formatting would improve readability.

Run 3

Code Structure: The class is logically organized into construction, target wiring, method delegation, and string representation. Nesting: Mostly shallow, with only a loop and conditional in toString. Clarity of intent: Transformer chaining is understandable, but reverse wiring requires some thought, and the empty if branch with double parentheses obscures a simple separator condition. Code length: Generally concise, though the conditional and explicit toString call are unnecessarily verbose. Action granularity: Each line generally performs one action, making operations easy to follow. Reading flow: Method ordering is natural, but inconsistent indentation and awkward parameter alignment interrupt scanning. Overall, readable code with localized formatting and conditional-expression issues.