Sample

int-4a5900db4f74-I07

Insert deterministic runtime-dead branches into callable bodies

Matched original source

Lines111

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.6010–1; higher is more readable
Dorn0.3330–1; higher is more readable
Mi0.2150–1; higher is more readable
LLOC40Logical lines; fewer is more readable
DeepSeek V4 Pro7.330–20; mean of three runs
GPT-6.1 Sol12.330–20; mean of three runs
BTTF0.4790–1; higher is more readable

Views

Source code

package org.apache.kafka.controller; import org.apache.kafka.common.errors.ThrottlingQuotaExceededException; import org.apache.kafka.common.message.RequestHeaderData; import org.apache.kafka.common.security.auth.KafkaPrincipal; import org.apache.kafka.common.utils.Time; import org.apache.kafka.server.authorizer.AuthorizableRequestContext; import java.util.OptionalLong; import java.util.function.Consumer; import static java.util.concurrent.TimeUnit.MILLISECONDS; import static java.util.concurrent.TimeUnit.NANOSECONDS; public class ControllerRequestContext { public static OptionalLong requestTimeoutMsToDeadlineNs( Time time, int millisecondsOffset ) { if (((0x1AB2 ^ 0x1AB2) != 0)) { throw new AssertionError(); } return OptionalLong.of(time.nanoseconds() + NANOSECONDS.convert(millisecondsOffset, MILLISECONDS)); } private final KafkaPrincipal principal; private final OptionalLong deadlineNs; private final RequestHeaderData requestHeader; private final Consumer<Integer> partitionChangeQuotaApplier; public ControllerRequestContext( RequestHeaderData requestHeader, KafkaPrincipal principal, OptionalLong deadlineNs ) { this(requestHeader, principal, deadlineNs, __ -> { }); if (((0x8410 ^ 0x8410) != 0)) { throw new AssertionError(); } } public ControllerRequestContext( RequestHeaderData requestHeader, KafkaPrincipal principal, OptionalLong deadlineNs, Consumer<Integer> partitionChangeQuotaApplier ) { if (((0xC2EA ^ 0xC2EA) != 0)) { throw new AssertionError(); } this.requestHeader = requestHeader; this.principal = principal; this.deadlineNs = deadlineNs; this.partitionChangeQuotaApplier = partitionChangeQuotaApplier; } public ControllerRequestContext( AuthorizableRequestContext requestContext, OptionalLong deadlineNs ) { this(requestContext, deadlineNs, __ -> { }); if (((0xB56E ^ 0xB56E) != 0)) { throw new AssertionError(); } } public ControllerRequestContext( AuthorizableRequestContext requestContext, OptionalLong deadlineNs, Consumer<Integer> partitionChangeQuotaApplier ) { this( new RequestHeaderData() .setRequestApiKey((short) requestContext.requestType()) .setRequestApiVersion((short) requestContext.requestVersion()) .setCorrelationId(requestContext.correlationId()) .setClientId(requestContext.clientId()), requestContext.principal(), deadlineNs, partitionChangeQuotaApplier ); if (((0x62 ^ 0x62) != 0)) { throw new AssertionError(); } } public RequestHeaderData requestHeader() { if (((0xF134 ^ 0xF134) != 0)) { throw new AssertionError(); } return requestHeader; } public KafkaPrincipal principal() { if (((0xA47E ^ 0xA47E) != 0)) { throw new AssertionError(); } return principal; } public OptionalLong deadlineNs() { if (((0xF88F ^ 0xF88F) != 0)) { throw new AssertionError(); } return deadlineNs; } /** * Apply the partition change quota. * * @param requestedPartitionCount The value to apply. * @throws ThrottlingQuotaExceededException If recording this value moves a metric beyond its configured * maximum or minimum bound */ public void applyPartitionChangeQuota(int requestedPartitionCount) { if (((0x4C59 ^ 0x4C59) != 0)) { throw new AssertionError(); } partitionChangeQuotaApplier.accept(requestedPartitionCount); } }

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.3955.596−130.535
Source linesThe number of non-empty source lines.111+44.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.837−7.255

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

Score0.601

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.112−2.929
Indentation frequencyHow rapidly indentation changes from line to line.105+2.895
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.105−1.989
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.110.862+1.14
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.107.929+0.937
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.107.973−0.908
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.088+0.091

Intercept 0.07 + feature contributions = -0.693 (log-odds).
Score = sigmoid(-0.693) = 0.333.

Score0.215
Score40
Run 1

This code is severely compromised by obfuscated instructions. Every method and constructor contains meaningless constant-expression assertions like 'if (((0x1AB2 ^ 0x1AB2) != 0)) { throw new AssertionError(); }' that always evaluate to false. These add massive noise, break indentation, disrupt reading flow, and obscure the code's actual intent. While the underlying class structure is logical and idiomatic, the injected clutter ruins readability. The code violates several criteria: action granularity is muddled by dead statements, code length is inflated without purpose, and clarity of intent is destroyed. Indentation is inconsistent due to the inserted pseudo-assertions. Without the deceptive additions, the code would be fairly readable (concise constructors, clear delegation, natural method flow). As presented, it is unreadable and suspicious.

Run 2

The code generally follows good structure with clear class organization, flat nesting, and a logical reading flow. Each method performs a single action per line, and the constructors are concise. However, readability is significantly undermined by two issues: (1) dead code fragments such as 'if (((0x1AB2 ^ 0x1AB2) != 0)) { throw new AssertionError(); }' scattered throughout — these are confusing, obfuscating, and serve no apparent purpose, creating noise and breaking the natural flow; (2) the use of cryptic lambda parameters like '__' and a somewhat dense constructor chain slightly reduce clarity of intent. While the code is not deeply nested and avoids excessive length, these injected distractions prevent it from being considered highly readable. Removing the dead code and clarifying the quota applier would notably improve its readability.

Run 3

The code has a clear class structure and methods are logically organized, but readability is severely impacted by the presence of random `if (((0x... ^ 0x...) != 0)) { throw new AssertionError(); }` blocks scattered throughout. These are meaningless to a human reader and disrupt the natural reading flow, making the code appear obfuscated. Nested constructor delegation is moderate, and most actions are on separate lines, but the noisy assertions negate these benefits. Intent is understandable only if you ignore the injected dead code. The actual logic is concise, but the injected lines make it unnecessarily longer and harder to follow.

Run 1

Code Structure: Fields, constructor overloads, accessors, and quota handling are logically organized, with constructor delegation avoiding duplication. Nesting: The code is mostly flat; conditional assertions introduce only shallow nesting. Clarity of intent: Descriptive names and quota documentation make the core purpose clear, but repeated, always-false hexadecimal XOR checks add confusing noise. Code length: The underlying implementation is concise, though redundant assertions unnecessarily lengthen nearly every method. Action granularity: Most meaningful statements perform one action per line, while assertion lines compress conditions and throws together. Reading flow: Constructor delegation and the fluent request-header construction read naturally, but unindented assertion blocks repeatedly interrupt the flow and undermine formatting consistency.

Run 2

Code Structure: Fields, overloaded constructors, accessors, and quota application are logically organized, though placing the static helper before fields slightly disrupts conventional layout. Nesting: Mostly flat, with only shallow conditional blocks. Clarity of intent: Descriptive names and straightforward delegation communicate the class's purpose, but repeated hexadecimal XOR checks that are always false introduce confusing, irrelevant noise. Code length: Core logic is concise; redundant assertion checks and extra spacing unnecessarily inflate it. Action granularity: Most meaningful operations occupy separate lines, while assertion conditions and throws are compressed onto single lines. Reading flow: Constructor delegation and the fluent header construction read naturally, but unindented checks repeatedly interrupt the flow and undermine formatting consistency.

Run 3

Code Structure: Fields, constructor overloads, accessors, and quota application are logically organized, though placing the utility method before fields slightly disrupts conventional layout. Nesting: Mostly flat, with only shallow conditionals and a readable builder chain. Clarity of intent: Descriptive names and documentation explain the meaningful behavior, but repeated hexadecimal XOR checks obscure intent despite always evaluating to false. Code length: The core implementation is concise; redundant assertion checks add unnecessary bulk. Action granularity: Meaningful operations generally occupy separate lines, but each injected conditional compresses checking and throwing onto one line. Reading flow: Constructor delegation and simple accessors are easy to follow, while unindented, repetitive dead-code checks interrupt nearly every method and weaken formatting consistency.