Sample

int-a9199a0cb874-I04

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

Matched original source

Lines162

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.6340–1; higher is more readable
Dorn0.0910–1; higher is more readable
Mi0.1190–1; higher is more readable
LLOC50Logical lines; fewer is more readable
DeepSeek V4 Pro30–20; mean of three runs
GPT-6.1 Sol10.670–20; mean of three runs
BTTF0.2330–1; higher is more readable

Views

Source code

package org.apache.kafka.connect.cli; import org.apache.kafka.common.utils.Time; import org.apache.kafka.common.utils.Utils; import org.apache.kafka.common.utils.internals.Exit; import org.apache.kafka.connect.connector.policy.ConnectorClientConfigOverridePolicy; import org.apache.kafka.connect.errors.ConnectException; import org.apache.kafka.connect.json.JsonConverter; import org.apache.kafka.connect.json.JsonConverterConfig; import org.apache.kafka.connect.runtime.Connect; import org.apache.kafka.connect.runtime.Herder; import org.apache.kafka.connect.runtime.Worker; import org.apache.kafka.connect.runtime.isolation.Plugins; import org.apache.kafka.connect.runtime.rest.RestClient; import org.apache.kafka.connect.runtime.rest.RestServer; import org.apache.kafka.connect.runtime.rest.entities.ConnectorInfo; import org.apache.kafka.connect.runtime.rest.entities.CreateConnectorRequest; import org.apache.kafka.connect.runtime.standalone.StandaloneConfig; import org.apache.kafka.connect.runtime.standalone.StandaloneHerder; import org.apache.kafka.connect.storage.FileOffsetBackingStore; import org.apache.kafka.connect.storage.OffsetBackingStore; import org.apache.kafka.connect.util.FutureCallback; import com.fasterxml.jackson.core.exc.StreamReadException; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.DatabindException; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.File; import java.io.IOException; import java.nio.file.Paths; import java.util.Map; import static org.apache.kafka.connect.runtime.ConnectorConfig.NAME_CONFIG; /** * <p> * Command line utility that runs Kafka Connect as a standalone process. In this mode, work (connectors and tasks) is not * distributed. Instead, all the normal Connect machinery works within a single process. This is useful for ad hoc, * small, or experimental jobs. * </p> * <p> * Connector and task configs are stored in memory and are not persistent. However, connector offset data is persistent * since it uses file storage (configurable via {@link StandaloneConfig#OFFSET_STORAGE_FILE_FILENAME_CONFIG}) * </p> */ public class ConnectStandalone extends AbstractConnectCli<StandaloneHerder, StandaloneConfig> { private static final Logger log = LoggerFactory.getLogger(ConnectStandalone.class); public ConnectStandalone(String... a) { super(a); } @Override protected String a() { return "ConnectStandalone worker.properties [connector1.properties connector2.json ...]"; } @Override public void b(Connect<StandaloneHerder> b, String[] c) { try { for (final String d : c) { CreateConnectorRequest f = c(d); FutureCallback<Herder.Created<ConnectorInfo>> g = new FutureCallback<>((h, i) -> { if (h != null) log.error("Failed to create connector for {}", d); else log.info("Created connector {}", i.result().name()); }); b.herder().putConnectorConfig( f.name(), f.config(), f.initialTargetState(), false, g); g.get(); } b.herder().ready(); } catch (Throwable j) { log.error("Stopping after connector error", j); b.stop(); Exit.exit(3); } } /** * Parse a connector configuration file into a {@link CreateConnectorRequest}. The file can have any one of the following formats (note that * we attempt to parse the file in this order): * <ol> * <li>A JSON file containing an Object with only String keys and values that represent the connector configuration.</li> * <li>A JSON file containing an Object that can be parsed directly into a {@link CreateConnectorRequest}</li> * <li>A valid Java Properties file (i.e. containing String key/value pairs representing the connector configuration)</li> * </ol> * <p> * Visible for testing. * * @param filePath the path of the connector configuration file * @return the parsed connector configuration in the form of a {@link CreateConnectorRequest} */ CreateConnectorRequest c(String k) throws IOException { ObjectMapper l = new ObjectMapper(); File m = Paths.get(k).toFile(); try { Map<String, String> n = l.readValue(m, new TypeReference<>() { }); if (!n.containsKey(NAME_CONFIG)) { throw new ConnectException("Connector configuration at '" + k + "' is missing the mandatory '" + NAME_CONFIG + "' " + "configuration"); } return new CreateConnectorRequest(n.get(NAME_CONFIG), n, null); } catch (StreamReadException | DatabindException e) { log.debug("Could not parse connector configuration file '{}' into a Map with String keys and values", k); } try { l.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); CreateConnectorRequest o = l.readValue(m, new TypeReference<>() { }); if (o.config().containsKey(NAME_CONFIG)) { if (!o.config().get(NAME_CONFIG).equals(o.name())) { throw new ConnectException("Connector name configuration in 'config' doesn't match the one specified in 'name' at '" + k + "'"); } } else { o.config().put(NAME_CONFIG, o.name()); } return o; } catch (StreamReadException | DatabindException e) { log.debug("Could not parse connector configuration file '{}' into an object of type {}", k, CreateConnectorRequest.class.getSimpleName()); } Map<String, String> p = Utils.propsToStringMap(Utils.loadProps(k)); if (!p.containsKey(NAME_CONFIG)) { throw new ConnectException("Connector configuration at '" + k + "' is missing the mandatory '" + NAME_CONFIG + "' " + "configuration"); } return new CreateConnectorRequest(p.get(NAME_CONFIG), p, null); } @Override protected StandaloneHerder d(StandaloneConfig q, String r, Plugins s, ConnectorClientConfigOverridePolicy t, RestServer u, RestClient v) { OffsetBackingStore w = new FileOffsetBackingStore(s.newInternalConverter( true, JsonConverter.class.getName(), Map.of(JsonConverterConfig.SCHEMAS_ENABLE_CONFIG, "false"))); w.configure(q); Worker x = new Worker(r, Time.SYSTEM, s, q, w, t); return new StandaloneHerder(x, q.kafkaClusterId(), t); } @Override protected StandaloneConfig e(Map<String, String> y) { return new StandaloneConfig(y); } public static void f(String[] z) { ConnectStandalone A = new ConnectStandalone(z); A.run(); } }

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.8352.302−275.626
Source linesThe number of non-empty source lines.162+64.8
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.722−7.083

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

Score0.634

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.163−4.735
Indentation frequencyHow rapidly indentation changes from line to line.139+4.071
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.139−2.769
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.143.988−2.434
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.161.972+1.854
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.143.11+1.505
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.082+0.141

Intercept 0.07 + feature contributions = -2.297 (log-odds).
Score = sigmoid(-2.297) = 0.091.

Score0.119
Score50
Run 1

This code is heavily obfuscated with single-letter variable names (a, b, c, d, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A), method names (a(), b(), c(), d(), e(), f()), and parameters, making it nearly impossible to understand intent without deep analysis. The structure is disorganized: method `b()` mixes looping, connector creation, error handling, and callback logic with unclear control flow. Nesting is moderate but made worse by ambiguous variable names. Clarity of intent is extremely low—names give no semantic hints, and even the Javadoc refers to `c(String k)` in an unhelpful way. Code length is somewhat verbose, but the real issue is abstraction abuse: single-letter identifiers destroy readability. Action granularity is acceptable (one primary operation per line), but reading flow is unnatural and disorienting. A maintainer would struggle to trace data flow or purpose without renaming everything.

Run 2

The code suffers from severe readability issues. Function and variable names are meaningless single characters (a, b, c, d, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A), obscuring all intent. The parsing logic is moderately nested with multiple try-catch blocks and conditionals, but the naming destroys readability. Actions are mostly one per line, but the flow is impossible to follow without comments due to obfuscated identifiers. Import organization is logical and javadoc is clear, but these cannot compensate for the catastrophic loss of semantic information in identifiers.

Run 3

This code is effectively unreadable due to systematic obfuscation. Identifiers are meaningless across many variables and methods: the main class is 'ConnectStandalone' but has public methods like 'a()', 'b()', 'c()', 'd()', 'e()', and 'f()'. Local variables are mostly single letters like 'b', 'c', 'd', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A'. This destroys clarity of intent, reading flow, and code structure. Nesting is moderate but hidden within meaningless variable names. Action granularity is acceptable in places, but the cost of decoding variable names makes every line hard. Code length is normal, but the intentionally cryptic naming makes even simple logic ambiguous, requiring constant reverse-engineering of identifiers.

Run 1

Code Structure: Separate methods organize startup, configuration parsing, and worker construction logically. Nesting: Mostly shallow, with moderate nesting in connector creation and configuration validation. Clarity of intent: Single-letter method and variable names severely obscure roles and force readers to infer meaning from types and calls; documentation and descriptive library APIs partially compensate. Code length: Generally reasonable, though repeated mandatory-name validation and lengthy imports add overhead. Action granularity: Most statements perform one action per line, with conventional multiline calls; chained expressions require some additional interpretation. Reading flow: Sequential parsing fallbacks and consistent indentation provide a coherent flow, but opaque identifiers, missing import-group spacing, and documentation referring to a parameter name not used in the signature interrupt comprehension.

Run 2

Code Structure: Responsibilities are separated into methods, and configuration parsing follows clearly defined fallback stages. Nesting: Mostly moderate, though the connector loop, callback, and nested name-validation condition add complexity. Clarity of intent: The main weakness is pervasive single-letter method and variable names, which obscure roles and require readers to infer meaning from types and calls. Documentation, API names, and log messages partially compensate; the filePath documentation does not match parameter k. Code length: Reasonably concise for its functionality, with some repeated mandatory-name validation. Action granularity: Generally one statement per line, with readable formatting for longer calls. Reading flow: Startup, parsing, and component construction are coherent locally, but opaque identifiers, tightly packed imports, and inconsistent wrapping interrupt comprehension.

Run 3

Code Structure: Responsibilities are separated into methods, and configuration parsing follows a logical fallback sequence. Nesting: Mostly shallow, with moderate nesting in connector creation and configuration validation. Clarity of intent: Single-letter method and variable names severely obscure purpose; descriptive types, logging, and documentation partially compensate. The documented filePath parameter also differs from the actual parameter name. Code length: Reasonably concise for its responsibilities, although mandatory-name validation is duplicated and imports are visually dense. Action granularity: Most statements perform one action per line, with conventional multiline calls; some chained expressions require extra attention. Reading flow: Startup, parsing, and worker construction are internally coherent, but opaque identifiers force repeated cross-referencing, and inconsistent spacing and wrapping interrupt scanning.