Sample

int-03aea9efa7c0-I06

Invert eligible conditions and exchange their branches

Matched original source

Lines29

Scores

MethodScoreScale
Posnett0.9990–1; higher is more readable
Scalabrino0.7910–1; higher is more readable
Dorn0.7950–1; higher is more readable
Mi0.2960–1; higher is more readable
LLOC2Logical lines; fewer is more readable
DeepSeek V4 Pro17.670–20; mean of three runs
GPT-6.1 Sol190–20; mean of three runs
BTTF0.7760–1; higher is more readable

Views

Source code

package io.netty.util.internal; /** * Provides methods for {@link DefaultPriorityQueue} to maintain internal state. These methods should generally not be * used outside the scope of {@link DefaultPriorityQueue}. */ public interface PriorityQueueNode { /** * This should be used to initialize the storage returned by {@link #priorityQueueIndex(DefaultPriorityQueue)}. */ int INDEX_NOT_IN_QUEUE = -1; /** * Get the last value set by {@link #priorityQueueIndex(DefaultPriorityQueue, int)} for the value corresponding to * {@code queue}. * <p> * Throwing exceptions from this method will result in undefined behavior. */ int priorityQueueIndex(DefaultPriorityQueue<?> queue); /** * Used by {@link DefaultPriorityQueue} to maintain state for an element in the queue. * <p> * Throwing exceptions from this method will result in undefined behavior. * @param queue The queue for which the index is being set. * @param i The index as used by {@link DefaultPriorityQueue}. */ void priorityQueueIndex(DefaultPriorityQueue<?> queue, int i); }

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(log-odds)
Source linesThe number of non-empty source lines.29+11.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.655−6.983
Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones.206.716−6.822

Intercept 8.87 + feature contributions = 6.666 (log-odds).
Score = sigmoid(6.666) = 0.999.

Score0.791

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.117.967−1.331
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.114.167+1.038
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.1+1.001
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.02+0.75
Indentation frequencyHow rapidly indentation changes from line to line.13−0.287
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.13+0.123
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.28.773−0.008

Intercept 0.07 + feature contributions = 1.354 (log-odds).
Score = sigmoid(1.354) = 0.795.

Score0.296
Score2
Run 1

The code is highly readable with clear structure and intent. It defines a small interface with two overloaded methods and a constant, logically organized with Javadoc explaining purpose and constraints. Nesting is nonexistent, and the flat structure aids comprehension. Clarity of intent is strong: method names and documentation clearly describe their roles in maintaining queue state. Code length is concise—no unnecessary complexity or verbosity. Action granularity follows interface conventions, with each method declaration on separate lines. Reading flow is natural: constant declaration, getter, setter. Minor deductions for relying on Javadoc to explain 'undefined behavior' rather than encoding constraints in the type system, and for the slightly ambiguous wording in the first method's documentation.

Run 2

The code is a small, well-structured interface with clear Javadoc. Each method and field is documented, and the naming is descriptive. Nesting is nonexistent, and the code is concise. There is some minor verbosity in the Javadoc, but it adds clarity rather than detracting from readability. The only thing preventing a perfect score is the slight ambiguity in the Javadoc warnings about 'undefined behavior' without specifying the consequences more concretely.

Run 3

This code is highly readable. The interface is logically structured with a clear purpose, grouping a constant and two related method declarations. Nesting is minimal—just a package declaration and an interface with members. Naming is descriptive, and Javadoc comments clarify intent, constraints, and usage. The code is concise, avoiding unnecessary verbosity. Each declaration is on its own line, enhancing action granularity. Reading flow is natural: package, import-like documentation, constant, and then method declarations in a logical order. Minor room for improvement could include slightly more explicit mention of thread-safety or internal usage, but overall it is clear and maintainable.

Run 1

Code Structure: The interface is logically organized, with a sentinel constant followed by index getter and setter methods. Nesting: There is no nested control flow, making it easy to scan. Clarity of intent: The interface name, method signatures, and Javadoc clearly explain its role in maintaining queue-node state; however, the setter parameter name 'i' is less descriptive than 'index'. Code length: The interface is concise, and its documentation adds useful contract information without excessive detail. Action granularity: Each declaration occupies its own line, with no combined operations. Reading flow: The progression from initialization constant to retrieval and update methods is natural, although using the same name for getter and setter slightly reduces immediate distinction.

Run 2

Code Structure: The interface logically groups a sentinel constant and two related index access methods. Nesting: Completely flat, with no control flow or nested declarations. Clarity of intent: Descriptive names and Javadoc clearly explain queue-specific state management and usage constraints; the setter parameter 'i' is less descriptive than 'index'. Code length: Concise, with documentation proportionate to the API's responsibilities. Action granularity: Each declaration occupies its own line and expresses one responsibility. Reading flow: The progression from interface purpose to initialization constant, getter, and setter is natural. Minor wording awkwardness in the getter documentation slightly reduces readability.

Run 3

Code Structure: A small, logically organized interface groups its sentinel constant and related getter/setter methods. Nesting: No nested control flow or implementation blocks complicate reading. Clarity of intent: Javadoc clearly explains queue-specific index tracking, initialization, and exception constraints; the setter parameter name 'i' is less descriptive than 'index'. Code length: Concise declarations with proportionate documentation, though some wording is slightly repetitive. Action granularity: Each declaration occupies its own line, with no combined operations. Reading flow: The interface description, initialization constant, getter, and setter form a natural progression. Overall, the code is highly readable with only minor naming and documentation improvements possible.