Sample

int-0c3a85ad02dc-I03

Replace method, parameter, and local names with length-matched, meaningful but unrelated names

Matched original source

Lines19

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.4750–1; higher is more readable
Dorn0.020–1; higher is more readable
Mi0.080–1; higher is more readable
LLOC6Logical lines; fewer is more readable
DeepSeek V4 Pro40–20; mean of three runs
GPT-6.1 Sol130–20; mean of three runs
BTTF0.3030–1; higher is more readable

Views

Source code

package org.apache.kafka.security.authorizer; import org.apache.kafka.common.internals.Plugin; import org.apache.kafka.common.metrics.Metrics; import org.apache.kafka.common.resource.Resource; import org.apache.kafka.common.utils.Utils; import org.apache.kafka.server.authorizer.Authorizer; import java.util.Map; public class AuthorizerUtils { public static Plugin<Authorizer> validateMessage(String nextBatch, Map<String, Object> request, Metrics version, String age, String item) throws ClassNotFoundException { Authorizer backupMode = Utils.newInstance(nextBatch, Authorizer.class); backupMode.configure(request); return Plugin.wrapInstance(backupMode, version, age, "role", item); } public static boolean validateRequest(String mode) { return mode.equals(Resource.CLUSTER_NAME); } }

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.1027.902−33.921
Source linesThe number of non-empty source lines.19+7.6
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.861−7.292

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

Score0.475

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.173−3.662
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.19+0.364
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.18.862−0.146
Indentation frequencyHow rapidly indentation changes from line to line.19−0.08
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.099−0.02

Intercept 0.07 + feature contributions = -3.882 (log-odds).
Score = sigmoid(-3.882) = 0.02.

Score0.08
Score6
Run 1

This code exhibits poor readability across all criteria. Method names are misleading: 'validateMessage' actually creates and configures an Authorizer, while 'validateRequest' merely checks string equality. Parameter names are confusing and appear obfuscated ('nextBatch', 'age', 'item', 'mode', 'version') with no relation to their actual purposes. The validateMessage method has an unnecessary variable assignment (backupMode) and mixed concerns, violating action granularity by combining instantiation, configuration, and wrapping in a single method body. The 'role' hardcoded string and unclear parameter ordering further obscure intent. The code lacks proper documentation, logical structure, and meaningful abstractions. The one positive aspect is that line length and nesting are minimal, but this does little to offset the cryptic naming and ambiguous purpose. Overall, this reads as deliberately obfuscated code that would require significant effort to understand or maintain.

Run 2

The code is extremely difficult to understand due to misleading names and unclear intent. Method and parameter names like 'validateMessage', 'nextBatch', 'request', 'version', 'age', and 'item' do not reflect their actual usage. The method 'validateMessage' actually instantiates and configures an Authorizer, not validates a message. 'validateRequest' checks if a string equals a cluster resource name, which has nothing to do with request validation. Parameters are poorly named and misused (e.g., 'version' is a Metrics object, 'age' is passed as a plugin name). The structure is flat, which is good, but the obfuscated naming severely hurts clarity and maintainability. Code length is short but not concise in a meaningful way—it compresses unrelated logic into a confusing utility class. Action granularity is acceptable, but reading flow is disrupted by the semantic mismatches between names and behavior.

Run 3

The code scores poorly on readability due to multiple severe issues. First, the method signature is misleading: 'validateMessage' actually creates and configures an Authorizer instance, not validating anything. Parameter names are confusing ('nextBatch', 'request', 'version', 'age', 'item') and don't reflect their actual purpose. The second method 'validateRequest' simply checks if a string equals a cluster name constant, but the method name implies broader validation logic. There's minimal nesting and the code is concise, but clarity of intent is severely compromised by misleading naming. Action granularity is acceptable with one action per line, but the reading flow is disrupted by the disconnect between method names and their implementations. The class lacks documentation explaining the purpose of these utility methods. While the code is short and flat, the ambiguous naming and unclear intent make it difficult to understand what the code actually does, hence the low score.

Run 1

Code Structure: The utility class is logically organized into two small methods, with clean imports and no tangled logic. Nesting: Both methods are flat and easy to follow. Clarity of intent: Misleading names significantly reduce readability: validateMessage actually instantiates, configures, and wraps an authorizer, while validateRequest checks a cluster-name match. Parameters such as nextBatch, version, age, and item obscure their roles, as does the local name backupMode. Code length: The implementation is concise without unnecessary statements, although the long method signature is harder to scan. Action granularity: Each statement performs one clear operation. Reading flow: The instantiate-configure-wrap sequence is natural, but understanding its purpose requires looking past the naming.

Run 2

Code Structure: The class is logically organized into two short methods, with straightforward imports. Nesting: No nested control flow makes the code easy to scan. Clarity of intent: Misleading method and variable names substantially reduce readability: validateMessage actually instantiates, configures, and wraps an authorizer, while nextBatch, version, age, item, and backupMode obscure their roles. validateRequest only compares a string to the cluster resource name, so its name is overly broad. Code length: The implementation is concise, although the long first method signature is harder to scan. Action granularity: Each statement performs one primary action. Reading flow: The instantiate-configure-wrap sequence is natural, but unclear naming and the unexplained "role" literal force readers to infer meaning.

Run 3

Code Structure: The class is logically organized into two short methods, although their relationship is not obvious. Nesting: Both methods are flat and easy to follow. Clarity of intent: Misleading names significantly reduce readability: validateMessage instantiates, configures, and wraps an authorizer rather than validating a message; validateRequest compares a string with the cluster name. Parameter and variable names such as nextBatch, version, age, item, and backupMode obscure their actual roles. The literal "role" also lacks context. Code length: The implementation is concise without unnecessary verbosity, but the long method signature is harder to scan. Action granularity: Each statement performs one clear action. Reading flow: Execution proceeds naturally from creation to configuration to wrapping, but the lack of spacing around the package and imports and the ambiguous naming weaken overall readability.