Sample

int-9fbd8e3d05ed-I03

Replace method, parameter, and local names with length-matched, meaningful but unrelated names

Matched original source

Lines59

Scores

MethodScoreScale
Posnett0.9950–1; higher is more readable
Scalabrino0.640–1; higher is more readable
Dorn0.7060–1; higher is more readable
Mi0.620–1; higher is more readable
LLOC5Logical lines; fewer is more readable
DeepSeek V4 Pro13.330–20; mean of three runs
GPT-6.1 Sol12.330–20; mean of three runs
BTTF0.6790–1; higher is more readable

Views

Source code

package org.springframework.cache.interceptor; import java.lang.reflect.Method; import java.util.Collection; import org.jspecify.annotations.Nullable; import org.springframework.util.CollectionUtils; /** * Interface used by {@link CacheInterceptor}. Implementations know how to source * cache operation attributes, whether from configuration, metadata attributes at * source level, or elsewhere. * * @author Costin Leau * @author Juergen Hoeller * @since 3.1 */ public interface CacheOperationSource { /** * Determine whether the given class is a candidate for cache operations * in the metadata format of this {@code CacheOperationSource}. * <p>If this method returns {@code false}, the methods on the given class * will not get traversed for {@link #getCacheOperations} introspection. * Returning {@code false} is therefore an optimization for non-affected * classes, whereas {@code true} simply means that the class needs to get * fully introspected for each method on the given class individually. * @param targetClass the class to introspect * @return {@code false} if the class is known to have no cache operation * metadata at class or method level; {@code true} otherwise. The default * implementation returns {@code true}, leading to regular introspection. * @since 5.2 * @see #hasCacheOperations */ default boolean validateBalance(Class<?> primaryUser) { return true; } /** * Determine whether there are cache operations for the given method. * @param method the method to introspect * @param targetClass the target class (can be {@code null}, * in which case the declaring class of the method must be used) * @since 6.2 * @see #getCacheOperations */ default boolean validateSession(Method region, @Nullable Class<?> currentNode) { return !CollectionUtils.isEmpty(validateMessage(region, currentNode)); } /** * Return the collection of cache operations for this method, * or {@code null} if the method contains no <em>cacheable</em> annotations. * @param method the method to introspect * @param targetClass the target class (can be {@code null}, in which case * the declaring class of the method must be used) * @return all cache operations for this method, or {@code null} if none found */ @Nullable Collection<CacheOperation> validateMessage(Method amount, @Nullable Class<?> cachedScore); }

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(log-odds)
Source linesThe number of non-empty source lines.59+23.6
Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones.609.596−20.117
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.689−7.033

Intercept 8.87 + feature contributions = 5.32 (log-odds).
Score = sigmoid(5.32) = 0.995.

Score0.64

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.57−0.982
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.100.95+0.824
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.024+0.708
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.100.967−0.611
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.58.892+0.413
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
Indentation frequencyHow rapidly indentation changes from line to line.23+0.058

Intercept 0.07 + feature contributions = 0.878 (log-odds).
Score = sigmoid(0.878) = 0.706.

Score0.62
Score5
Run 1

The code is highly readable with clear structure, flat nesting, and explicit intent. The interface is well-organized with logical method groupings, and Javadoc provides comprehensive context for each method's purpose and parameters. Action granularity is excellent—each method performs one conceptual operation. However, a significant clarity issue exists: the parameter names (primaryUser, region, currentNode, amount, cachedScore, validateBalance, validateSession, validateMessage) appear unrelated to the caching domain and are likely obfuscated placeholders. This obscures intent and contradicts the well-documented purpose of caching operations. The code is concise and follows natural reading flow, but the mismatch between documentation and actual parameter names reduces readability. If the parameter names were restored to cache-related terms, this would be a 19-20.

Run 2

The code is well-structured as a Spring interface with clear Javadoc, logical organization, and proper use of annotations like @Nullable. Nesting is minimal and action granularity is good—each method performs one conceptual action. However, the naming is inconsistent and misleading: `validateBalance`, `validateSession`, and `validateMessage` do not reflect cache operation semantics, reducing clarity of intent. Reading flow is natural due to documentation and method ordering, but the parameter names (`primaryUser`, `region`, `amount`, `cachedScore`) further obscure purpose. The code is concise and not overly long, but the mismatch between actual functionality and naming makes it harder to understand than necessary.

Run 3

This code is structurally clean (a simple interface with defaults), but readability is severely harmed by misleading naming. The class is documented as CacheOperationSource, yet its methods are named validateBalance, validateSession, and validateMessage — jargon that suggests financial or session logic, not cache operations. Parameter names like primaryUser, region, currentNode, amount, and cachedScore further obscure intent. The Javadoc refers to getCacheOperations and hasCacheOperations, which don’t exist in the code. Length and nesting are fine; action granularity and reading flow are acceptable. However, clarity of intent is essentially broken: a reader cannot reason about what the code does without ignoring names and reading only signatures/docs. This is a case of structural readability undermined by semantic misalignment.

Run 1

Code Structure: The interface is logically organized, with imports followed by three documented methods. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: The main weakness is misleading names such as validateBalance, validateSession, and validateMessage, which do not describe cache introspection. Parameter names likewise obscure their roles, and Javadoc parameter names and method references do not match the actual declarations. Code length: Implementation is concise, although extensive documentation dominates the small interface. Action granularity: Each implementation performs one simple action per line. Reading flow: Formatting and method ordering are natural, but contradictions between documentation and identifiers interrupt comprehension and undermine trust in the API.

Run 2

Code Structure: The interface is logically organized, with imports, documentation, and three related method declarations. Nesting: Minimal nesting makes it easy to scan. Clarity of intent: Severely weakened by misleading names such as validateBalance, validateSession, and validateMessage, which do not describe cache-operation discovery. Parameter names such as primaryUser, region, and cachedScore also obscure their actual roles. Javadoc describes the intended behavior, but its parameter names and method references do not match the declarations, creating confusion. Code length: Implementation is concise; documentation is somewhat lengthy but mostly useful. Action granularity: Each implementation contains a single, straightforward return statement. Reading flow: The layout and method progression are natural, but discrepancies between documentation and identifiers repeatedly interrupt understanding.

Run 3

Code Structure: The interface is logically organized, with imports, documentation, and three related declarations. Nesting: Minimal nesting makes the implementation easy to scan. Clarity of intent: Severely weakened by misleading names such as validateBalance, validateSession, and validateMessage, which do not describe cache operations; parameter names are similarly unrelated to their roles. Javadoc parameter names and method references do not match the actual declarations, further confusing the contract. Code length: Implementations are concise, although extensive documentation adds length without reliably clarifying the renamed API. Action granularity: Each implementation contains a single, straightforward return statement. Reading flow: Conventional Java layout and method ordering support natural reading, but contradictions between documentation and identifiers repeatedly interrupt understanding.