Sample

int-41a7f9d91275-I09

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

Matched original source

Lines65

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.6770–1; higher is more readable
Dorn0.2170–1; higher is more readable
Mi0.1770–1; higher is more readable
LLOC26Logical lines; fewer is more readable
DeepSeek V4 Pro130–20; mean of three runs
GPT-6.1 Sol12.670–20; mean of three runs
BTTF0.1610–1; higher is more readable

Views

Source code

package org.apache.kafka.server.purgatory; import org.apache.kafka.common.errors.TimeoutException; import org.apache.kafka.common.utils.internals.LogContext; import org.slf4j.Logger; import java.util.List; import java.util.concurrent.CompletableFuture; /** * A delayed operation using CompletionFutures that can be created by KafkaApis and watched * in a DelayedFuturePurgatory purgatory. This is used for ACL updates using async Authorizers. */ public class DelayedFuture<T> extends DelayedOperation { private final Logger log = new LogContext().logger(DelayedFuture.class.getName()); private final List<CompletableFuture<T>> futures; private final Runnable responseCallback; private final long timeoutMs; public DelayedFuture(long timeoutMs, List<CompletableFuture<T>> futures, Runnable responseCallback) { super(timeoutMs); this.timeoutMs = timeoutMs; this.futures = futures; this.responseCallback = responseCallback; } /** * The operation can be completed if all the futures have completed successfully * or failed with exceptions. */ @Override public boolean tryComplete() { {int lI0O_9143e2e5=0xC79C;lI0O_9143e2e5=((lI0O_9143e2e5^0xC79C)|0)&-1;if(((lI0O_9143e2e5&1)==1)){lI0O_9143e2e5^=lI0O_9143e2e5;}} log.trace("Trying to complete operation for {} futures", futures.size()); long pending = futures.stream().filter(future -> !future.isDone()).count(); if (pending == 0) { log.trace("All futures have been completed or have errors, completing the delayed operation"); return forceComplete(); } else { log.trace("{} future still pending, not completing the delayed operation", pending); return false; } } /** * Timeout any pending futures and invoke responseCallback. This is invoked when all * futures have completed or the operation has timed out. */ @Override public void onComplete() { List<CompletableFuture<T>> pendingFutures = futures.stream().filter(future -> !future.isDone()).toList(); log.trace("Completing operation for {} futures, expired {}", futures.size(), pendingFutures.size()); pendingFutures.forEach(future -> future.completeExceptionally(new TimeoutException("Request has been timed out after " + timeoutMs + " ms"))); responseCallback.run(); } /** * This is invoked after onComplete(), so no actions required. */ @Override public void onExpiration() { // This is invoked after onComplete(), so no actions required. } }

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.2437.416−80.435
Source linesThe number of non-empty source lines.65+26
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.855−7.283

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

Score0.677

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.149.985−2.688
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.150+1.616
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.64−1.23
Indentation frequencyHow rapidly indentation changes from line to line.53+1.096
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.53−0.795
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.64.834+0.496
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.081+0.154

Intercept 0.07 + feature contributions = -1.281 (log-odds).
Score = sigmoid(-1.281) = 0.217.

Score0.177
Score26
Run 1

The code is generally well-structured with clear class purpose and good Javadoc comments. However, there is a significant readability issue: the tryComplete() method contains an obfuscated line `{int lI0O_9143e2e5=0xC79C;...}` that appears to be injected code, severely hurting clarity. This line is confusing, serves no apparent purpose, and disrupts the natural reading flow. Beyond that, the code is fairly flat with minimal nesting, actions are mostly one per line, and method names are descriptive. The class is concise and follows logical organization. Without the obfuscated line, the code would score higher (around 17-18). The unusual variable name and bitwise operations make the method harder to understand and could indicate injected or malicious code. The overall structure is good, but this single element significantly reduces readability.

Run 2

The code has reasonable structure and clear method names, but is severely undermined by an obfuscated, useless block of random code inserted in tryComplete(). This block is confusing, serves no purpose, and destroys readability. The variable 'lI0O_9143e2e5' is meaningless, and the bitwise operations add noise. Beyond that, nesting is low, methods are concise, and intent is mostly clear from Javadoc comments. However, the presence of this dead code makes the logic ambiguous and interrupts reading flow. The code length is otherwise short, but the random block adds unnecessary length. Action granularity is mostly one action per line except for the complex boolean expressions. Overall, the code's quality is significantly reduced by the injected noise.

Run 3

The code is well-structured and readable overall. It has clear class organization, flat nesting, good use of logging, and concise methods with clear intent. Each line performs a single logical action, and the reading flow is natural. The main issue is an obfuscated line in tryComplete() that appears to be injected dead code, which significantly hurts clarity and serves no functional purpose. Otherwise, the class is straightforward: it extends DelayedOperation, manages a list of futures, and defines completion/timeout behavior cleanly. The Javadoc comments are helpful. Minor opportunities for improvement include avoiding the magic '0' in pending check and ensuring no confusing statements remain.

Run 1

Code Structure: The class is logically organized into fields, constructor, and lifecycle methods, but an unrelated obfuscated block disrupts tryComplete(). Nesting: Most logic is shallow; the injected block introduces unnecessary scope and conditional nesting. Clarity of intent: Descriptive names, documentation, and logging explain future completion and timeout handling, while meaningless identifiers and bitwise operations obscure intent locally. Code length: The implementation is otherwise concise, but the redundant injected code and duplicated expiration explanation add noise. Action granularity: Most statements perform one action per line, but the injected block compresses several statements onto one line, and the long exceptional-completion expression is harder to scan. Reading flow: The lifecycle methods follow a natural sequence, but the abrupt obfuscated block and long lines interrupt an otherwise readable implementation.

Run 2

Code Structure: Fields, constructor, and lifecycle methods are logically organized, but an unrelated obfuscated block disrupts tryComplete(). Nesting: The meaningful logic is shallow, although the injected block adds unnecessary scope and branching. Clarity of intent: Descriptive names, comments, and logging explain future completion and timeout handling; cryptic identifiers and bitwise operations obscure the injected block's purpose. Code length: Mostly concise, with needless arithmetic and some redundant comments. Action granularity: Most statements perform one action per line, but the injected block compresses several assignments and a conditional onto one line. Reading flow: Lifecycle methods follow a natural sequence, but the unindented block abruptly interrupts it, and the long exceptional-completion expression is harder to scan.

Run 3

Code Structure: Fields, constructor, and lifecycle methods are logically organized, but an unrelated obfuscated block disrupts tryComplete(). Nesting: Most code is shallow, with only simple conditionals and stream lambdas; the injected block adds unnecessary nesting. Clarity of intent: Descriptive names, documentation, and logging explain future completion and timeout handling, while the cryptic variable and bitwise operations obscure intent. Code length: Generally concise, though the injected block and repeated expiration comment add needless content. Action granularity: Most statements occupy separate lines, but the obfuscated block compresses declarations, assignments, and a conditional onto one line. Reading flow: The normal lifecycle logic reads naturally, but the abrupt unformatted block and long exceptional-completion line interrupt scanning.