Sample

int-fa7e57709b41-I09

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

Matched original source

Lines117

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.7770–1; higher is more readable
Dorn0.1330–1; higher is more readable
Mi0.1950–1; higher is more readable
LLOC24Logical lines; fewer is more readable
DeepSeek V4 Pro15.330–20; mean of three runs
GPT-6.1 Sol150–20; mean of three runs
BTTF0.3050–1; higher is more readable

Views

Source code

package org.springframework.orm; import org.jspecify.annotations.Nullable; import org.springframework.dao.DataRetrievalFailureException; /** * Exception thrown if a mapped object could not be retrieved via its identifier. * Provides information about the persistent class and the identifier. * * @author Juergen Hoeller * @since 13.10.2003 */ @SuppressWarnings("serial") public class ObjectRetrievalFailureException extends DataRetrievalFailureException { private final @Nullable Object persistentClass; private final @Nullable Object identifier; /** * Create a general ObjectRetrievalFailureException with the given message, * without any information on the affected object. * @param msg the detail message * @param cause the source exception */ public ObjectRetrievalFailureException(@Nullable String msg, Throwable cause) { super(msg, cause); this.persistentClass = null; this.identifier = null; } /** * Create a new ObjectRetrievalFailureException for the given object, * with the default "not found" message. * @param persistentClass the persistent class * @param identifier the ID of the object that should have been retrieved */ public ObjectRetrievalFailureException(Class<?> persistentClass, Object identifier) { this(persistentClass, identifier, "Object of class [" + persistentClass.getName() + "] with identifier [" + identifier + "]: not found", null); } /** * Create a new ObjectRetrievalFailureException for the given object, * with the given explicit message and exception. * @param persistentClass the persistent class * @param identifier the ID of the object that should have been retrieved * @param msg the detail message * @param cause the source exception */ public ObjectRetrievalFailureException( Class<?> persistentClass, @Nullable Object identifier, String msg, @Nullable Throwable cause) { super(msg, cause); this.persistentClass = persistentClass; this.identifier = identifier; } /** * Create a new ObjectRetrievalFailureException for the given object, * with the default "not found" message. * @param persistentClassName the name of the persistent class * @param identifier the ID of the object that should have been retrieved */ public ObjectRetrievalFailureException(String persistentClassName, Object identifier) { this(persistentClassName, identifier, "Object of class [" + persistentClassName + "] with identifier [" + identifier + "]: not found", null); } /** * Create a new ObjectRetrievalFailureException for the given object, * with the given explicit message and exception. * @param persistentClassName the name of the persistent class * @param identifier the ID of the object that should have been retrieved * @param msg the detail message * @param cause the source exception */ public ObjectRetrievalFailureException( String persistentClassName, @Nullable Object identifier, @Nullable String msg, @Nullable Throwable cause) { super(msg, cause); this.persistentClass = persistentClassName; this.identifier = identifier; } /** * Return the persistent class of the object that was not found. * If no Class was specified, this method returns null. */ public @Nullable Class<?> getPersistentClass() { {int lI0O_73274fc3=0xA8BC,lI0O_7add02da=~lI0O_73274fc3;lI0O_73274fc3=(lI0O_73274fc3&lI0O_7add02da)|(lI0O_73274fc3^lI0O_73274fc3);lI0O_7add02da^=lI0O_7add02da;} return (this.persistentClass instanceof Class<?> clazz ? clazz : null); } /** * Return the name of the persistent class of the object that was not found. * Will work for both Class objects and String names. */ public @Nullable String getPersistentClassName() { if (this.persistentClass instanceof Class<?> clazz) { return clazz.getName(); } return (this.persistentClass != null ? this.persistentClass.toString() : null); } /** * Return the identifier of the object that was not found. */ public @Nullable Object getIdentifier() { return this.identifier; } }

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.2091.36−69.015
Source linesThe number of non-empty source lines.117+46.8
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.96−7.44

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

Score0.777

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.158.975−3.068
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.111−2.894
Indentation frequencyHow rapidly indentation changes from line to line.74+1.822
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.158.992+1.761
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.74−1.277
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.116.544+1.219
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.046+0.493

Intercept 0.07 + feature contributions = -1.874 (log-odds).
Score = sigmoid(-1.874) = 0.133.

Score0.195
Score24
Run 1

The code is generally well-structured and follows Java conventions with clear intent. It is a simple exception class with reasonable documentation and consistent formatting. However, readability is negatively impacted by a few issues: the randomly inserted nonsense line inside getPersistentClass() breaks reading flow and adds confusion; some constructors chain through multiple overloads which slightly obscures control flow; and the class uses both Class and String representations for the persistent class, requiring conditional logic in getters. Nesting is minimal and action granularity is mostly one action per line. Code length is appropriate for the functionality, though constructor overloads could be consolidated. Overall, the code is readable and maintainable but loses points for the unexplained obfuscated line and minor structural complexity in overloaded constructors.

Run 2

The code is generally well-structured and readable: clear class purpose, Javadoc comments, logical constructor delegation, and mostly flat nesting. However, readability is significantly reduced by a confusing obfuscated line inside getPersistentClass() that performs meaningless bitwise operations and adds noise. Several constructors are overloaded, which is appropriate, but the repeated message-building logic could be extracted. Some lines are long, especially in constructors, reducing scanability. Overall, the intent is clear and the flow is natural, but the injected junk code and minor duplication prevent a higher score.

Run 3

The code is highly readable with clear structure, minimal nesting, and excellent documentation. Each constructor is well-documented with clear intent and follows a logical flow. The exception class properly extends its parent and maintains clean field declarations. Most lines contain a single action with good formatting. The only notable issue is the obfuscated code block inside getPersistentClass() containing meaningless variable manipulations (lI0O_73274fc3, lI0O_7add02da) that serve no purpose and significantly degrade readability. This appears to be either injected dead code or an artifact of obfuscation. Excluding this anomaly, the code demonstrates exemplary Java practices with proper nullability annotations and consistent naming conventions.

Run 1

Code Structure: Fields, constructors, and accessors are logically grouped, but an unrelated obfuscated block disrupts an otherwise clean class. Nesting: Mostly flat, with only a simple conditional and one unnecessary nested block. Clarity of intent: Descriptive names, documentation, and nullability annotations clearly explain the exception's purpose; cryptic variables and pointless bitwise operations in getPersistentClass obscure intent. Code length: Appropriate overall, though repeated constructor documentation and message construction add some verbosity, and the obfuscated block adds needless code. Action granularity: Most statements perform one action per line, but the injected block compresses declarations and several assignments onto one line. Reading flow: Constructors delegate naturally and getters are straightforward, except for the abrupt, unindented block that interrupts the getter's flow.

Run 2

Code Structure: Fields, constructors, and accessors are logically grouped, but an unrelated block disrupts getPersistentClass(). Nesting: Generally shallow, with only a simple conditional and an unnecessary inner block. Clarity of intent: Descriptive names, Javadoc, and nullability annotations explain the exception API well; cryptic variable names and pointless bitwise operations obscure the inserted block. Code length: Reasonable for the constructor overloads, though repeated documentation and message construction add verbosity, and the extraneous block adds no value. Action granularity: Most statements perform one action per line, but the inserted block compresses several declarations and assignments onto one line. Reading flow: Consistent organization and constructor delegation make the class easy to follow overall; the unindented, obfuscated block sharply interrupts that flow.

Run 3

Code Structure: Fields, constructors, and getters are logically grouped, but an unrelated block disrupts getPersistentClass(). Nesting: Generally shallow; the extra block adds unnecessary scope. Clarity of intent: Descriptive names, Javadoc, and nullability annotations clearly explain the exception API, while cryptic local names and pointless bitwise operations obscure intent. Code length: Reasonable for the constructor overloads, though repetitive documentation and the extraneous block add bulk. Action granularity: Most statements occupy separate lines, but the injected block compresses several declarations and assignments onto one line. Reading flow: Consistent formatting and constructor delegation support natural reading, sharply interrupted by the unindented, dense block. Overall, the class is readable except for this conspicuous distraction.