Sample

int-a21e3e79de7b-I09

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

Matched original source

Lines61

Scores

MethodScoreScale
Posnett0.0350–1; higher is more readable
Scalabrino0.4950–1; higher is more readable
Dorn0.3750–1; higher is more readable
Mi0.2070–1; higher is more readable
LLOC9Logical lines; fewer is more readable
DeepSeek V4 Pro17.330–20; mean of three runs
GPT-6.1 Sol13.330–20; mean of three runs
BTTF0.1480–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 isCandidateClass(Class<?> targetClass) { {int lI0O_21d76cfd=0x7321;lI0O_21d76cfd=((lI0O_21d76cfd^0x7321)|0)&-1;if(((lI0O_21d76cfd&1)==1)){lI0O_21d76cfd^=lI0O_21d76cfd;}} 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 hasCacheOperations(Method method, @Nullable Class<?> targetClass) { return !CollectionUtils.isEmpty(getCacheOperations(method, targetClass)); } /** * 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> getCacheOperations(Method method, @Nullable Class<?> targetClass); }

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.888.525−29.321
Source linesThe number of non-empty source lines.61+24.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.847−7.27

Intercept 8.87 + feature contributions = -3.321 (log-odds).
Score = sigmoid(-3.321) = 0.035.

Score0.495

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.127.935−1.754
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.127.984+1.261
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.61−1.123
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.033+0.619
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.60.822+0.44
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.25−0.153
Indentation frequencyHow rapidly indentation changes from line to line.25+0.128

Intercept 0.07 + feature contributions = -0.512 (log-odds).
Score = sigmoid(-0.512) = 0.375.

Score0.207
Score9
Run 1

The code is generally readable with clear structure and good documentation. The interface is logically organized with well-defined methods and Javadoc comments explaining purpose and behavior. Nesting is minimal and action granularity is appropriate. However, there is a significant readability issue: an obfuscated line of code inserted inside the isCandidateClass method (with hex values and bitwise operations) that serves no purpose in the interface. This breaks reading flow and clarity of intent, as it appears to be either a copy-paste error or intentional obfuscation. Otherwise, the code follows good practices with concise method bodies and natural reading order.

Run 2

The code is a well-structured Spring interface with clear Javadoc documentation. It has flat nesting with only one method body, making the logic easy to follow. The intent of each method is explicitly documented, and method names clearly describe their purpose. The code is concise, with the interface containing only two default methods and one abstract method. Action granularity is appropriate - each method performs a single logical operation. However, there is an unexplained and confusing block of code in `isCandidateClass` that appears to be obfuscated or leftover debugging code, which significantly impacts readability despite the otherwise clean structure. Without this anomaly, the code would score 19-20.

Run 3

The code is well-structured and highly readable. The interface has clear, focused methods with descriptive Javadoc. Nesting is minimal, and each method performs a single logical action. The only issue is the obfuscated code block inside isCandidateClass, which is confusing and appears unrelated to the method's purpose. It hurts clarity and reading flow but doesn't significantly damage overall structure or intent. Without that block, the code would be near-perfect for an interface definition.

Run 1

Code Structure: The interface is logically organized with focused methods and helpful documentation, but an unrelated computation disrupts isCandidateClass. Nesting: Most code is flat; the injected block adds unnecessary scope and conditional nesting. Clarity of intent: Method names, signatures, and Javadoc clearly explain cache introspection, while the cryptic variable and bitwise expressions obscure the purpose of the injected code. Code length: The functional interface is concise, but the no-effect computation is unnecessary. Action granularity: Most statements are cleanly separated; the injected line packs declaration, assignment, condition, and mutation together. Reading flow: The documented methods follow a natural sequence, but the unformatted, obfuscated block abruptly interrupts an otherwise readable interface.

Run 2

Code Structure: The interface is logically organized, but an unrelated obfuscated block disrupts an otherwise clean implementation. Nesting: Most code is flat; the unnecessary block and conditional introduce avoidable nesting. Clarity of intent: Descriptive method names and detailed Javadoc clearly explain cache-operation discovery, while cryptic variable names and pointless bitwise operations obscure isCandidateClass. Code length: The functional methods are concise, but the injected computation adds unnecessary code. Action granularity: Most statements are separate, except the obfuscated line, which compresses several assignments and control-flow actions together. Reading flow: Documentation and method ordering provide a natural progression, but inconsistent formatting and the dense, irrelevant block interrupt it significantly.

Run 3

Code Structure: The interface logically groups related cache metadata methods, but an unrelated obfuscated block disrupts the organization. Nesting: Mostly flat, with an unnecessary block and conditional inside isCandidateClass. Clarity of intent: Descriptive method names, annotations, and Javadoc clearly explain the API; the cryptic variable and pointless bitwise operations obscure the default implementation. Code length: The functional methods are concise and documentation is useful, but the injected computation adds unnecessary code. Action granularity: Most statements are cleanly separated, whereas the obfuscated block compresses several assignments and a conditional onto one line. Reading flow: Documentation followed by method declarations creates a natural progression, interrupted sharply by the unformatted, irrelevant block.