Sample

int-1b33e7eb8eab-SRC

Unmodified source class

Lines40

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.8060–1; higher is more readable
Dorn0.8420–1; higher is more readable
Mi0.7680–1; higher is more readable
LLOC11Logical lines; fewer is more readable
DeepSeek V4 Pro18.330–20; mean of three runs
GPT-6.1 Sol190–20; mean of three runs
BTTF0.7160–1; higher is more readable

Views

Source code

package org.springframework.expression.spel.ast; import org.springframework.asm.MethodVisitor; import org.springframework.expression.TypedValue; import org.springframework.expression.spel.CodeFlow; /** * Expression language AST node that represents a long integer literal. * * @author Andy Clement * @since 3.0 */ public class LongLiteral extends Literal { private final TypedValue value; public LongLiteral(String payload, int startPos, int endPos, long value) { super(payload, startPos, endPos); this.value = new TypedValue(value); this.exitTypeDescriptor = "J"; } @Override public TypedValue getLiteralValue() { return this.value; } @Override public boolean isCompilable() { return true; } @Override public void generateCode(MethodVisitor mv, CodeFlow cf) { mv.visitLdcInsn(this.value.getValue()); cf.pushDescriptor(this.exitTypeDescriptor); } }

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.867.881−28.64
Source linesThe number of non-empty source lines.40+16
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.974−7.46

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

Score0.806

Feature contributions

FeatureValueContribution
(log-odds)
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.74.976+0.49
Indentation frequencyHow rapidly indentation changes from line to line.35+0.473
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.41−0.415
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.74.927+0.404
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.39.684+0.145
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.085+0.111

Intercept 0.07 + feature contributions = 1.676 (log-odds).
Score = sigmoid(1.676) = 0.842.

Score0.768
Score11
Run 1

The code is highly readable. It has a clear, logical structure with a single class, well-named fields, and a straightforward constructor. Nesting is minimal; there are no deeply nested control structures. The intent of each method is explicit: retrieving the literal value, checking compilability, and generating bytecode. Code length is concise and appropriate for the functionality. Action granularity is sensible, with one logical action per line in the generateCode method. Reading flow is natural, with the class definition, field, constructor, and methods arranged in a conventional order. Minor deductions would only reflect the lack of explicit null or bounds checks, but for a literal AST node this is acceptable and idiomatic.

Run 2

The code is well-structured and follows clear separation of concerns. The class has a single responsibility, representing a long literal in an expression AST. Nesting is minimal, with no conditional logic or deep indentation. Each method is concise and has a clear purpose, making the intent easy to understand. Action granularity is appropriate—one meaningful action per line, especially evident in generateCode where each instruction maps to one operation. The reading flow is natural, starting with field declaration, constructor, then overridden methods. Import statements are scoped to needed dependencies. The only minor drawback is the lack of Javadoc on methods, but the overall clarity and simplicity make this very readable.

Run 3

The code is highly readable due to its clear structure, minimal nesting, and concise implementation. Each method has a single, well-defined purpose, with one action per line where appropriate. The class follows standard Java conventions, including proper imports, Javadoc, and consistent formatting. The use of a final field and constructor initialization makes intent explicit. Method names like getLiteralValue, isCompilable, and generateCode clearly convey their functionality. The only minor deduction is the lack of inline comments for the generateCode method, though the ASM API usage is straightforward enough for domain experts.

Run 1

Code Structure: The class is logically organized into a field, constructor, and focused overridden methods. Nesting: There is no nested control flow, making the code easy to scan. Clarity of intent: The class documentation, descriptive class name, and method names clearly identify its role as a long-literal AST node; the JVM descriptor "J" and abbreviated parameters require some domain knowledge. Code length: The implementation is concise without unnecessary logic. Action granularity: Each statement performs one clear action on its own line. Reading flow: Initialization followed by value access, compilability, and code generation provides a natural progression. Minor excess blank lines and limited separation between the package declaration and imports slightly reduce polish.

Run 2

Code Structure: The class is logically organized into a field, constructor, and focused overrides. Nesting: All methods are flat, with no nested control flow. Clarity of intent: The class name, documentation, and method names clearly identify a long-literal AST node; the JVM descriptor "J" and abbreviated parameters mv and cf require some domain knowledge. Code length: The implementation is concise, with only slightly excessive blank lines. Action granularity: Each statement performs one distinct action on its own line. Reading flow: The sequence from initialization to value retrieval, compilability, and code generation is natural and easy to follow.

Run 3

Code Structure: The class is logically organized into a field, constructor, and focused overrides. Nesting: There is no nested control flow, making it easy to scan. Clarity of intent: The class documentation, descriptive class name, and straightforward methods clearly convey its purpose; the descriptor "J" and abbreviated parameters mv and cf require some domain knowledge. Code length: The implementation is concise, with no unnecessary logic. Action granularity: Each statement performs a single action on its own line. Reading flow: Initialization followed by value access, compilation support, and code generation creates a natural progression. Extra blank lines are a minor formatting distraction.