Sample

int-99818a5b31ef-I08

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

Matched original source

Lines139

Scores

MethodScoreScale
Posnett0.8460–1; higher is more readable
Scalabrino0.9340–1; higher is more readable
Dorn0.3540–1; higher is more readable
Mi0.6940–1; higher is more readable
LLOC33Logical lines; fewer is more readable
DeepSeek V4 Pro4.670–20; mean of three runs
GPT-6.1 Sol160–20; mean of three runs
BTTF0.3070–1; higher is more readable

Views

Source code

package org.springframework.beans.factory.support; import org.jspecify.annotations.Nullable; import org.springframework.util.StringUtils; /** * A simple holder for {@code BeanDefinition} property defaults. * * @author Mark Fisher * @author Juergen Hoeller * @since 2.5 * @see AbstractBeanDefinition#applyDefaults */ public class BeanDefinitionDefaults { private @Nullable Boolean lazyInit; private int autowireMode = AbstractBeanDefinition.AUTOWIRE_NO; private int dependencyCheck = AbstractBeanDefinition.DEPENDENCY_CHECK_NONE; private @Nullable String initMethodName; private @Nullable String destroyMethodName; /** * Set whether beans should be lazily initialized by default. * <p>If {@code false}, the bean will get instantiated on startup by bean * factories that perform eager initialization of singletons. * @see AbstractBeanDefinition#setLazyInit */ public void setLazyInit(boolean lazyInit) { this.lazyInit = lazyInit; } /** * Return whether beans should be lazily initialized by default, i.e. not * eagerly instantiated on startup. Only applicable to singleton beans. * @return whether to apply lazy-init semantics ({@code false} by default) */ public boolean isLazyInit() { { int firstScore = 72; int secondScore = 85; int higherScore; if (firstScore > secondScore) { higherScore = firstScore; } else { higherScore = secondScore; } } return (this.lazyInit != null && this.lazyInit); } /** * Return whether beans should be lazily initialized by default, i.e. not * eagerly instantiated on startup. Only applicable to singleton beans. * @return the lazy-init flag if explicitly set, or {@code null} otherwise * @since 5.2 */ public @Nullable Boolean getLazyInit() { return this.lazyInit; } /** * Set the autowire mode. This determines whether any automagical detection * and setting of bean references will happen. Default is AUTOWIRE_NO * which means there won't be convention-based autowiring by name or type * (however, there may still be explicit annotation-driven autowiring). * @param autowireMode the autowire mode to set. * Must be one of the constants defined in {@link AbstractBeanDefinition}. * @see AbstractBeanDefinition#setAutowireMode */ public void setAutowireMode(int autowireMode) { this.autowireMode = autowireMode; } /** * Return the default autowire mode. */ public int getAutowireMode() { return this.autowireMode; } /** * Set the dependency check code. * @param dependencyCheck the code to set. * Must be one of the constants defined in {@link AbstractBeanDefinition}. * @see AbstractBeanDefinition#setDependencyCheck */ public void setDependencyCheck(int dependencyCheck) { this.dependencyCheck = dependencyCheck; } /** * Return the default dependency check code. */ public int getDependencyCheck() { return this.dependencyCheck; } /** * Set the name of the default initializer method. * <p>Note that this method is not enforced on all affected bean definitions * but rather taken as an optional callback, to be invoked if actually present. * @see AbstractBeanDefinition#setInitMethodName * @see AbstractBeanDefinition#setEnforceInitMethod */ public void setInitMethodName(@Nullable String initMethodName) { this.initMethodName = (StringUtils.hasText(initMethodName) ? initMethodName : null); } /** * Return the name of the default initializer method. */ public @Nullable String getInitMethodName() { return this.initMethodName; } /** * Set the name of the default destroy method. * <p>Note that this method is not enforced on all affected bean definitions * but rather taken as an optional callback, to be invoked if actually present. * @see AbstractBeanDefinition#setDestroyMethodName * @see AbstractBeanDefinition#setEnforceDestroyMethod */ public void setDestroyMethodName(@Nullable String destroyMethodName) { this.destroyMethodName = (StringUtils.hasText(destroyMethodName) ? destroyMethodName : null); } /** * Return the name of the default destroy method. */ public @Nullable String getDestroyMethodName() { return this.destroyMethodName; } }

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(log-odds)
Source linesThe number of non-empty source lines.139+55.6
Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones.1679.616−55.427
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.892−7.338

Intercept 8.87 + feature contributions = 1.705 (log-odds).
Score = sigmoid(1.705) = 0.846.

Score0.934

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.138−3.85
Indentation frequencyHow rapidly indentation changes from line to line.85+2.203
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.138.854+1.531
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.85−1.53
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.94.971+0.728
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.035+0.605
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.94.993−0.358

Intercept 0.07 + feature contributions = -0.6 (log-odds).
Score = sigmoid(-0.6) = 0.354.

Score0.694
Score33
Run 1

The code appears to be a legitimate Spring Framework utility class but contains a severe, obvious defect: the isLazyInit() method has a nonsensical block of unrelated code (comparing two arbitrary scores) inserted between its opening brace and its return statement. This makes the method fail to compile and completely breaks readability. Beyond that defect, what remains follows reasonable JavaBean conventions: fields are grouped at the top, getters/setters are simple, and Javadocs explain intent. However, the file is overly verbose for such a simple holder, with many repetitive methods and comments. The accidental insertion destroys logical organization, nesting, clarity of intent, and reading flow. Unless the stray block is removed, the code is unreadable as a functional unit. Score reflects the fatal flaw rather than the otherwise acceptable style.

Run 2

The code is a Spring utility class with clear getters/setters and good Javadoc, but it contains an unrelated, malformed code block in the middle of `isLazyInit()`. This block declares variables and an if-else statement inside the method before the return, which breaks compilation and disrupts reading flow. The method's intent is obscured by this injected code. Structure is otherwise logical, but the stray block creates severe nesting issues and violates action granularity by mixing unrelated logic. Class-level fields and naming are clean, but the defect dominates the evaluation.

Run 3

The code is mostly a standard Spring holder class with clear getters/setters, but it is severely compromised by a large unrelated code block inserted directly inside the isLazyInit() method. This block (declaring scores and an if-else) makes the method non-functional and breaks the entire class's compileability. This destroys clarity of intent, introduces invalid nesting, and disrupts reading flow completely. Although the surrounding structure is logically organized and javadoc is thorough, the injected garbage code dominates the assessment. Action granularity is generally good in the original parts, but the corrupted method has multiple actions and nonsensical logic. Overall, the file is unreadable and non-functional as written.

Run 1

Code Structure: Fields and paired accessors are logically organized, but an unrelated score-comparison block disrupts isLazyInit(). Nesting: Most methods are flat; the extraneous block introduces unnecessary nesting and an if/else. Clarity of intent: Descriptive names, nullability annotations, constants, and Javadoc clearly communicate bean-default behavior; the unused higherScore calculation has no relevant purpose. Code length: Accessors are concise, though extensive documentation adds length and the score block is entirely unnecessary. Action granularity: Statements generally perform one action per line, making operations easy to follow. Reading flow: Consistent accessor ordering and formatting support natural reading, but the differently indented score block abruptly interrupts the otherwise straightforward flow.

Run 2

Code Structure: Fields and paired setters/getters are logically organized, but an unrelated score-comparison block disrupts isLazyInit(). Nesting: Most methods are flat; the extraneous block adds unnecessary scope and conditional nesting. Clarity of intent: Descriptive names, nullability annotations, constants, and Javadoc clearly explain the defaults holder, while the unused higherScore calculation has no apparent purpose. Code length: Accessors are concise, although extensive documentation and dead code increase reading effort. Action granularity: Statements generally perform one action per line, with straightforward assignments and compact expressions. Reading flow: Consistent method ordering supports natural reading, but the abruptly inserted, inconsistently indented block interrupts an otherwise clean flow.

Run 3

Code Structure: Fields and related accessors are logically organized, but an unrelated score-comparison block disrupts isLazyInit(). Nesting: Most methods are flat; the extraneous block adds unnecessary scope and if/else nesting. Clarity of intent: Descriptive names, nullability annotations, constants, and Javadoc clearly explain the defaults holder, while unused higherScore computation introduces confusion. Code length: Accessors are concise, although extensive documentation and irrelevant calculations increase reading effort. Action granularity: Statements generally perform one action per line, making operations easy to follow. Reading flow: Consistent getter/setter organization supports natural reading, but the inserted block’s inconsistent indentation and unrelated purpose noticeably interrupt that flow.