Sample

int-8d0b7102527e-I01

Remove line comments, block comments, and Javadoc

Matched original source

Lines136

Scores

MethodScoreScale
Posnett0.0160–1; higher is more readable
Scalabrino0.7360–1; higher is more readable
Dorn0.8210–1; higher is more readable
Mi0.7140–1; higher is more readable
LLOC27Logical lines; fewer is more readable
DeepSeek V4 Pro16.670–20; mean of three runs
GPT-6.1 Sol15.670–20; mean of three runs
BTTF0.5270–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; @SuppressWarnings("serial") public class RegexpMethodPointcutAdvisor extends AbstractGenericPointcutAdvisor { private String @Nullable [] patterns; private @Nullable AbstractRegexpMethodPointcut pointcut; private final Object pointcutMonitor = new SerializableMonitor(); public RegexpMethodPointcutAdvisor() { } public RegexpMethodPointcutAdvisor(Advice advice) { setAdvice(advice); } public RegexpMethodPointcutAdvisor(String pattern, Advice advice) { setPattern(pattern); setAdvice(advice); } public RegexpMethodPointcutAdvisor(String[] patterns, Advice advice) { setPatterns(patterns); setAdvice(advice); } public void setPattern(String pattern) { setPatterns(pattern); } public void setPatterns(String... patterns) { this.patterns = patterns; } @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; } } protected AbstractRegexpMethodPointcut createPointcut() { return new JdkRegexpMethodPointcut(); } @Override public String toString() { return getClass().getName() + ": advice [" + getAdvice() + "], pointcut patterns " + ObjectUtils.nullSafeToString(this.patterns); } 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.136+54.4
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.866−7.299

Intercept 8.87 + feature contributions = -4.093 (log-odds).
Score = sigmoid(-4.093) = 0.016.

Score0.736

Feature contributions

FeatureValueContribution
(log-odds)
Indentation frequencyHow rapidly indentation changes from line to line.136+3.967
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.137−3.814
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.135.793+1.488
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
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.80.964+0.236
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.099−0.019

Intercept 0.07 + feature contributions = 1.522 (log-odds).
Score = sigmoid(1.522) = 0.821.

Score0.714
Score27
Run 1

The code demonstrates strong structure with clear class organization and method separation, earning high marks for readability. The constructor overloads are cleanly arranged and each action is generally on its own line. Nesting is minimal — only one level of synchronization and one conditional check. Intent is clear from descriptive method names like 'createPointcut' and 'setPatterns'. The synchronized pointcut lazy initialization pattern is straightforward and well-scoped to a monitor object. Some unnecessary blank lines and minor spacing inconsistencies slightly disrupt flow, and the many empty comment sections feel superfluous. The code could be more concise by removing redundant constructors and trimming formatting gaps. The null-safety annotations improve clarity about allowed null values. Overall, this is professional-quality production code with logical flow, though not perfectly polished.

Run 2

The code is generally well-structured and readable, using clear naming conventions and a logical organization typical of Spring's style. Methods are mostly concise, with single-purpose actions like setPatterns and createPointcut. The class has minimal nesting, except for the synchronized block inside getPointcut, which is justified for lazy initialization with thread safety. Intent is clear, especially with the use of Spring annotations and conventional patterns. However, readability is slightly reduced by excessive blank lines between methods, which disrupt the reading flow. The nullability annotations are helpful but add visual noise for some readers. Overall, the code is easy to follow, but minor formatting inconsistencies and unused imports (Advice) prevent a higher score.

Run 3

The code is well-structured with clear separation of concerns: constructors, setters, and pointcut creation logic are logically organized. Nesting is minimal, with only a single synchronized block. Intent is clear—configuring regexp-based pointcut advice. Code length is concise and appropriate for its purpose. Action granularity is mostly one action per line, though the toString method concatenates multiple operations in one line. Reading flow is natural, with methods ordered logically. Minor issues include excessive blank lines, inconsistent spacing around annotations, and the unusual naming of the monitor object, which slightly hinder readability.

Run 1

Code Structure: Fields, constructors, setters, and pointcut methods are logically organized. Nesting: Mostly flat, with moderate nesting in getPointcut() for synchronized lazy initialization and optional pattern configuration. Clarity of intent: Descriptive class and method names make the regex-based advisor's purpose clear, though the serializable monitor and initialization lifecycle lack explanation. Code length: Implementation is concise, but excessive blank lines unnecessarily stretch the file and hinder scanning. Action granularity: Statements generally perform one action per line; constructors clearly separate pattern and advice configuration. Reading flow: Conventional ordering and consistent indentation support natural reading, but large whitespace gaps repeatedly interrupt continuity.

Run 2

Code Structure: Fields, constructors, configuration methods, and pointcut creation are logically organized. Nesting: Mostly flat, with moderate nesting in getPointcut() for synchronization and lazy initialization. Clarity of intent: Descriptive names make the advisor's purpose and pattern configuration clear, though the serializable monitor's rationale is not explained. Code length: Implementation is concise, but excessive blank lines substantially inflate its visual length. Action granularity: Each statement performs a single action, making operations easy to distinguish. Reading flow: Method ordering and consistent indentation support natural reading, but large whitespace gaps repeatedly interrupt scanning.

Run 3

Code Structure: Fields, constructors, setters, pointcut creation, and utility methods are logically organized. Nesting: Most methods are flat; getPointcut has moderate nesting for synchronization and lazy initialization. Clarity of intent: Descriptive names and straightforward delegation clearly communicate regex-based pointcut configuration, though the monitor class and initialization lifecycle require some inference. Code length: Functional code is concise, but excessive blank lines substantially inflate its visual length. Action granularity: Statements generally perform one action per line, making operations easy to distinguish. Reading flow: Method ordering is natural and consistent, but large whitespace gaps interrupt scanning and obscure the otherwise cohesive structure.