Sample

int-a58646e66142-I10

Remove about 40% of line-break groups while retaining structure

Matched original source

Lines107

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.8770–1; higher is more readable
Dorn0.2670–1; higher is more readable
Mi0.0990–1; higher is more readable
LLOC27Logical lines; fewer is more readable
DeepSeek V4 Pro50–20; mean of three runs
GPT-6.1 Sol130–20; mean of three runs
BTTF0.4750–1; higher is more readable

Views

Source code

package org.springframework.aop.support; import java.io.Serializable; import org.aopalliance.aop.Advice; import org.jspecify.annotations.Nullable; import org.springframework.aop.Pointcut; import org.springframework.util.ObjectUtils; /** * Convenient class for regexp method pointcuts that hold an Advice, * making them an {@link org.springframework.aop.Advisor}. * * <p>Configure this class using the "pattern" and "patterns" * pass-through properties. These are analogous to the pattern * and patterns properties of {@link AbstractRegexpMethodPointcut}. * * <p>Can delegate to any {@link AbstractRegexpMethodPointcut} subclass. * By default, {@link JdkRegexpMethodPointcut} will be used. To choose * a specific one, override the {@link #createPointcut} method. * * @author Rod Johnson * @author Juergen Hoeller * @see #setPattern * @see #setPatterns * @see JdkRegexpMethodPointcut */ @SuppressWarnings("serial") public class RegexpMethodPointcutAdvisor extends AbstractGenericPointcutAdvisor { private String @Nullable [] patterns; private @Nullable AbstractRegexpMethodPointcut pointcut; private final Object pointcutMonitor = new SerializableMonitor(); /** * Create an empty RegexpMethodPointcutAdvisor. * @see #setPattern * @see #setPatterns * @see #setAdvice */ public RegexpMethodPointcutAdvisor() { } /** * Create a RegexpMethodPointcutAdvisor for the given advice. * The pattern still needs to be specified afterwards. * @param advice the advice to use * @see #setPattern * @see #setPatterns */ public RegexpMethodPointcutAdvisor(Advice advice) { setAdvice(advice); } /** * Create a RegexpMethodPointcutAdvisor for the given advice. * @param pattern the pattern to use * @param advice the advice to use */ public RegexpMethodPointcutAdvisor(String pattern, Advice advice) { setPattern(pattern); setAdvice(advice); } /** * Create a RegexpMethodPointcutAdvisor for the given advice. * @param patterns the patterns to use * @param advice the advice to use */ public RegexpMethodPointcutAdvisor(String[] patterns, Advice advice) { setPatterns(patterns); setAdvice(advice); } /** * Set the regular expression defining methods to match. * <p>Use either this method or {@link #setPatterns}, not both. * @see #setPatterns */ public void setPattern(String pattern) { setPatterns(pattern); } /** * Set the regular expressions defining methods to match. * To be passed through to the pointcut implementation. * <p>Matching will be the union of all these; if any of the * patterns matches, the pointcut matches. * @see AbstractRegexpMethodPointcut#setPatterns */ public void setPatterns(String... patterns) { this.patterns = patterns; } /** * Initialize the singleton Pointcut held within this Advisor. */ @Override public Pointcut getPointcut() { synchronized (this.pointcutMonitor) { if (this.pointcut == null) { this.pointcut = createPointcut(); if (this.patterns != null) { this.pointcut.setPatterns(this.patterns); } } return this.pointcut; } } /** * Create the actual pointcut: By default, a {@link JdkRegexpMethodPointcut} * will be used. * @return the Pointcut instance (never {@code null}) */ protected AbstractRegexpMethodPointcut createPointcut() { return new JdkRegexpMethodPointcut(); } @Override public String toString() { return getClass().getName() + ": advice [" + getAdvice() + "], pointcut patterns " + ObjectUtils.nullSafeToString(this.patterns); } /** * Empty class used for a serializable monitor object. */ private static class SerializableMonitor implements Serializable { } }

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.1820.128−60.064
Source linesThe number of non-empty source lines.107+42.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.867−7.3

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

Score0.877

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.161.972−3.195
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.108−2.788
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.162+1.809
Indentation frequencyHow rapidly indentation changes from line to line.53+1.096
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.106.755+1.082
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.044+0.519
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398

Intercept 0.07 + feature contributions = -1.008 (log-odds).
Score = sigmoid(-1.008) = 0.267.

Score0.099
Score27
Run 1

The code is structurally separated into logical methods, but the formatting severely damages readability. Multiple statements and member declarations are combined on single lines, Javadoc blocks and method signatures share lines, and opening braces appear at the end of lines instead of on new lines. This creates extremely long, dense lines that violate the 'one action per line' and 'concise' principles. Nesting is shallow, which is good, and intent is decipherable, but the visual clutter obscures the flow. The code would be much more readable with standard line breaks between methods, fields, and comments.

Run 2

The code suffers from severe readability issues. Multiple statements are crammed onto single lines (fields, method signatures, and constructors), violating the 'one action per line' principle. The class declaration is preceded by an annotation on the same line, and several method declarations and openings share lines with other code. Javadoc comments are frequently embedded within or adjacent to unrelated code, disrupting the reading flow. The nesting level is moderate but the inconsistent formatting—such as synchronized blocks and conditional bodies on one line—makes the control flow hard to follow. Variable naming is reasonable and the class's purpose is fairly clear from the comments, but the overall formatting obscures intent. The code is not logically tangled in structure, but the visual clutter and lack of consistent, standard Java formatting make it very difficult to scan and understand quickly. It reads like minified or automatically collapsed code rather than human-friendly source.

Run 3

The code suffers from severe readability issues. Multiple declarations and method signatures are compressed onto single lines (e.g., field declarations, constructors, and methods with their Javadoc), violating action granularity and disrupting reading flow. The inconsistent formatting creates a tangled appearance despite the logical structure being conceptually sound. Nesting is mostly flat, but the synchronized block in getPointcut() adds moderate depth without clarity. Intent is generally clear from comments and naming, but the compressed layout obscures it. The code is unnecessarily long due to formatting choices that merge unrelated elements, making it harder to scan. Javadoc comments are present but often visually merged with code, reducing their effectiveness. Overall, while the underlying logic is straightforward, the physical presentation severely hampers readability.

Run 1

Code Structure: Fields, constructors, configuration methods, and pointcut creation are logically organized, but inconsistent formatting obscures their boundaries. Nesting: Mostly shallow; getPointcut has moderate, justified nesting for synchronized lazy initialization, made harder to parse by compressed braces. Clarity of intent: Descriptive names and detailed Javadoc clearly explain configuration, advice association, and pointcut initialization. Code length: The implementation is reasonably concise; documentation adds useful context rather than unnecessary complexity. Action granularity: Several imports, field declarations, constructor operations, annotations, and control-flow statements share lines, undermining scanability. Reading flow: The conceptual sequence is natural, but comments attached to preceding closing braces and inconsistent line breaks interrupt reading. Overall, clear design and documentation provide reasonable readability despite substantial formatting problems.

Run 2

Code Structure: Constructors, configuration methods, lazy initialization, and the monitor class are logically organized, but inconsistent formatting obscures their boundaries. Nesting: Mostly shallow; getPointcut has reasonable synchronization and conditional nesting, made harder to scan by compressed braces. Clarity of intent: Descriptive names and thorough Javadocs clearly explain pattern configuration and pointcut creation. Code length: Implementation is concise, though documentation occupies much of the listing without being unnecessarily verbose. Action granularity: Several imports, declarations, constructor actions, and control-flow statements share lines, reducing readability. Reading flow: The overall sequence is natural, but comments attached to closing braces, inline annotations, and inconsistent spacing interrupt scanning. Clear semantics and sound organization are undermined primarily by formatting.

Run 3

Code Structure: Constructors, configuration methods, lazy initialization, and the monitor class are logically organized, but inconsistent formatting obscures their boundaries. Nesting: Mostly shallow; getPointcut has reasonable synchronized and conditional nesting, though compressed braces make it harder to follow. Clarity of intent: Descriptive names and useful Javadoc clearly explain regex configuration and pointcut creation. Code length: The implementation is concise, with documentation adding useful context rather than unnecessary logic. Action granularity: Multiple imports, field declarations, constructor calls, and control-flow elements share lines, reducing scanability. Reading flow: The overall sequence is natural, but comments attached to closing braces, inline annotations, and uneven spacing repeatedly interrupt reading.