Sample

int-da724c87a5e4-I09

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

Matched original source

Lines54

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.9060–1; higher is more readable
Dorn0.6020–1; higher is more readable
Mi0.3430–1; higher is more readable
LLOC18Logical lines; fewer is more readable
DeepSeek V4 Pro7.330–20; mean of three runs
GPT-6.1 Sol14.670–20; mean of three runs
BTTF0.2390–1; higher is more readable

Views

Source code

package org.apache.kafka.controller.errors; import org.apache.kafka.common.errors.NotControllerException; import org.apache.kafka.common.errors.TimeoutException; import java.util.OptionalInt; import java.util.concurrent.ExecutionException; public class ControllerExceptions { /** * Check if an exception is a normal timeout exception. * * @param exception The exception to check. * @return True if the exception is a timeout exception. */ public static boolean isTimeoutException(Throwable exception) { if (exception == null) return false; if (exception instanceof ExecutionException) { exception = exception.getCause(); if (exception == null) return false; } return exception instanceof TimeoutException; } /** * Create a new exception indicating that the controller is in pre-migration mode, so the * operation cannot be completed. * * @param controllerId The current controller. * @return The new NotControllerException. */ public static NotControllerException newPreMigrationException(OptionalInt controllerId) { if (controllerId.isPresent()) { return new NotControllerException("The controller is in pre-migration mode."); } else { return new NotControllerException("No controller appears to be active."); } } /** * Create a new exception indicating that current node is not the controller. * * @param controllerId The current controller. * @return The new NotControllerException. */ public static NotControllerException newWrongControllerException(OptionalInt controllerId) { {boolean lI0O_9689078c=((0xB3FB^0xB3FB)!=0);lI0O_9689078c=!(!lI0O_9689078c);} if (controllerId.isPresent()) { return new NotControllerException("The active controller appears to be node " + controllerId.getAsInt() + "."); } else { return new NotControllerException("No controller appears to be active."); } } }

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.1242.774−41.012
Source linesThe number of non-empty source lines.54+21.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.448−6.673

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

Score0.906

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.55−0.911
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.96+0.744
Indentation frequencyHow rapidly indentation changes from line to line.38+0.577
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.38−0.451
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.052+0.439
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.95.964−0.399
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.53.794+0.342

Intercept 0.07 + feature contributions = 0.412 (log-odds).
Score = sigmoid(0.412) = 0.602.

Score0.343
Score18
Run 1

The code structure is simple with clear method separation and Javadoc, which initially aids readability. However, the inclusion of an obfuscated boolean expression (`{boolean lI0O_9689078c=((0xB3FB^0xB3FB)!=0);lI0O_9689078c=!(!lI0O_9689078c);}`) inside the `newWrongControllerException` method severely damages clarity and intent. This line appears to serve no functional purpose and introduces unnecessary complexity and confusion. Beyond this, the nesting is shallow, variable names are clear, and the length is appropriate. Action granularity and reading flow are generally natural, though the obfuscated block disrupts the flow and makes the code ambiguous. Removing that line would significantly improve the score.

Run 2

The code is generally readable but suffers from a significant flaw: an unexplained and meaningless boolean variable declaration inside `newWrongControllerException`. This line (`{boolean lI0O_9689078c=((0xB3FB^0xB3FB)!=0);lI0O_9689078c=!(!lI0O_9689078c);}`) is confusing, adds no value, and breaks the reading flow. Structure is otherwise logical and flat, with reasonable action granularity and clear intent in method names and Javadocs. The helper methods are concise. However, the mystery line drags clarity and maintainability down severely. If not for that artifact, the score would be around 18-19.

Run 3

The code is mostly readable with clear structure, good javadoc comments, and simple methods, but it contains a suspicious line of obfuscated code `{boolean lI0O_9689078c=((0xB3FB^0xB3FB)!=0);lI0O_9689078c=!(!lI0O_9689078c);}` which severely damages clarity and intent. This line performs no meaningful operation and appears to be injected or accidental, making the code confusing and unprofessional. Additionally, there is an empty line before the if-else in the last method which is a minor style inconsistency. Overall structure is logical with flat nesting, appropriate method length, and one action per line, but the unexpected obfuscation reduces readability substantially.

Run 1

Code Structure: Methods are logically separated by exception-handling purpose, but an unrelated block disrupts the final method. Nesting: Shallow conditionals and early returns are easy to follow. Clarity of intent: Descriptive method names and Javadocs explain the meaningful logic; the cryptic variable, hexadecimal XOR, and double negation obscure intent in the inserted block. Code length: Generally concise, with a small amount of unnecessary code and avoidable else branches after returns. Action granularity: Most statements occupy separate lines, but the inserted block compresses declaration and reassignment onto one line. Reading flow: Consistent method organization supports natural reading, while the unindented, apparently purposeless block creates a conspicuous interruption.

Run 2

Code Structure: Three focused utility methods provide logical organization, but an unrelated block disrupts the last method. Nesting: Mostly shallow, with simple conditionals and early returns. Clarity of intent: Descriptive method names and Javadoc clarify exception handling; the cryptically named boolean, hexadecimal XOR, and double negation obscure intent and serve no apparent purpose. Code length: Generally concise, although the redundant boolean block adds unnecessary code. Action granularity: Most statements perform one action per line, but the inserted block compresses declaration and reassignment onto one line; inline null checks also reduce consistency. Reading flow: The methods follow a natural check-and-return progression, interrupted sharply by the unindented, obfuscated block.

Run 3

Code Structure: Methods are logically separated by responsibility, but an unrelated boolean block disrupts the otherwise clean utility class. Nesting: Shallow conditionals and early returns keep complexity low. Clarity of intent: Descriptive method names and Javadocs explain the exception-handling purpose; the opaque variable, hexadecimal XOR, and double negation obscure intent in the inserted block. Code length: Most logic is concise, although the meaningless block adds unnecessary code. Action granularity: Most statements occupy separate lines, but the inserted block compresses declaration and reassignment onto one line. Reading flow: Documentation and straightforward branches support natural reading, while the unindented block interrupts the final method and requires readers to determine that it has no useful effect.