Sample

int-dca37f0a919e-SRC

Unmodified source class

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 Pro170–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 well-structured and highly readable. It follows a clear pattern of delegating operations to an underlying ByteBuf, with each public final method forwarding to a corresponding package-private '0' method. The naming convention (retain/retain0, touch/touch0) clearly separates the API from the implementation hook. Methods are short, focused, and have a single action per line. Nesting is minimal, and the overall flow is logical and consistent. Minor deductions: some duplicated code structure exists, but this is intentional due to final method semantics. Javadoc is sparse but sufficient for a deprecated abstract base class. Overall, this is easy to understand and maintain.

Run 2

The code is highly readable due to its clean, flat structure and clear intent. Each method delegates to the wrapped ByteBuf, with minimal nesting and consistent naming conventions. The use of final modifiers and the @Deprecated annotation adds clarity. Methods are concise, one action per line, and follow a natural reading flow. The separation between public final methods and internal (0-suffixed) methods is logical, though slightly repetitive, which is typical for delegating wrappers. Overall, the code is easy to understand and maintain.

Run 3

The code is well-structured, with clear separation of public final methods and internal overridable methods (e.g., isAccessible/isAccessible0). Nesting is minimal, and each method performs a single, clear action, contributing to strong action granularity. The intent—wrapping another ByteBuf and delegating reference counting, accessibility, and buffer operations—is explicit. The use of @Deprecated and Javadoc adds clarity. Code length is appropriate; though repetitive, the repetition is intentional and serves a clear pattern. Reading flow is natural, with related methods grouped logically. Minor deductions: the naming convention with '0' suffixes is slightly opaque, and the abstract class structure could be better documented for future maintainers. Overall, highly readable but not perfect.

Run 1

Code Structure: Methods are logically organized, with related overloads and delegation helpers adjacent. Nesting: Entirely flat, with no nested control flow. Clarity of intent: The class documentation and descriptive method names clearly communicate a wrapper that delegates to an underlying buffer. However, the purpose of the final-method/helper split and the '0' suffix is not explained. Code length: Individual methods are concise, though repeated delegation wrappers add boilerplate and indirection. Action granularity: Each statement performs one action, and delegation and returning this are cleanly separated. Reading flow: Consistent formatting and predictable method patterns make the code easy to scan, with minor interruptions from helper-method hops.

Run 2

Code Structure: Methods are logically grouped around accessibility, reference counting, and buffer operations, with consistent delegation patterns. Nesting: No nested control flow; all methods are flat and easy to scan. Clarity of intent: The class documentation and unwrap() calls clearly communicate its wrapper role, although the purpose of the additional '0' helper methods is not explained. Code length: Individual methods are concise, but repeated forwarding layers add some verbosity. Action granularity: Each statement performs a single action, with mutation and return statements cleanly separated. Reading flow: Consistent formatting, signatures, and override annotations support a natural top-to-bottom reading experience; helper indirection introduces minor navigation overhead.

Run 3

Code Structure: Methods are logically organized, with related overloads and delegation helpers adjacent. Nesting: There are no nested control structures; every method is flat and easy to scan. Clarity of intent: Documentation and consistent delegation to unwrap() clearly convey the wrapper role, although the '0' helper suffix and the need for separate final entry points are not explained. Code length: Methods are concise, but repeated entry-point/helper pairs add boilerplate and indirection. Action granularity: Each statement performs one action, with mutation and return statements cleanly separated. Reading flow: Consistent formatting and predictable patterns make reading natural, though following calls through helpers adds minor friction.