Sample

int-77234e1573b7-I01

Remove line comments, block comments, and Javadoc

Matched original source

Lines86

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.5750–1; higher is more readable
Dorn0.1280–1; higher is more readable
Mi0.0310–1; higher is more readable
LLOC29Logical lines; fewer is more readable
DeepSeek V4 Pro15.330–20; mean of three runs
GPT-6.1 Sol170–20; mean of three runs
BTTF0.460–1; higher is more readable

Views

Source code

package org.apache.kafka.streams.processor.internals; import org.apache.kafka.common.config.TopicConfig; import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.Objects; public class WindowedChangelogTopicConfig extends InternalTopicConfig { private static final Map<String, String> WINDOWED_STORE_CHANGELOG_TOPIC_DEFAULT_OVERRIDES; static { final Map<String, String> tempTopicDefaultOverrides = new HashMap<>(INTERNAL_TOPIC_DEFAULT_OVERRIDES); tempTopicDefaultOverrides.put(TopicConfig.CLEANUP_POLICY_CONFIG, TopicConfig.CLEANUP_POLICY_COMPACT + "," + TopicConfig.CLEANUP_POLICY_DELETE); WINDOWED_STORE_CHANGELOG_TOPIC_DEFAULT_OVERRIDES = Collections.unmodifiableMap(tempTopicDefaultOverrides); } private final long retentionMs; WindowedChangelogTopicConfig(final String name, final Map<String, String> topicConfigs, final long retentionMs) { super(name, topicConfigs); this.retentionMs = retentionMs; } @Override public Map<String, String> properties(final Map<String, String> defaultProperties, final long additionalRetentionMs) { final Map<String, String> topicConfig = new HashMap<>(WINDOWED_STORE_CHANGELOG_TOPIC_DEFAULT_OVERRIDES); topicConfig.putAll(defaultProperties); topicConfig.putAll(topicConfigs); if (!topicConfigs.containsKey(TopicConfig.RETENTION_MS_CONFIG)) { long retentionValue; try { retentionValue = Math.addExact(retentionMs, additionalRetentionMs); } catch (final ArithmeticException swallow) { retentionValue = Long.MAX_VALUE; } topicConfig.put(TopicConfig.RETENTION_MS_CONFIG, String.valueOf(retentionValue)); } return topicConfig; } @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final WindowedChangelogTopicConfig that = (WindowedChangelogTopicConfig) o; return Objects.equals(name, that.name) && Objects.equals(topicConfigs, that.topicConfigs) && Objects.equals(retentionMs, that.retentionMs) && Objects.equals(enforceNumberOfPartitions, that.enforceNumberOfPartitions); } @Override public int hashCode() { return Objects.hash(name, topicConfigs, retentionMs, enforceNumberOfPartitions); } @Override public String toString() { return "WindowedChangelogTopicConfig(" + "name=" + name + ", topicConfigs=" + topicConfigs + ", retentionMs=" + retentionMs + ", enforceNumberOfPartitions=" + enforceNumberOfPartitions + ")"; } }

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.2824.481−93.208
Source linesThe number of non-empty source lines.86+34.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.897−7.346

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

Score0.575

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.150.931−2.728
Indentation frequencyHow rapidly indentation changes from line to line.86+2.238
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.87−2.044
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.85.862+0.79
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.08+0.166

Intercept 0.07 + feature contributions = -1.915 (log-odds).
Score = sigmoid(-1.915) = 0.128.

Score0.031
Score29
Run 1

The code is well-structured and readable, with clear class and method organization. The static initializer for default overrides is clean and properly immutable. The `properties` method has a natural flow: load defaults, apply user configs, compute retention. Nesting is shallow, and intent is mostly clear — although the blank comment blocks create minor noise and the `swallow` variable name is unusual. Most lines contain one action, aiding readability. Some repetition exists in equals/hashCode/toString, but this is idiomatic for Kafka internals. Overall, it is concise, maintainable code with only minor stylistic blemishes.

Run 2

The code is generally well-structured with clear class and method separation. The static block logic for default overrides is reasonable. The properties method has a clear sequence of actions but could be improved with helper methods to reduce cognitive load. Nesting is minimal. The intent of retention handling is clear, though the exception variable name 'swallow' is unconventional. The equals, hashCode, and toString implementations are standard but lengthy. Overall, readable but not exceptional.

Run 3

The code is well-structured with clear separation of concerns and logical organization. The static initialization block for default overrides is sensible, and the properties() method follows a clean merge pattern (defaults -> provided defaults -> specific configs). Nesting is minimal - only one try/catch block and simple conditionals. Method names and variable names are descriptive, making intent clear. The code is appropriately concise without being terse. Each line generally performs one logical action, though some map operations could be slightly more compact. Reading flow is natural: constructor, properties logic, then standard equals/hashCode/toString overrides. Minor deductions: the empty lines with whitespace after the constructor are unusual, and the try/catch for ArithmeticException could be simplified with Math.max or a helper method. Overall, this is maintainable and readable code that would be easy for developers to understand and modify.

Run 1

Code Structure: Logically organized into default initialization, construction, property assembly, and standard object methods. Nesting: Shallow overall; the conditional containing try/catch remains easy to follow. Clarity of intent: Descriptive names make configuration precedence and retention handling understandable, although inherited fields and overflow behavior lack explanatory context. Code length: Implementation is reasonably concise, but excessive blank lines add unnecessary visual length. Action granularity: Statements generally perform one action each; long configuration expressions slightly reduce scanability. Reading flow: Property merging and early-return equality checks follow a natural sequence. Inconsistent whitespace, long lines, and the vague exception name 'swallow' modestly detract from otherwise strong readability.

Run 2

Code Structure: Logical organization separates default configuration, construction, property resolution, and standard object methods. Nesting: Shallow overall, with only a try/catch inside a conditional. Clarity of intent: Descriptive names make configuration precedence and retention calculation understandable, though the overflow fallback lacks an explanatory comment. Code length: Functionality is concise, but excessive blank lines unnecessarily stretch the listing. Action granularity: Statements generally perform one action per line; long expressions in initialization and equality checks are slightly harder to scan. Reading flow: Methods follow a natural sequence, and early returns simplify equality checks, but inconsistent whitespace and several long lines interrupt otherwise smooth reading.

Run 3

Code Structure: Logically organized into default initialization, construction, configuration assembly, and standard object methods. Nesting: Shallow overall, with only a try/catch inside a conditional. Clarity of intent: Descriptive class, method, and variable names make configuration precedence and retention handling understandable, though the overflow fallback lacks an explanatory comment. Code length: Appropriately concise, but excessive blank lines add visual clutter, and some expressions are long. Action granularity: Statements generally perform one action per line; chained equality checks remain readable. Reading flow: Configuration assembly follows a natural sequence, and early returns simplify equals. Inconsistent whitespace, long lines, and the vague parameter name 'o' slightly reduce readability.