Sample

int-22ad02e3926b-I04

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

Matched original source

Lines116

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.7460–1; higher is more readable
Dorn0.6830–1; higher is more readable
Mi0.1160–1; higher is more readable
LLOC44Logical lines; fewer is more readable
DeepSeek V4 Pro50–20; mean of three runs
GPT-6.1 Sol120–20; mean of three runs
BTTF0.3670–1; higher is more readable

Views

Source code

package org.apache.kafka.connect.converters; import org.apache.kafka.common.config.ConfigDef; import org.apache.kafka.common.errors.SerializationException; import org.apache.kafka.common.serialization.Deserializer; import org.apache.kafka.common.serialization.Serializer; import org.apache.kafka.common.utils.Utils; import org.apache.kafka.common.utils.internals.AppInfoParser; import org.apache.kafka.connect.data.Schema; import org.apache.kafka.connect.data.SchemaAndValue; import org.apache.kafka.connect.errors.DataException; import org.apache.kafka.connect.storage.Converter; import org.apache.kafka.connect.storage.ConverterType; import org.apache.kafka.connect.storage.HeaderConverter; import org.apache.kafka.connect.storage.StringConverterConfig; import java.util.HashMap; import java.util.Map; /** * {@link Converter} and {@link HeaderConverter} implementation that only supports serializing to and deserializing from number values. * It does support handling nulls. When converting from bytes to Kafka Connect format, the converter will always return the specified * schema. * <p> * This implementation currently does nothing with the topic names or header keys. */ abstract class NumberConverter<T extends Number> implements Converter, HeaderConverter { private final Serializer<T> serializer; private final Deserializer<T> deserializer; private final String typeName; private final Schema schema; /** * Create the converter. * * @param typeName the displayable name of the type; may not be null * @param schema the optional schema to be used for all deserialized forms; may not be null * @param serializer the serializer; may not be null * @param deserializer the deserializer; may not be null */ protected NumberConverter(String a, Schema b, Serializer<T> c, Deserializer<T> d) { this.typeName = a; this.schema = b; this.serializer = c; this.deserializer = d; assert this.serializer != null; assert this.deserializer != null; assert this.typeName != null; assert this.schema != null; } @Override public String a() { return AppInfoParser.getVersion(); } @Override public ConfigDef b() { return NumberConverterConfig.configDef(); } @Override public void c(Map<String, ?> f) { NumberConverterConfig g = new NumberConverterConfig(f); boolean h = g.type() == ConverterType.KEY; serializer.configure(f, h); deserializer.configure(f, h); } @Override public void c(Map<String, ?> i, boolean j) { Map<String, Object> k = new HashMap<>(i); k.put(StringConverterConfig.TYPE_CONFIG, j ? ConverterType.KEY.getName() : ConverterType.VALUE.getName()); c(k); } @SuppressWarnings("unchecked") protected T d(Object l) { return (T) l; } @Override public byte[] e(String m, Schema n, Object o) { try { return serializer.serialize(m, o == null ? null : d(o)); } catch (ClassCastException e) { throw new DataException("Failed to serialize to " + typeName + " (was " + o.getClass() + "): ", e); } catch (SerializationException e) { throw new DataException("Failed to serialize to " + typeName + ": ", e); } } @Override public SchemaAndValue f(String p, byte[] q) { try { return new SchemaAndValue(schema, deserializer.deserialize(p, q)); } catch (SerializationException e) { throw new DataException("Failed to deserialize " + typeName + ": ", e); } } @Override public byte[] g(String r, String s, Schema t, Object u) { return e(r, t, u); } @Override public SchemaAndValue h(String v, String w, byte[] x) { return f(v, x); } @Override public void i() { Utils.closeQuietly(this.serializer, "number converter serializer"); Utils.closeQuietly(this.deserializer, "number converter deserializer"); } }

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.4953.869−163.478
Source linesThe number of non-empty source lines.116+46.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.746−7.119

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

Score0.746

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.117−3.106
Indentation frequencyHow rapidly indentation changes from line to line.103+2.826
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.134.983−2.052
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.133.803+1.354
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.115.949+1.211
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.09+0.065

Intercept 0.07 + feature contributions = 0.765 (log-odds).
Score = sigmoid(0.765) = 0.683.

Score0.116
Score44
Run 1

This code is heavily obfuscated, making it nearly unreadable despite its straightforward underlying logic. The single-letter parameter names (a, b, c, d, e, f, g, h, i, j, k) and method names (a(), b(), c(), d(), e(), f(), g(), h(), i()) completely destroy 'Clarity of intent' and 'Reading flow'. You cannot tell what a method does without deep analysis, violating the principle that code should read like prose. 'Action granularity' is harmed because even simple actions become ambiguous. While the 'Code structure' is logically organized at the class level and 'Nesting' is flat, the eroded naming nullifies those benefits. 'Code length' is concise, but at the cost of essential semantic information. The constructor's use of assertions for validation is also a poor practice for public APIs. Overall, the code requires significant mental translation, making it hard to maintain, debug, or review.

Run 2

The code has severe readability issues. Method names are obfuscated to single letters (a, b, c, d, e, f, g, h, i), making intent completely unclear. Parameters use meaningless single letters instead of descriptive names. The original code likely had clear names like 'version()' and 'configure()', but these were deliberately removed. While the structure is mostly logical with one action per line, the obfuscated naming destroys reading flow and clarity of intent. Nesting is acceptable with only one level in catch blocks. Code length is reasonable. The class-level Javadoc is clear, but method-level documentation is absent. The use of assertions for null checks is questionable - production code should use proper validation. The duplicate configure methods with boolean vs map parameters add ambiguity. Error handling is consistent but the obfuscated names make it hard to understand what operations are being performed.

Run 3

The code is heavily obfuscated. Method names are replaced with single letters (a, b, c, d, e, f, g, h, i) and parameters use meaningless identifiers (a, b, c, d, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x). This destroys clarity of intent and reading flow. The constructor documentation still refers to meaningful names (typeName, schema, serializer, deserializer) but the actual code does not match. While the structure and nesting are acceptable (flat, one action per line mostly), the complete lack of semantic naming makes the code nearly impossible to understand without extensive cross-referencing. The purposed logic (e.g., type casting, null handling, error wrapping) is simple, but the obfuscation renders it unreadable. Score is low due to the complete absence of meaningful identifiers, despite otherwise decent formatting.

Run 1

Code Structure: Fields, construction, configuration, conversion, and cleanup are logically separated into small methods. Nesting: Shallow try/catch blocks and simple expressions keep nesting minimal. Clarity of intent: The class documentation and descriptive field names explain the overall purpose, but single-letter method and parameter names obscure individual operations and delegation. Constructor documentation names parameters that do not match the signature, further reducing clarity. Code length: The implementation is reasonably concise, with little unnecessary code. Action granularity: Statements generally perform one action per line; serialization expressions combine several operations but remain manageable. Reading flow: Conventional formatting and method boundaries help, but readers must repeatedly trace opaque names such as c, d, e, and f to understand calls. Overall, sound organization is substantially undermined by poor naming.

Run 2

Code Structure: Fields, initialization, configuration, conversion, and cleanup are logically separated into small methods. Nesting: Very shallow, with straightforward try/catch blocks and no complex control flow. Clarity of intent: Descriptive field names and class documentation help, but single-letter method and parameter names severely obscure purpose; constructor documentation also names parameters that do not match the signature. Code length: Concise overall, with minimal duplication and useful delegation for header conversion. Action granularity: Generally one action per line, although some expressions combine casting, null handling, and serialization. Reading flow: Method ordering is sensible, but cryptic identifiers force readers to infer relationships from implementation details. Inconsistent spacing between methods and long lines slightly reduce scanability.

Run 3

Code Structure: Fields, construction, configuration, conversion, and cleanup are logically organized into small methods. Nesting: Very shallow, with straightforward try/catch blocks and no complex branching. Clarity of intent: Descriptive field names and class documentation help, but single-letter method and parameter names obscure operations and dependencies. Constructor documentation names do not match its parameters, further reducing clarity. Code length: Concise overall, with little unnecessary code and simple delegation for header conversion. Action granularity: Generally one action per line; nested calls and ternary expressions remain manageable. Reading flow: Method organization is sensible, but cryptic calls such as c(k), d(o), and e(r, t, u) require readers to repeatedly trace definitions. Inconsistent spacing between methods slightly weakens visual separation. Overall, good structural simplicity is substantially undermined by poor naming.