Sample

int-a6d6f5702cb3-I05

Rewrite eligible decimal integer literals in hexadecimal notation

Matched original source

Lines49

Scores

MethodScoreScale
Posnett10–1; higher is more readable
Scalabrino0.9860–1; higher is more readable
Dorn0.8350–1; higher is more readable
Mi0.8310–1; higher is more readable
LLOC9Logical lines; fewer is more readable
DeepSeek V4 Pro190–20; mean of three runs
GPT-6.1 Sol200–20; mean of three runs
BTTF0.7090–1; higher is more readable

Views

Source code

package org.springframework.context; /** * Strategy interface for processing Lifecycle beans within the ApplicationContext. * * @author Mark Fisher * @author Juergen Hoeller * @since 3.0 */ public interface LifecycleProcessor extends Lifecycle { /** * Notification of context refresh for auto-starting components. * @see ConfigurableApplicationContext#refresh() */ default void onRefresh() { start(); } /** * Notification of context restart for auto-stopping and subsequently * auto-starting components. * @since 7.0 * @see ConfigurableApplicationContext#restart() */ default void onRestart() { stop(); start(); } /** * Notification of context pause for auto-stopping components. * @since 7.0 * @see ConfigurableApplicationContext#pause() */ default void onPause() { stop(); } /** * Notification of context close phase for auto-stopping components * before destruction. * @see ConfigurableApplicationContext#close() */ default void onClose() { stop(); } }

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(log-odds)
Source linesThe number of non-empty source lines.49+19.6
Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones.280.461−9.255
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.795−7.192

Intercept 8.87 + feature contributions = 12.022 (log-odds).
Score = sigmoid(12.022) = 1.

Score0.986

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.46−0.592
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.036+0.59
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.82.94+0.534
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.48.595+0.269
Indentation frequencyHow rapidly indentation changes from line to line.27+0.197
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.82.94+0.152

Intercept 0.07 + feature contributions = 1.618 (log-odds).
Score = sigmoid(1.618) = 0.835.

Score0.831
Score9
Run 1

This code is exceptionally readable. It defines a clear, single-purpose interface with well-named methods and comprehensive Javadoc. The structure is logical, moving from general lifecycle methods to specific context event notifications. Nesting is non-existent, contributing to a flat, easily scannable layout. Intent is unambiguous; each method name (onRefresh, onRestart, onPause, onClose) clearly describes its trigger and aligns with its one-line body. Code length is minimal yet complete, with no redundancy. Each action (stop() or start()) is on its own line, promoting clarity. The reading flow is natural, mirroring the likely lifecycle sequence: refresh, restart, pause, close. The use of default methods provides sensible default behavior while allowing customization, and documentation concisely explains each method's purpose and links to relevant context methods.

Run 2

The code is highly readable. It follows a clean, logical structure as an interface with clear Javadoc on all methods. Nesting is non-existent, keeping the flow flat and easy to scan. Intent is unambiguous: each default method name (onRefresh, onRestart, onPause, onClose) directly maps to a lifecycle event and contains only the necessary calls to start() or stop(). Code length is minimal and concise, with no redundant logic. Action granularity is well maintained—each functional operation (start/stop) sits on its own line, improving clarity. Reading flow is natural, progressing intuitively through lifecycle phases (refresh, restart, pause, close). The only minor nitpick is the slight repetition of the stop() call in several methods, but this is idiomatic for this context.

Run 3

The code is concise and highly readable. It defines a single interface with four default methods, each representing a clear lifecycle event. The structure is logical, with no nesting or tangled logic. Each method contains at most two actions, maintaining one-action-per-line granularity and a natural reading flow. Intent is reinforced by Javadoc comments explaining when each method is invoked. The only minor limitation is the reliance on inherited methods (start/stop) without explicit context, which is typical for framework interfaces.

Run 1

Code Structure: The interface cleanly groups related lifecycle callbacks in a logical order. Nesting: Methods are flat, with no conditional logic or nested blocks. Clarity of intent: Descriptive method names and focused Javadoc clearly explain each callback; restart explicitly stops before starting. Code length: The implementation is concise, with documentation adding useful context rather than unnecessary verbosity. Action granularity: Each statement performs one action on its own line. Reading flow: Consistent formatting and the refresh–restart–pause–close sequence make the interface easy to scan and understand.

Run 2

Code Structure: The interface logically groups lifecycle callbacks with consistent documentation and formatting. Nesting: Methods are flat, with no conditional or loop nesting. Clarity of intent: Descriptive method names and Javadoc clearly explain each callback, while inheritance establishes the lifecycle contract. Code length: The implementation is concise; documentation adds useful context rather than unnecessary verbosity. Action granularity: Each statement performs one action, and restart explicitly separates stopping from starting. Reading flow: Callbacks follow a natural refresh, restart, pause, and close sequence, making the interface easy to scan and understand.

Run 3

Code Structure: A focused interface groups lifecycle callbacks logically. Nesting: Each method has a flat body with no conditional or loop nesting. Clarity of intent: Descriptive method names and Javadoc clearly explain each callback, with references to corresponding context operations. Code length: The implementation is concise; documentation adds useful context rather than unnecessary verbosity. Action granularity: Each statement performs one action, making the stop-then-start sequence in onRestart explicit. Reading flow: Consistent formatting and the refresh, restart, pause, close ordering make the interface easy to scan and understand.