Sample

int-19b93a9de007-I11

Split eligible integer literals into pairs of short-named intermediate variables

Matched original source

Lines45

Scores

MethodScoreScale
Posnett0.9930–1; higher is more readable
Dorn0.6870–1; higher is more readable
Mi0.4710–1; higher is more readable
LLOC1Logical lines; fewer is more readable
DeepSeek V4 Pro18.670–20; mean of three runs
GPT-6.1 Sol190–20; mean of three runs
BTTF0.6860–1; higher is more readable

Views

Source code

package org.springframework.test.annotation; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Test annotation for use with JUnit 4 to indicate that a test method has to finish * execution in a {@linkplain #millis() specified time period}. * * <p>If the test execution takes longer than the specified time period, then * the test is considered to have failed. * * <p>Note that the time period includes execution of the test method itself, * any {@linkplain Repeat repetitions} of the test, and any <em>set up</em> or * <em>tear down</em> of the test fixture. * * <p>This annotation may be used as a <em>meta-annotation</em> to create custom * <em>composed annotations</em>. * * @author Rod Johnson * @author Sam Brannen * @since 2.0 * @see org.springframework.test.annotation.Repeat * @see org.springframework.test.context.junit4.SpringJUnit4ClassRunner * @see org.springframework.test.context.junit4.rules.SpringMethodRule * @see org.springframework.test.context.junit4.statements.SpringFailOnTimeout * @deprecated since Spring Framework 7.0 in favor of the * {@link org.springframework.test.context.junit.jupiter.SpringExtension SpringExtension} * and JUnit Jupiter */ @Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE}) @Retention(RetentionPolicy.RUNTIME) @Documented @Deprecated(since = "7.0") public @interface Timed { /** * The maximum amount of time (in milliseconds) that a test execution can * take without being marked as failed due to taking too long. */ long millis(); }

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(log-odds)
Source linesThe number of non-empty source lines.45+18
Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones.445−14.685
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.832−7.247

Intercept 8.87 + feature contributions = 4.938 (log-odds).
Score = sigmoid(4.938) = 0.993.

Feature contributions

FeatureValueContribution
(log-odds)
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.028+0.667
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.88.957+0.631
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.46−0.592
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.44.933+0.218
Indentation frequencyHow rapidly indentation changes from line to line.18−0.115
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.88.935−0.102
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.18+0.008

Intercept 0.07 + feature contributions = 0.786 (log-odds).
Score = sigmoid(0.786) = 0.687.

Score0.471
Score1
Run 1

The code demonstrates excellent readability. The package and imports are logically ordered. Javadoc is thorough yet clearly formatted with paragraph breaks and links. Annotations like @Target and @Retention are placed cleanly above the interface declaration. The single method 'millis()' is documented concisely, and the code is flat—no nesting or complex conditionals. Structure is minimal and purposeful, reflecting the nature of a simple annotation definition. Names are self-explanatory. While concise, the deprecation note is slightly long, but overall the code is very clear and easy to scan.

Run 2

The code is highly readable. It is well-structured with a logical order: package declaration, imports, comprehensive Javadoc, annotations, and the interface definition. Nesting is essentially flat, containing only top-level declarations. The intent is clearly documented through detailed Javadoc that explains the annotation's purpose, usage, and deprecation. Code length is appropriate; it is concise yet informative, not unnecessarily verbose. Action granularity is excellent, with each annotation and the method declaration on its own line. Reading flow is natural, guiding the reader from the package and imports through documentation to the annotation definition. Minor improvements could include a blank line between import groups and potentially breaking the long @Deprecated Javadoc line, but overall this is an exemplary piece of readable code.

Run 3

The code is highly readable. It follows a clear and standard annotation declaration structure with imports, Javadoc, metadata annotations, and the interface definition in logical order. There is no nesting, and the action granularity is one annotation or member per line. The extensive Javadoc clearly explains the purpose, usage, and deprecation, making intent unambiguous. The code is concise—only the necessary elements are present, with no unnecessary verbosity. Reading flow is natural, guiding the reader from package and imports through documentation to the annotation definition. Minor deduction only because the dense historical Javadoc could be slightly overwhelming for a quick skim, but overall readability is excellent.

Run 1

Code Structure: Logically organized into imports, documentation, annotation metadata, and a single member. Nesting: Essentially flat, with only the annotation declaration enclosing millis(). Clarity of intent: Timed and millis() communicate the purpose clearly; documentation explains timeout scope, supported targets, and deprecation. Code length: The implementation is minimal, while the longer documentation provides relevant context rather than unnecessary complexity. Action granularity: Each import, annotation, and member declaration occupies its own line. Reading flow: Natural top-to-bottom progression from purpose to configuration to the time-limit member. A blank line between the package declaration and imports would slightly improve visual separation.

Run 2

Code Structure: The package, imports, documentation, annotations, and single member are logically organized. Nesting: The declaration is essentially flat, with no complex control flow. Clarity of intent: Timed and millis(), supported by detailed Javadoc, clearly communicate the timeout purpose, units, scope, and deprecation status. Code length: The implementation is minimal; documentation is longer but provides useful context rather than unnecessary complexity. Action granularity: Each import, annotation, and member declaration occupies its own line. Reading flow: The code progresses naturally from context to behavior and configuration. Minor formatting issues, such as the missing blank line after the package declaration and an extra blank line before the closing brace, slightly reduce polish.

Run 3

Code Structure: Package, imports, documentation, annotations, and the single member are logically organized. Nesting: Essentially flat, with only the annotation declaration containing its member. Clarity of intent: Timed and millis(), supported by clear Javadoc, make the timeout purpose, units, scope, and deprecation explicit. Code length: The implementation is minimal; the longer documentation provides useful behavioral context rather than unnecessary complexity. Action granularity: Each import, annotation, and member declaration occupies its own line. Reading flow: The code progresses naturally from context to configuration to declaration. Minor formatting issues, such as the missing blank line between the package and imports and the extra blank line before the closing brace, slightly reduce polish.