Sample

int-d42d1074a1c5-I01

Remove line comments, block comments, and Javadoc

Matched original source

Lines168

Scores

MethodScoreScale
Posnett0.9960–1; higher is more readable
Scalabrino0.6130–1; higher is more readable
Dorn0.7680–1; higher is more readable
Mi0.4110–1; higher is more readable
LLOC23Logical lines; fewer is more readable
DeepSeek V4 Pro15.670–20; mean of three runs
GPT-6.1 Sol150–20; mean of three runs
BTTF0.5240–1; higher is more readable

Views

Source code

package org.apache.kafka.connect.storage; import org.apache.kafka.connect.runtime.RestartRequest; import org.apache.kafka.connect.runtime.SessionKey; import org.apache.kafka.connect.runtime.TargetState; import org.apache.kafka.connect.util.ConnectorTaskId; import java.util.Collection; import java.util.List; import java.util.Map; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; public interface ConfigBackingStore { void start(); void stop(); ClusterConfigState snapshot(); boolean contains(String connector); void putConnectorConfig(String connector, Map<String, String> properties, TargetState targetState); void removeConnectorConfig(String connector); void putTaskConfigs(String connector, List<Map<String, String>> configs); void removeTaskConfigs(String connector); void refresh(long timeout, TimeUnit unit) throws TimeoutException; void putTargetState(String connector, TargetState state); void putSessionKey(SessionKey sessionKey); void putRestartRequest(RestartRequest restartRequest); void putTaskCountRecord(String connector, int taskCount); default void claimWritePrivileges() { } void putLoggerLevel(String namespace, String level); void setUpdateListener(UpdateListener listener); interface UpdateListener { void onConnectorConfigRemove(String connector); void onConnectorConfigUpdate(String connector); void onTaskConfigUpdate(Collection<ConnectorTaskId> tasks); void onConnectorTargetStateChange(String connector); void onSessionKeyUpdate(SessionKey sessionKey); void onRestartRequest(RestartRequest restartRequest); void onLoggingLevelUpdate(String namespace, String level); } }

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(log-odds)
Source linesThe number of non-empty source lines.168+67.2
Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones.1935.261−63.864
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.531−6.796

Intercept 8.87 + feature contributions = 5.41 (log-odds).
Score = sigmoid(5.41) = 0.996.

Score0.613

Feature contributions

FeatureValueContribution
(log-odds)
Indentation frequencyHow rapidly indentation changes from line to line.168+5.074
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.169−4.947
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.167.962+1.938
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
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.102.982−0.697
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.165

Intercept 0.07 + feature contributions = 1.197 (log-odds).
Score = sigmoid(1.197) = 0.768.

Score0.411
Score23
Run 1

The code is a clean interface with good method naming and clear intent regarding what each operation does. The structure is logical, grouping related configuration operations together, and the UpdateListener interface is well-organized. However, there are excessive blank lines scattered throughout the code, which disrupts reading flow. While the methods themselves are flat and have minimal nesting (only one nested interface), the inconsistent whitespace makes the code feel disorganized. Each method performs a single action, contributing to good action granularity. The code length is appropriate for an interface of this complexity, avoiding unnecessary verbosity. Overall, the code is readable but could be improved with more consistent formatting.

Run 2

The code is highly readable due to its clear interface definition and logical method grouping. It maintains flat nesting with no conditional logic, making the flow easy to follow. Method names clearly convey intent (e.g., putConnectorConfig, removeTaskConfigs), and each line represents a single action or declaration. The UpdateListener inner interface is well-organized with descriptive method names. While spacing between method declarations is somewhat inconsistent and there are unnecessary blank lines, these are minor issues that slightly reduce polish. The code could benefit from brief Javadoc comments explaining the contract of methods like claimWritePrivileges() and snapshot(), but overall the structure is clean, concise, and self-documenting.

Run 3

The code is generally readable due to a clear interface definition with descriptive method names and logical grouping. The structure is organized, and intent is mostly clear. However, readability is reduced by excessive blank lines between method declarations (sometimes multiple consecutive), which disrupts the natural reading flow. The code lacks any Javadoc or comments explaining the purpose of methods or parameters, making it harder to understand the contract. The UpdateListener interface is reasonably structured but would benefit from concise documentation. Nesting is minimal, action granularity is appropriate, and the code is concise for an interface. Overall, it is clean but could be improved with consistent spacing and minimal documentation.

Run 1

Code Structure: The interface logically groups storage operations and defines update callbacks in a dedicated nested interface, though method ordering could better group related operations. Nesting: Minimal nesting makes the declarations easy to follow. Clarity of intent: Descriptive method and parameter names convey most purposes, but missing documentation leaves operational semantics and the empty default method unclear. Code length: Declarations are concise, but excessive blank lines unnecessarily lengthen the file and hinder scanning. Action granularity: Each method declaration occupies its own line, with no combined actions. Reading flow: Consistent signatures and indentation support readability, but irregular whitespace and loosely grouped methods interrupt the flow.

Run 2

Code Structure: The interface cleanly separates configuration-store operations from update callbacks, though related methods could be grouped more deliberately. Nesting: Minimal nesting, limited to the listener interface and an empty default method. Clarity of intent: Descriptive method and parameter names communicate most responsibilities, but documentation would clarify timeout behavior, write privileges, and update semantics. Code length: Declarations are concise, but excessive blank lines unnecessarily inflate the code. Action granularity: Each declaration occupies its own line, making individual operations easy to identify. Reading flow: Lifecycle methods appear first and callbacks remain together, providing a generally natural flow; inconsistent spacing and large gaps disrupt scanning.

Run 3

Code Structure: The interface cleanly separates storage operations from update callbacks, though method grouping could be clearer. Nesting: Minimal nesting, limited to the listener interface and an empty default method. Clarity of intent: Descriptive method and parameter names convey most purposes, but documentation would clarify timeout behavior, write privileges, and update semantics. Code length: Declarations are concise, but excessive blank lines unnecessarily inflate the code. Action granularity: Each declaration occupies its own line, making individual operations easy to identify. Reading flow: Lifecycle methods appear first and callbacks are grouped at the end, providing a reasonable sequence; however, inconsistent spacing and loosely grouped operations interrupt scanning.