Sample

int-13a1e9fad37e-I08

Select one of ten high-readability unrelated code templates per class

Matched original source

Lines56

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.7530–1; higher is more readable
Dorn0.3830–1; higher is more readable
Mi0.5480–1; higher is more readable
LLOC28Logical lines; fewer is more readable
DeepSeek V4 Pro60–20; mean of three runs
GPT-6.1 Sol12.330–20; mean of three runs
BTTF0.2950–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() { { int firstScore = 72; int secondScore = 85; int higherScore; if (firstScore > secondScore) { higherScore = firstScore; } else { higherScore = secondScore; } } StringBuilder sb = new StringBuilder(); sb.append("ClassTransformerChain{"); for (int i = 0; i < chain.length; i++) { if (i > 0) { 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.1795.448−59.25
Source linesThe number of non-empty source lines.56+22.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.37−6.554

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

Score0.753

Feature contributions

FeatureValueContribution
(log-odds)
Indentation frequencyHow rapidly indentation changes from line to line.56+1.2
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.57−0.982
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.55−0.841
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
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.93+0.576
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.55.838+0.371
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.104−0.067

Intercept 0.07 + feature contributions = -0.478 (log-odds).
Score = sigmoid(-0.478) = 0.383.

Score0.548
Score28
Run 1

This code has severe readability problems. The most critical issue is a stray block of unrelated Java code embedded inside the toString() method (declaring int variables and an if-else statement), which makes the code invalid and nonsensical. Beyond that, the indentation is inconsistent (mixing tabs and spaces, misaligned braces), and the class logic is obscured by formatting issues. The setTarget method loops backward to chain transformers, which is not immediately obvious without comments explaining why reverse order is needed. The visitMethod override merely delegates and adds no clarity. Variable naming like 'v' and 'cv' is unclear. While the chain-to-string loop is straightforward, the overall structure is confusing, and the stray code block makes it fundamentally unreadable. Even ignoring that, the inconsistent indentation and lack of explanatory comments for the backward iteration would leave the reader confused about intent and flow.

Run 2

The code has several readability issues. The toString() method contains an unrelated, seemingly accidental code block about 'higherScore' that is dead code and confusing. Formatting is inconsistent - mixed indentation, incorrect method signature indentation, and a misplaced opening brace. The setTarget method uses a reverse iteration that may be unclear without domain knowledge, though it is logically structured. Overall structure follows a chain-of-transformers pattern, but the accidental dead code and formatting problems severely hurt clarity. The visitMethod method is a simple pass-through but adds little value. Variable names like 'v' and 'cv' are short and ambiguous. Despite some logical organization, the confusing artifacts and inconsistent style make the code hard to read and maintain.

Run 3

The code has several readability issues. The class structure is generally logical, but there is a stray, unrelated code block inside the `toString()` method that contains variable declarations and an if-else statement that have nothing to do with the method's purpose. This completely breaks the reading flow and clarity of intent. Indentation is inconsistent (tabs vs spaces) and method signatures are misaligned. The `setTarget` method uses a reverse loop without explanation, making the logic non-obvious. The `visitMethod` method simply delegates to `cv`, which may be acceptable but adds little clarity. Overall, the unnecessary length from the misplaced code, inconsistent formatting, and ambiguous loop logic significantly reduce readability.

Run 1

Code Structure: The class is organized into focused methods, but an unrelated score-comparison block disrupts toString(). Nesting: Mostly shallow; the unnecessary block and conditional add avoidable nesting. Clarity of intent: Transformer chaining and string construction are understandable, while the unused higherScore calculation has no apparent purpose. Code length: Generally concise, but the dead calculation adds unnecessary lines. Action granularity: Statements mostly perform one action per line, making individual operations easy to follow. Reading flow: Method ordering is natural, but inconsistent indentation, the stray block, and reverse chain wiring requiring some mental tracing reduce readability.

Run 2

Code Structure: The class has logically separated methods, but an unrelated score-comparison block disrupts toString(). Nesting: Mostly shallow; the unnecessary block and conditional add avoidable nesting. Clarity of intent: Transformer chaining and string formatting are understandable, while unused score variables obscure the purpose of toString(). Code length: Generally concise, but the irrelevant block adds unnecessary length. Action granularity: Statements consistently perform one action per line. Reading flow: Method order is natural, but inconsistent indentation, uneven parameter alignment, and the unrelated block interrupt readability. The reverse traversal in setTarget() also requires some thought to understand the chain wiring.

Run 3

Code Structure: Methods are logically separated, but the unrelated score-comparison block inside toString disrupts cohesion. Nesting: Mostly shallow; loops and conditionals are easy to follow, although the extra block adds needless nesting. Clarity of intent: Transformer chaining and string formatting are understandable, but the unused higherScore calculation is distracting and unexplained. Code length: Generally concise, with unnecessary length from the irrelevant block. Action granularity: Each statement performs a single action, making individual operations easy to read. Reading flow: Method ordering is natural, but inconsistent indentation, excessive parameter alignment, and the abrupt insertion of unrelated logic interrupt the flow.