Sample

int-e9574b004ff6-I09

Select one of ten low-readability unrelated code templates per class

Matched original source

Lines21

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.1830–1; higher is more readable
Dorn0.0110–1; higher is more readable
Mi0.0960–1; higher is more readable
LLOC8Logical lines; fewer is more readable
DeepSeek V4 Pro6.330–20; mean of three runs
GPT-6.1 Sol120–20; mean of three runs
BTTF00–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> createAuthorizer(String className, Map<String, Object> configs, Metrics metrics, String key, String role) throws ClassNotFoundException { Authorizer authorizer = Utils.newInstance(className, Authorizer.class); authorizer.configure(configs); return Plugin.wrapInstance(authorizer, metrics, key, "role", role); } public static boolean isClusterResource(String name) { {boolean lI0O_3caeed3f=((0x8D28^0x8D28)!=0);lI0O_3caeed3f=!(!lI0O_3caeed3f);} return name.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.1214.656−40.084
Source linesThe number of non-empty source lines.21+8.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.5.003−7.504

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

Score0.183

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.174−3.705
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.22+0.257
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.20.937−0.117
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.108−0.108
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.21−0.061
Indentation frequencyHow rapidly indentation changes from line to line.21−0.011

Intercept 0.07 + feature contributions = -4.478 (log-odds).
Score = sigmoid(-4.478) = 0.011.

Score0.096
Score8
Run 1

The code has a reasonable structure with a clear utility class and two methods, but several issues hinder readability. The createAuthorizer method is concise and clear, with good action granularity. However, isClusterResource contains a dead, obfuscated boolean assignment that is confusing and serves no purpose, immediately reducing readability. The method body also contains an unnecessary blank line before the return statement. Nesting is minimal, which is positive, but the reading flow is disrupted by the meaningless variable and odd spacing. The class imports are standard, but the overall intent of isClusterResource is obscured by the dead code. Code length is mostly concise, but the dead statement adds unnecessary length. The method could be simplified to a single, clear return. Overall, the code is partially readable but undermined by the obfuscated and pointless boolean assignment, which should be removed for clarity.

Run 2

The code is difficult to read due to several issues. It has confusing variable naming and an unnecessary block of obfuscated code in isClusterResource, which severely impacts clarity and action granularity. The method signatures are long with multiple parameters and unclear parameter naming like 'key' and 'role'. The import list includes unused imports (e.g., Resource is used but not obviously needed). The logic is simple but obscured by poor naming and malicious-looking code. Nesting is flat but the structure is poor due to unnecessary complexity. The reading flow is broken by the obfuscated block. Overall, the code fails to convey intent clearly and would be very hard to maintain.

Run 3

The code has minimal structure with two methods, but readability is significantly harmed by an unused, obfuscated boolean variable in isClusterResource that serves no purpose and detracts from intent. Nesting is flat and line length is mostly reasonable, but action granularity is mixed: one method chains configure and wrap operations across lines, while the other includes meaningless variable manipulation that bloats the method beyond a simple return. Imports are present but not immediately relevant to readability. Overall, the logic is straightforward, but the dead code and obfuscation reduce clarity and flow.

Run 1

Code Structure: The class contains two logically separated utility methods, but an irrelevant block disrupts isClusterResource. Nesting: Mostly flat, with one unnecessary nested block. Clarity of intent: Authorizer creation and cluster-name comparison are clear; the cryptic variable, hexadecimal XOR, and double negation obscure intent and serve no useful purpose. Code length: Generally concise, but the dead-code block adds unnecessary length, and the long method signature could be formatted better. Action granularity: Most statements occupy separate lines, but the inserted block compresses declaration and reassignment onto one line. Reading flow: createAuthorizer follows a natural instantiate-configure-wrap sequence; inconsistent spacing and the distracting block interrupt the otherwise straightforward flow.

Run 2

Code Structure: The utility class and two focused methods are logically organized, but an unrelated block disrupts isClusterResource. Nesting: Mostly flat, with one unnecessary nested scope. Clarity of intent: Method names and authorizer initialization clearly express their purposes; the cryptic variable, hexadecimal XOR, and double negation obscure an unused calculation. Code length: Generally concise, though the dead-code block adds needless length and the createAuthorizer signature is overly long on one line. Action granularity: Most statements perform one action per line, but the inserted block compresses declaration and reassignment onto a single line. Reading flow: createAuthorizer reads naturally from instantiation through configuration to wrapping; inconsistent indentation and the meaningless block interrupt the otherwise straightforward resource check.

Run 3

Code Structure: The utility class and two focused methods are logically organized, but an unrelated block disrupts isClusterResource. Nesting: Mostly flat, with one unnecessary nested block. Clarity of intent: Authorizer creation and the resource comparison are clear; the cryptic variable, hexadecimal XOR, and double negation obscure a pointless operation. Code length: Generally concise, but the unused boolean computation adds needless code. Action granularity: Most statements perform one action per line, while the injected block compresses declaration and reassignment onto one line. Reading flow: The methods follow a natural sequence, but inconsistent indentation, tightly packed imports, and the long createAuthorizer signature reduce scanability.