Sample

int-4ce74cee4702-I04

Replace method, parameter, and local names with deterministic ProGuard-style short identifiers

Matched original source

Lines60

Scores

MethodScoreScale
Posnett0.8850–1; higher is more readable
Scalabrino0.8690–1; higher is more readable
Dorn0.5770–1; higher is more readable
Mi0.1130–1; higher is more readable
LLOC5Logical lines; fewer is more readable
DeepSeek V4 Pro7.330–20; mean of three runs
GPT-6.1 Sol14.330–20; mean of three runs
BTTF0.7370–1; higher is more readable

Views

Source code

package org.apache.kafka.connect.connector.policy; import org.apache.kafka.common.Configurable; import org.apache.kafka.common.annotation.InterfaceAudience; import org.apache.kafka.common.config.ConfigDef; import org.apache.kafka.common.config.ConfigValue; import org.apache.kafka.connect.components.ConnectPlugin; import java.util.List; /** * An interface for enforcing a policy on overriding of Kafka client configs via the connector configs. * <p> * Common use cases are ability to provide principal per connector, <code>sasl.jaas.config</code> * and/or enforcing that the producer/consumer configurations for optimizations are within acceptable ranges. * <p>Kafka Connect discovers implementations of this interface using the Java {@link java.util.ServiceLoader} mechanism. * To support this, implementations of this interface should also contain a service provider configuration file in * {@code META-INF/services/org.apache.kafka.connect.connector.policy.ConnectorClientConfigOverridePolicy}. * <p> * Implement {@link org.apache.kafka.common.metrics.Monitorable} to enable the policy to register metrics. * The following tags are automatically added to all metrics registered: <code>config</code> set to * <code>connector.client.config.override.policy</code>, and <code>class</code> set to the * ConnectorClientConfigOverridePolicy class name. */ @InterfaceAudience.Public public interface ConnectorClientConfigOverridePolicy extends Configurable, AutoCloseable, ConnectPlugin { /** * Workers will invoke this before configuring per-connector Kafka admin, producer, and consumer client instances * to validate if all the overridden client configurations are allowed per the policy implementation. * This would also be invoked during the validation of connector configs via the REST API. * <p> * If there are any policy violations, the connector will not be started. * * @param connectorClientConfigRequest an instance of {@link ConnectorClientConfigRequest} that provides the configs * to be overridden and its context; never {@code null} * @return list of {@link ConfigValue} instances that describe each client configuration in the request and includes an {@link ConfigValue#errorMessages() error} if the configuration is not allowed by the policy; never null */ List<ConfigValue> a(ConnectorClientConfigRequest a); /** * Configuration specification for this policy override. * * @return the configuration definition for this policy override; never null */ @Override default ConfigDef b() { return new ConfigDef(); } /** * Get the version of this component. * * @return the version, formatted as a String. The version may not be {@code null} or empty. */ @Override default String c() { return "undefined"; } }

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(log-odds)
Source linesThe number of non-empty source lines.60+24
Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones.724.925−23.923
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.604−6.906

Intercept 8.87 + feature contributions = 2.042 (log-odds).
Score = sigmoid(2.042) = 0.885.

Score0.869

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.123.967−1.586
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.121.951+1.163
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.61−1.123
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.022+0.731
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.59.888+0.427
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
Indentation frequencyHow rapidly indentation changes from line to line.28+0.231

Intercept 0.07 + feature contributions = 0.312 (log-odds).
Score = sigmoid(0.312) = 0.577.

Score0.113
Score5
Run 1

The code has good structure and organization, with clear Javadoc comments documenting the interface's purpose and use cases. However, the method names have been obfuscated (a(), b(), c()) which severely impacts readability and clarity of intent. While the Javadoc explains what each method does, the actual identifiers don't match their documented purposes. The interface extends multiple interfaces and includes default methods, but the obfuscated names make it impossible to understand the code without reading documentation thoroughly. The nesting is flat and action granularity is appropriate for an interface. The reading flow is natural in the documentation but becomes confusing when mapping documentation to obscured method names. The code length is reasonable for an interface with this level of documentation. Overall, this appears to be intentionally obfuscated code that would be significantly more readable with proper method names like 'validate', 'config', and 'version'.

Run 2

The code has some readability strengths, such as a logical package structure and clear Javadoc comments that explain intent. However, it suffers from several major issues. The method names are completely obfuscated ('a', 'b', 'c'), making the code ambiguous and forcing the reader to rely entirely on comments to understand purpose. The parameter name 'a' in method 'a' is equally unclear. The long Javadoc blocks, while informative, are verbose and could be more concise. Reading flow is disrupted by the need to mentally map cryptic identifiers to their documented meanings. Nesting is flat, which is good, and action granularity is acceptable, but the lack of descriptive identifiers severely impacts clarity and maintainability. The score reflects that meaningful naming is critical for readable code.

Run 3

The code has a clear, well-documented structure with good use of Javadoc explaining the interface's purpose and contract. However, the method names have been obfuscated to 'a', 'b', and 'c', which severely damages clarity of intent and reading flow. Additionally, the parameter in method 'a' is named 'a' instead of a meaningful name like 'connectorClientConfigRequest', making the method signature difficult to understand at a glance. The Javadoc is well-written but the obfuscated identifiers require readers to constantly refer back to documentation. The overall structure is logical (interface with clear purpose, one main method, two sensible default implementations), nesting is flat, and line length is reasonable, but the obfuscated naming is a major readability failure that outweighs the good documentation.

Run 1

Code Structure: The interface is logically organized, with imports, interface documentation, and three clearly separated methods. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: Detailed Javadocs explain the policy and method purposes, but opaque names a, b, and c—and parameter a—significantly weaken readability. The documented parameter name also differs from the actual signature. Code length: Implementation is concise; documentation is extensive but mostly useful. Action granularity: Each statement performs one action, and the default methods contain simple returns. Reading flow: The progression from validation to configuration definition to version is natural, although excess blank lines and inconsistent Javadoc indentation slightly disrupt presentation.

Run 2

Code Structure: The interface is logically organized, with imports, interface documentation, and method declarations clearly separated. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: Detailed Javadoc explains the policy and methods, but names a, b, and c obscure their purposes, and parameter a conflicts with the documented connectorClientConfigRequest name. Code length: The implementation is concise; extensive documentation is mostly useful, though disproportionate to the small interface. Action granularity: Each declaration or return statement performs one action. Reading flow: The top-to-bottom flow is natural, but cryptic identifiers, extra blank lines, and inconsistent Javadoc indentation interrupt readability.

Run 3

Code Structure: The interface is logically organized, with imports, interface documentation, and individual method declarations. Nesting: Minimal nesting makes it easy to scan. Clarity of intent: Detailed Javadoc explains the policy, but method names a, b, and c and parameter name a obscure their purposes. The @param documentation also references a name absent from the signature. Code length: Implementation is concise; extensive documentation is mostly useful, though somewhat verbose. Action granularity: Each declaration or return occupies its own line, with no bundled actions. Reading flow: The sequence is natural, but extra blank lines, inconsistent Javadoc formatting, and opaque identifiers interrupt readability.