Sample

int-1c92b3032720-I05

Rewrite eligible decimal integer literals in hexadecimal notation

Matched original source

Lines61

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.80–1; higher is more readable
Dorn0.750–1; higher is more readable
Mi0.0440–1; higher is more readable
LLOC26Logical lines; fewer is more readable
DeepSeek V4 Pro160–20; mean of three runs
GPT-6.1 Sol180–20; mean of three runs
BTTF0.670–1; higher is more readable

Views

Source code

package io.netty.channel.uring; final class RingBuffer { private final SubmissionQueue ioUringSubmissionQueue; private final CompletionQueue ioUringCompletionQueue; private final int features; private boolean closed; RingBuffer(SubmissionQueue ioUringSubmissionQueue, CompletionQueue ioUringCompletionQueue, int features) { this.ioUringSubmissionQueue = ioUringSubmissionQueue; this.ioUringCompletionQueue = ioUringCompletionQueue; this.features = features; } /** * Enable ring. This method must be called from the same method that will call {@link SubmissionQueue#submit()} and * {@link SubmissionQueue#submitAndWait()}. */ void enable() { // We create our ring in disabled mode and so need to enable it first. Native.ioUringRegisterEnableRings(fd()); // Now also register the ring filedescriptor itself. This needs to happen in the same thread // that will also call the io_uring_enter(...) ioUringSubmissionQueue.tryRegisterRingFd(); } int fd() { return ioUringCompletionQueue.ringFd; } int features() { return features; } SubmissionQueue ioUringSubmissionQueue() { return this.ioUringSubmissionQueue; } CompletionQueue ioUringCompletionQueue() { return this.ioUringCompletionQueue; } void close() { if (closed) { return; } closed = true; ioUringSubmissionQueue.close(); ioUringCompletionQueue.close(); Native.ioUringExit( ioUringSubmissionQueue.submissionQueueArrayAddress(), ioUringSubmissionQueue.ringEntries, ioUringSubmissionQueue.ringAddress, ioUringSubmissionQueue.ringSize, ioUringCompletionQueue.ringAddress, ioUringCompletionQueue.ringSize, ioUringSubmissionQueue.ringFd, ioUringSubmissionQueue.enterRingFd); } }

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.1063.548−35.097
Source linesThe number of non-empty source lines.61+24.4
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.357−6.535

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

Score0.8

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.118.968−1.374
Indentation frequencyHow rapidly indentation changes from line to line.55+1.165
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.62−1.159
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.119+1.116
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.60.9+0.441
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.052+0.439
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398

Intercept 0.07 + feature contributions = 1.096 (log-odds).
Score = sigmoid(1.096) = 0.75.

Score0.044
Score26
Run 1

The code is generally well-organized with clear method separation and consistent naming. The class structure is logical, grouping related io_uring functionality. Nesting is minimal with only one early return in close(). Intent is mostly clear, though the relationship between submission/completion queues and feature flags could benefit from more documentation. Code length is reasonable - methods are concise and focused. Action granularity is good, with one main operation per line in most cases. Reading flow is natural with methods ordered logically (construction, enable, accessors, close). Minor issues include the constructor not validating parameters, slightly verbose variable names (ioUringSubmissionQueue repeated throughout), and the close() method's multi-line Native.ioUringExit call which reduces readability. The enable() method's comments are helpful but could be more explanatory. Overall, solid code that would be understandable to developers familiar with io_uring.

Run 2

The code is generally well-structured and readable. It follows a clear class structure with logical method grouping and consistent naming. Nesting is minimal, with only one level in the close() method. The purpose of each method is evident from its name, and the code is concise without unnecessary verbosity. Action granularity is appropriate—most lines perform a single logical operation. The reading flow is natural, moving from construction to enabling, accessors, and finally cleanup. Minor deductions: the enable() method mixes two distinct concerns (enabling rings and registering the fd), and the close() method contains a long, multi-argument native call that reduces readability. Some field names are quite long (e.g., ioUringSubmissionQueue), but they are descriptive. Overall, the code is clear and maintainable.

Run 3

The code is well-structured and readable. The class has a clear single responsibility: managing the lifecycle of io_uring queues. Each method is concise and performs one logical action. The method names clearly indicate intent (enable, close, fd, features). The close() method has a single early return for idempotency, which avoids deep nesting. Field names are descriptive, though slightly verbose. The Javadoc on enable() adds helpful context about thread affinity. Minor deductions: variable names like ioUringSubmissionQueue are long and repeated, which slightly reduces scanability; the constructor has no validation or defensive checks, and there is no explicit documentation for the class itself. Overall, the code follows clean structure, flat nesting, and natural reading flow.

Run 1

Code Structure: Fields, constructor, initialization, accessors, and cleanup are logically organized in a focused class. Nesting: Minimal nesting; close() uses an early return to keep cleanup flat. Clarity of intent: Descriptive names and comments explain ring initialization and resource ownership, although the enable() documentation says 'same method' while the implementation comment says 'same thread', creating ambiguity. Code length: Concise, with little unnecessary code; verbose queue names slightly increase visual noise. Action granularity: Each statement performs one clear action, and the long native call places each argument on a separate line. Reading flow: Initialization and cleanup proceed naturally, but the eight-argument ioUringExit() call requires careful tracking of similar queue fields.

Run 2

Code Structure: Fields, constructor, lifecycle methods, and accessors are logically organized with clear responsibilities. Nesting: Minimal nesting; close() uses an early return to keep cleanup flat. Clarity of intent: Descriptive names and comments explain initialization and cleanup, although fd() and the positional arguments to ioUringExit require domain knowledge. The enable() documentation says 'same method' while its comment says 'same thread,' introducing slight ambiguity. Code length: Compact and appropriate, with little unnecessary code. Action granularity: Each statement performs one action, and the long native call is formatted with one argument per line. Reading flow: Execution proceeds naturally through enabling and closing resources; the lengthy native cleanup argument list slightly slows comprehension.

Run 3

Code Structure: Fields, constructor, initialization, accessors, and cleanup are logically organized into focused methods. Nesting: Minimal nesting; close() uses an early return to keep cleanup flat. Clarity of intent: Descriptive names and comments explain ring initialization and lifecycle, although fd() is abbreviated and the enable() documentation says 'same method' where the implementation comment specifies 'same thread.' Code length: Concise overall, with some verbose queue names and straightforward accessor boilerplate. Action granularity: Each statement performs one clear action; the multiline native call keeps its arguments individually visible. Reading flow: Natural progression from construction through operation to cleanup. The main readability limitation is the long, positional Native.ioUringExit argument list, which requires external knowledge to interpret confidently.