Sample

int-d659155b5c9e-I01

Remove line comments, block comments, and Javadoc

Matched original source

Lines48

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.5320–1; higher is more readable
Dorn0.2560–1; higher is more readable
Mi0.7270–1; higher is more readable
LLOC10Logical lines; fewer is more readable
DeepSeek V4 Pro170–20; mean of three runs
GPT-6.1 Sol170–20; mean of three runs
BTTF0.610–1; higher is more readable

Views

Source code

package org.springframework.cache.interceptor; import java.lang.reflect.Method; import java.util.Arrays; import org.jspecify.annotations.Nullable; import org.springframework.core.KotlinDetector; public class SimpleKeyGenerator implements KeyGenerator { @Override public Object generate(Object target, Method method, @Nullable Object... params) { return generateKey((KotlinDetector.isSuspendingFunction(method) ? Arrays.copyOf(params, params.length - 1) : params)); } public static Object generateKey(@Nullable Object... params) { if (params.length == 0) { return SimpleKey.EMPTY; } if (params.length == 1) { Object param = params[0]; if (param != null && !param.getClass().isArray()) { return param; } } return new SimpleKey(params); } }

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.1031.948−34.054
Source linesThe number of non-empty source lines.48+19.2
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.979−7.469

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

Score0.532

Feature contributions

FeatureValueContribution
(log-odds)
Indentation frequencyHow rapidly indentation changes from line to line.48+0.923
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.49−0.699
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.48−0.681
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.126−0.287
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.47.774+0.258
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.82.959+0.151

Intercept 0.07 + feature contributions = -1.068 (log-odds).
Score = sigmoid(-1.068) = 0.256.

Score0.727
Score10
Run 1

The code is generally clear and well-structured. The package and imports are organized, and the class and method purposes are evident. Nesting is minimal, and action granularity is mostly one action per line, aiding readability. The ternary expression in generate() slightly reduces clarity but is acceptable. However, the excessive blank lines between imports and class declaration are unnecessary and disrupt the reading flow. Additionally, the use of a ternary for the generateKey call could be replaced with a more explicit if-else for better clarity. The method generateKey is concise and logical. Overall, the code is readable with minor formatting and expression clarity issues.

Run 2

The code is highly readable: well-structured, flat, and concise. The class has a single clear responsibility (key generation), and methods are small with one logical action per line. The use of early returns keeps nesting minimal. The only minor issues are an extra blank line before the static method and a slightly dense ternary expression in the first method, which slightly affects reading flow for less experienced readers. Otherwise, intent is clear and the code follows natural Spring conventions.

Run 3

The code is very readable. It has a clear, logical structure with two well-named methods. Nesting is minimal—only one level deep. Intent is obvious: it generates cache keys, with special handling for suspending functions. Code length is concise and appropriate. Each line represents a single logical action, and reading flow is natural from method signature to implementation. The only minor issue is the excessive blank lines between imports and class declaration, which slightly disrupts visual flow but doesn't affect comprehension. Overall, the code exhibits good Spring framework style and is easy to understand.

Run 1

Code Structure: Two small methods cleanly separate parameter preparation from key generation. Nesting: Shallow nesting and early returns keep control flow easy to follow. Clarity of intent: Names and conditions clearly convey key-generation behavior, though removing the last parameter for Kotlin suspending functions requires specialized knowledge. Code length: The implementation is concise, but excessive blank lines add unnecessary visual length. Action granularity: Statements generally perform one action each; the inline conditional in generate combines detection, copying, and delegation somewhat densely. Reading flow: The key-generation cases progress naturally from no parameters to one parameter to the general case, while excessive whitespace and redundant parentheses slightly disrupt readability.

Run 2

Code Structure: Two focused methods cleanly separate parameter preprocessing from key generation, though excessive blank lines weaken organization. Nesting: Mostly flat, with early returns and only one shallow nested conditional. Clarity of intent: Method names and straightforward branches communicate the purpose well; the Kotlin-specific removal of the final parameter could benefit from a brief explanation. Code length: The implementation is concise, but unnecessary whitespace makes it visually longer. Action granularity: Each statement performs a focused action; the ternary inside the method call slightly increases cognitive load. Reading flow: The zero-, one-, and multiple-parameter cases follow a natural progression, although awkward parentheses, ternary formatting, and large whitespace gaps interrupt the flow.

Run 3

Code Structure: Two focused methods cleanly separate parameter normalization from key generation, though excessive blank lines weaken visual organization. Nesting: Mostly flat, with early returns and only one shallow nested condition. Clarity of intent: Method and variable names communicate key generation clearly; excluding the final parameter for Kotlin suspending functions is less obvious without explanation. Code length: The implementation is concise, but unnecessary whitespace lengthens its presentation. Action granularity: Statements generally perform one action each; the ternary inside generateKey combines parameter selection and delegation slightly densely. Reading flow: The empty, single-value, and composite-key cases follow a natural progression, while the wrapped ternary and large whitespace gaps mildly interrupt readability.