Sample

int-d1ef8b1bc373-I01

Remove line comments, block comments, and Javadoc

Matched original source

Lines185

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.5540–1; higher is more readable
Dorn0.7490–1; higher is more readable
Mi0.3510–1; higher is more readable
LLOC53Logical lines; fewer is more readable
DeepSeek V4 Pro150–20; mean of three runs
GPT-6.1 Sol16.330–20; mean of three runs
BTTF0.5410–1; higher is more readable

Views

Source code

package org.springframework.jms.config; import java.util.ArrayList; import java.util.List; import org.jspecify.annotations.Nullable; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.BeanFactoryAware; import org.springframework.beans.factory.InitializingBean; import org.springframework.messaging.handler.annotation.support.DefaultMessageHandlerMethodFactory; import org.springframework.messaging.handler.annotation.support.MessageHandlerMethodFactory; import org.springframework.util.Assert; public class JmsListenerEndpointRegistrar implements BeanFactoryAware, InitializingBean { private @Nullable JmsListenerEndpointRegistry endpointRegistry; private @Nullable MessageHandlerMethodFactory messageHandlerMethodFactory; private @Nullable JmsListenerContainerFactory<?> containerFactory; private @Nullable String containerFactoryBeanName; private @Nullable BeanFactory beanFactory; private final List<JmsListenerEndpointDescriptor> endpointDescriptors = new ArrayList<>(); private boolean startImmediately; public void setEndpointRegistry(@Nullable JmsListenerEndpointRegistry endpointRegistry) { this.endpointRegistry = endpointRegistry; } public @Nullable JmsListenerEndpointRegistry getEndpointRegistry() { return this.endpointRegistry; } public void setMessageHandlerMethodFactory(@Nullable MessageHandlerMethodFactory messageHandlerMethodFactory) { this.messageHandlerMethodFactory = messageHandlerMethodFactory; } public @Nullable MessageHandlerMethodFactory getMessageHandlerMethodFactory() { return this.messageHandlerMethodFactory; } public void setContainerFactory(JmsListenerContainerFactory<?> containerFactory) { this.containerFactory = containerFactory; } public void setContainerFactoryBeanName(String containerFactoryBeanName) { this.containerFactoryBeanName = containerFactoryBeanName; } @Override public void setBeanFactory(BeanFactory beanFactory) { this.beanFactory = beanFactory; } @Override public void afterPropertiesSet() { registerAllEndpoints(); } protected void registerAllEndpoints() { Assert.state(this.endpointRegistry != null, "No JmsListenerEndpointRegistry set"); for (JmsListenerEndpointDescriptor descriptor : this.endpointDescriptors) { this.endpointRegistry.registerListenerContainer( descriptor.endpoint, resolveContainerFactory(descriptor)); } this.startImmediately = true; } private JmsListenerContainerFactory<?> resolveContainerFactory(JmsListenerEndpointDescriptor descriptor) { if (descriptor.containerFactory != null) { return descriptor.containerFactory; } else if (this.containerFactory != null) { return this.containerFactory; } else if (this.containerFactoryBeanName != null) { Assert.state(this.beanFactory != null, "BeanFactory must be set to obtain container factory by bean name"); this.containerFactory = this.beanFactory.getBean( this.containerFactoryBeanName, JmsListenerContainerFactory.class); return this.containerFactory; } else { throw new IllegalStateException("Could not resolve the " + JmsListenerContainerFactory.class.getSimpleName() + " to use for [" + descriptor.endpoint + "] no factory was given and no default is set."); } } public void registerEndpoint(JmsListenerEndpoint endpoint, @Nullable JmsListenerContainerFactory<?> factory) { Assert.notNull(endpoint, "Endpoint must not be null"); Assert.hasText(endpoint.getId(), "Endpoint id must be set"); JmsListenerEndpointDescriptor descriptor = new JmsListenerEndpointDescriptor(endpoint, factory); if (this.startImmediately) { Assert.state(this.endpointRegistry != null, "No JmsListenerEndpointRegistry set"); this.endpointRegistry.registerListenerContainer(descriptor.endpoint, resolveContainerFactory(descriptor), true); } else { this.endpointDescriptors.add(descriptor); } } public void registerEndpoint(JmsListenerEndpoint endpoint) { registerEndpoint(endpoint, null); } private static class JmsListenerEndpointDescriptor { public final JmsListenerEndpoint endpoint; public final @Nullable JmsListenerContainerFactory<?> containerFactory; public JmsListenerEndpointDescriptor(JmsListenerEndpoint endpoint, @Nullable JmsListenerContainerFactory<?> containerFactory) { this.endpoint = endpoint; this.containerFactory = containerFactory; } } }

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.4066.04−134.179
Source linesThe number of non-empty source lines.185+74
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.878−7.317

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

Score0.554

Feature contributions

FeatureValueContribution
(log-odds)
Indentation frequencyHow rapidly indentation changes from line to line.185+5.662
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.186−5.549
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.184.85+2.174
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.111.962−1.077
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
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.075+0.218

Intercept 0.07 + feature contributions = 1.091 (log-odds).
Score = sigmoid(1.091) = 0.749.

Score0.351
Score53
Run 1

The code is generally readable with clear structure (fields, setters, core logic, helper class) and mostly flat nesting. Method names clearly convey intent, and the core registration logic is concise. However, readability is reduced by excessive blank lines between methods, some multi-line constructs within method calls, and the resolveContainerFactory method containing multiple branches with a nested null check. The startImmediately flag's placement and the slightly inconsistent use of inline comments (often placeholder ' ') also detract from clarity.

Run 2

The code is well-structured with clear separation of concerns and follows Spring conventions. It uses a clean class structure with fields, setters, getters, and business logic logically grouped. Nesting is minimal—only two levels deep in the worst cases. Intent is generally clear through descriptive method and variable names. The code is concise with no unnecessary duplication, though there are several blank lines and trailing whitespace that slightly reduce readability. Action granularity is good—most lines perform a single action. Reading flow is natural: methods are ordered from public API to internal implementation details. The resolveContainerFactory method is slightly complex but still readable. Minor issues: excessive blank lines between methods, trailing whitespace, and the startImmediately flag set in registerAllEndpoints could be clearer. Overall, this is professional, maintainable code with only minor formatting concerns.

Run 3

The code is generally well-structured with clear class responsibilities and consistent naming. Methods are short and focused, with one primary action per line in most cases. The descriptor inner class aids organization. However, readability is diminished by excessive blank lines between methods, which disrupts the natural reading flow. The resolveContainerFactory method contains moderate nesting with if-else branches and an embedded assertion, slightly increasing cognitive load. While imports and field declarations are clear, the presence of many empty lines after annotations and before methods feels inconsistent. Overall, the code is maintainable but could benefit from formatting cleanup.

Run 1

Code Structure: Well organized into configuration accessors, initialization, factory resolution, endpoint registration, and a small descriptor class. Nesting: Shallow loops and conditionals make control flow easy to follow. Clarity of intent: Descriptive names, explicit assertions, and nullable annotations communicate responsibilities and constraints; lifecycle behavior and factory precedence require some inference. Code length: Methods are concise, but excessive blank lines and repetitive accessors inflate the presentation. Action granularity: Statements generally perform one action each, with sensible wrapping of longer calls. Reading flow: Registration and factory resolution follow a natural sequence, although inconsistent whitespace interrupts scanning. Overall, readable and maintainable with minor formatting and documentation shortcomings.

Run 2

Code Structure: Fields, configuration methods, registration logic, and the descriptor class are logically organized, with responsibilities separated into small methods. Nesting: Shallow loops and conditionals keep control flow easy to follow. Clarity of intent: Descriptive names, explicit validation, and informative errors communicate purpose well, although lifecycle behavior and factory caching lack explanatory context. Code length: Methods are concise, but excessive blank lines unnecessarily inflate the file. Action granularity: Statements generally perform one action per line; wrapped calls remain readable. Reading flow: Configuration naturally precedes initialization and registration, and factory resolution follows a clear priority order. However, inconsistent whitespace interrupts scanning, and the unused DefaultMessageHandlerMethodFactory import adds minor clutter.

Run 3

Code Structure: Clearly separates configuration accessors, lifecycle initialization, factory resolution, and endpoint registration; the descriptor class groups related data. Nesting: Shallow loops and conditionals keep control flow easy to follow. Clarity of intent: Descriptive names, explicit validation, and useful error messages communicate purpose, although deferred versus immediate registration and factory-resolution precedence lack explanatory comments. Code length: Functional code is reasonably concise, but excessive blank lines substantially inflate its visual length. Action granularity: Statements generally perform one action per line; wrapped calls remain readable. Reading flow: Methods follow a logical progression and formatting is mostly consistent, but large whitespace gaps interrupt scanning. Overall, the implementation is readable and well organized, with whitespace cleanup and brief lifecycle documentation offering the clearest improvements.