Sample

int-2f7db9da14db-I06

Invert eligible conditions and exchange their branches

Matched original source

Lines112

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.8910–1; higher is more readable
Dorn0.840–1; higher is more readable
Mi0.8680–1; higher is more readable
LLOC45Logical lines; fewer is more readable
DeepSeek V4 Pro17.330–20; mean of three runs
GPT-6.1 Sol180–20; mean of three runs
BTTF0.6550–1; higher is more readable

Views

Source code

package io.netty.buffer; import java.nio.ByteBuffer; /** * Abstract base class for {@link ByteBuf} implementations that wrap another * {@link ByteBuf}. * * @deprecated Do not use. */ @Deprecated public abstract class AbstractDerivedByteBuf extends AbstractByteBuf { protected AbstractDerivedByteBuf(int maxCapacity) { super(maxCapacity); } @Override final boolean isAccessible() { return isAccessible0(); } boolean isAccessible0() { return unwrap().isAccessible(); } @Override public final int refCnt() { return refCnt0(); } int refCnt0() { return unwrap().refCnt(); } @Override public final ByteBuf retain() { return retain0(); } ByteBuf retain0() { unwrap().retain(); return this; } @Override public final ByteBuf retain(int increment) { return retain0(increment); } ByteBuf retain0(int increment) { unwrap().retain(increment); return this; } @Override public final ByteBuf touch() { return touch0(); } ByteBuf touch0() { unwrap().touch(); return this; } @Override public final ByteBuf touch(Object hint) { return touch0(hint); } ByteBuf touch0(Object hint) { unwrap().touch(hint); return this; } @Override public final boolean release() { return release0(); } boolean release0() { return unwrap().release(); } @Override public final boolean release(int decrement) { return release0(decrement); } boolean release0(int decrement) { return unwrap().release(decrement); } @Override public boolean isReadOnly() { return unwrap().isReadOnly(); } @Override public ByteBuffer internalNioBuffer(int index, int length) { return nioBuffer(index, length); } @Override public ByteBuffer nioBuffer(int index, int length) { return unwrap().nioBuffer(index, length); } @Override public boolean isContiguous() { return unwrap().isContiguous(); } }

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.2136.514−70.505
Source linesThe number of non-empty source lines.112+44.8
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.366−6.55

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

Score0.891

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.113−2.965
Indentation frequencyHow rapidly indentation changes from line to line.88+2.307
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.111.675+1.151
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.75.982+0.447
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.67.956+0.292
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.101−0.039

Intercept 0.07 + feature contributions = 1.661 (log-odds).
Score = sigmoid(1.661) = 0.84.

Score0.868
Score45
Run 1

The code is highly readable. Structure is clear and logical: an abstract class with well-separated, grouped overrides. Nesting is flat, with only a minor two-level pattern in methods that delegate and return 'this'. Intent is explicit—the class wraps another ByteBuf and delegates reference counting, touch, and buffer operations, with naming like 'refCnt0' and 'isAccessible0' indicating internal hooks. Code length is concise; methods are short and avoid redundancy since public final methods delegate to protected/package-private templates. Action granularity is mostly one action per line, though some single-expression bodies avoid unnecessary blocks. Reading flow is natural, grouping related methods (accessibility, ref-counting, buffer metadata) and maintaining consistent delegation patterns. Minor improvements could include reducing redundant delegate methods or clarifying the deprecated nature, but overall it is highly readable.

Run 2

The code is highly readable. It has a clear, logical structure as an abstract wrapper for ByteBuf, with methods organized around reference-counting and buffer operations. Nesting is minimal (one level), and each action is on its own line, improving clarity. Delegation through unwrap() is consistent and unambiguous, making intent clear. The code is concise with no unnecessary length. The pattern of final public methods delegating to overridable `*0()` methods is straightforward and aids reading flow. Although some methods may seem repetitive, they follow a consistent template that enhances comprehension.

Run 3

The code is highly readable due to its clear structure, flat nesting, and consistent delegation pattern. Each public method delegates to a corresponding package-private `0`-suffixed method, which then calls `unwrap()` and returns `this` or the delegate's result, making intent obvious. The class is focused, with one action per line and minimal complexity. The use of `final` on public methods and the deprecated annotation are appropriate. Although the delegation adds some boilerplate, it is necessary for overriding flexibility and remains concise. The natural grouping of lifecycle methods (refCnt, retain, touch, release) followed by buffer property methods follows a logical reading flow. Minor deductions stem from the slightly repetitive method pairs, which could be seen as unnecessarily long, but they enhance clarity and maintainability. Overall, this code is very maintainable and clear.

Run 1

Code Structure: Methods are logically grouped, with consistent delegation patterns and adjacent overloads. Nesting: There is no nested control flow; all methods are flat and easy to scan. Clarity of intent: The class documentation and descriptive public method names clearly convey its wrapper role, though the rationale for intermediate methods with a '0' suffix is unexplained. Code length: Individual methods are concise, but repeated forwarding layers add boilerplate and slightly increase reading effort. Action granularity: Each statement performs one action, with delegation and returning this clearly separated. Reading flow: Consistent formatting, annotations, and method ordering support natural reading, although tracing public methods through helper methods to unwrap() adds minor indirection.

Run 2

Code Structure: Logically organized as a wrapper base class, with related overloads and delegation helpers grouped together. Nesting: Flat methods with no nested control flow make scanning easy. Clarity of intent: Class documentation, standard method names, and consistent unwrap() delegation clearly communicate purpose; the rationale for the extra methods suffixed with 0 is not explained. Code length: Methods are concise, although repeated forwarding layers increase overall length. Action granularity: Each statement performs one clear action, with delegation and returning this separated appropriately. Reading flow: Consistent formatting and predictable method patterns create a natural flow, slightly interrupted by repetitive public-method-to-helper indirection.

Run 3

Code Structure: Logically organized into small methods, with related overloads and delegation helpers adjacent. Nesting: Completely flat, with no nested control flow. Clarity of intent: The class documentation and consistent unwrap() calls clearly communicate its wrapper role; however, helper names ending in 0 and the rationale for the extra delegation layer are not explained. Code length: Methods are concise, though repetitive forwarding methods add length and indirection. Action granularity: Each statement performs one action, and mutation followed by returning this is clearly separated. Reading flow: Consistent formatting, annotations, and predictable method patterns make the code easy to scan, with minor interruptions from switching between public entry points and package-private helpers.