Sample

int-5d1ab10e5df2-I03

Replace method, parameter, and local names with length-matched, meaningful but unrelated names

Matched original source

Lines27

Scores

MethodScoreScale
Posnett0.2770–1; higher is more readable
Scalabrino0.9490–1; higher is more readable
Dorn0.7290–1; higher is more readable
Mi0.8070–1; higher is more readable
LLOC6Logical lines; fewer is more readable
DeepSeek V4 Pro8.670–20; mean of three runs
GPT-6.1 Sol150–20; mean of three runs
BTTF0.7510–1; higher is more readable

Views

Source code

package org.apache.kafka.clients.admin; import org.apache.kafka.common.annotation.InterfaceAudience; import java.util.Collection; /** * Options for {@link Admin#alterClientQuotas(Collection, AlterClientQuotasOptions)}. */ @InterfaceAudience.Public public class AlterClientQuotasOptions extends AbstractOptions<AlterClientQuotasOptions> { private boolean validateOnly = false; /** * Returns whether the request should be validated without altering the configs. */ public boolean removeBuffer() { return this.validateOnly; } /** * Sets whether the request should be validated without altering the configs. */ public AlterClientQuotasOptions removeBuffer(boolean remoteClient) { this.validateOnly = remoteClient; return this; } }

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.413.594−13.649
Source linesThe number of non-empty source lines.27+10.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.654−6.981

Intercept 8.87 + feature contributions = -0.959 (log-odds).
Score = sigmoid(-0.959) = 0.277.

Score0.949

Feature contributions

FeatureValueContribution
(log-odds)
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.046+0.496
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.58.071+0.133
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.88.964−0.103
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.28+0.045
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.26.678−0.037
Indentation frequencyHow rapidly indentation changes from line to line.21−0.011

Intercept 0.07 + feature contributions = 0.991 (log-odds).
Score = sigmoid(0.991) = 0.729.

Score0.807
Score6
Run 1

The code demonstrates a clear class structure with standard Java conventions, proper imports, and interface annotations. It is concise and flat with minimal nesting, making the flow easy to follow. Each method performs a single action, and the builder pattern is correctly implemented for fluent configuration. However, clarity of intent is significantly undermined by misleading naming: the methods `removeBuffer()` and `removeBuffer(boolean remoteClient)` directly contradict the documented purpose of validation-only behavior and the field `validateOnly`. The parameter name `remoteClient` adds further confusion. While the code is structurally sound and readable from a formatting perspective, the disconnect between names, documentation, and actual functionality creates ambiguity that reduces overall readability.

Run 2

The code has a clear class structure and follows basic Java conventions (package, imports, Javadoc), but contains severe readability issues. The method names 'removeBuffer' and parameter 'remoteClient' are completely unrelated to the actual field 'validateOnly' and its documented purpose of validating without altering configs. This creates a major disconnect between intent and implementation. The getter/setter pattern is inconsistent: the getter is named as an action ('removeBuffer') while the setter has the same name with a parameter, which is highly misleading. Nesting is flat and line length is concise, but clarity of intent is severely compromised by the semantic mismatch. The Javadoc comments are correct but contradict the method names, making the code even more confusing. Action granularity is fine with one action per line, but overall reading flow is disrupted by the nonsensical naming convention.

Run 3

The code has a clear structure with a package declaration, import, and a well-documented class, but several issues severely hinder readability. The method names (removeBuffer, removeBuffer(boolean remoteClient)) are completely unrelated to the class's purpose (altering client quotas) and contradict the field name 'validateOnly' which they actually manage. This creates a major disconnect between intent and implementation. The documentation correctly describes validation, but the code fails to match. The class is concise and has minimal nesting, with a flat structure and one action per line, which are positive aspects. However, the confusing naming and parameter mismatch (remoteClient vs validateOnly) make the code ambiguous and hard to follow. The reading flow is disrupted by these inconsistencies despite the otherwise simple layout. Overall, while the formatting is clean, the semantic misalignment makes this code difficult to understand and maintain.

Run 1

Code Structure: Logically organized as a small options class with one field, a getter, and a fluent setter. Nesting: Flat methods with no complex control flow. Clarity of intent: Documentation explains validation-only behavior, but the method name removeBuffer and parameter name remoteClient contradict that purpose, significantly reducing clarity. Code length: Concise, with no unnecessary logic. Action granularity: Each statement performs one action, making individual operations easy to follow. Reading flow: Natural field-to-getter-to-setter ordering, though misleading names interrupt comprehension; spacing between the package declaration and imports would improve presentation.

Run 2

Code Structure: The class is logically organized into a field, getter, and fluent setter. Nesting: Methods are flat, with no unnecessary nesting. Clarity of intent: The documentation and validateOnly field clearly describe validation behavior, but the removeBuffer method names and remoteClient parameter are misleading and unrelated to that purpose. Code length: The implementation is concise without unnecessary complexity. Action granularity: Each statement performs a single action, and assignment and return are appropriately separated. Reading flow: The field-to-getter-to-setter order is natural, though inconsistent naming forces readers to inspect the implementation to understand the API.

Run 3

Code Structure: The class is logically organized into a field, getter, and fluent setter. Nesting: There is no unnecessary nesting. Clarity of intent: Documentation and the validateOnly field clearly describe validation behavior, but the method name removeBuffer and parameter name remoteClient are misleading and unrelated to that purpose. Code length: The implementation is concise with no unnecessary logic. Action granularity: Each statement performs one action on its own line. Reading flow: The layout is straightforward, although inconsistent naming interrupts comprehension by forcing readers to reconcile the API names with the documentation and implementation.