Sample

int-10ffd69ccc4e-I12

Inline all eligible single-use intermediate local variables

Matched original source

Lines27

Scores

MethodScoreScale
Posnett0.3260–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 Pro180–20; mean of three runs
GPT-6.1 Sol190–20; mean of three runs
BTTF0.8920–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 validateOnly() { return this.validateOnly; } /** * Sets whether the request should be validated without altering the configs. */ public AlterClientQuotasOptions validateOnly(boolean validateOnly) { this.validateOnly = validateOnly; 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.406.997−13.431
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.645−6.967

Intercept 8.87 + feature contributions = -0.728 (log-odds).
Score = sigmoid(-0.728) = 0.326.

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 is well-structured and highly readable. It follows a clear class definition pattern with a single private field, a getter-like method, and a fluent setter. The nesting is flat, with no conditional or loop structures. Intent is explicit through descriptive method names and Javadoc comments. The code is concise, containing only essential logic without redundancy. Each method performs one clear action. The reading flow is natural, moving from field declaration to accessor to mutator. Minor deductions relate to the lack of null checks or validation (though not required for a boolean) and the absence of additional documentation for edge cases, but overall this is exemplary, idiomatic Java code.

Run 2

The code is highly readable. It has a clear, logical structure with a single class definition, well-organized imports, and proper Javadoc comments explaining the class and its methods. Nesting is minimal—essentially flat—with no conditionals or deep blocks. Intent is unambiguous: the class provides options for quota alteration, specifically a 'validateOnly' flag. Code length is concise and appropriate for the functionality. Each method performs one action: reading or setting the flag, with the setter returning 'this' for fluent chaining. Reading flow is natural, moving from class declaration to field, then getter, then setter. The naming is consistent and self-documenting, following Java conventions. Minor deductions could be for the slightly redundant Javadoc on trivial getter/setter, but overall this is exemplary code.

Run 3

The code is a clean, well-structured Java class extending a base options class. It follows standard conventions with a single private field, a getter-like method (validateOnly()), and a fluent setter that returns 'this'. The class is flat with no nesting, and each method performs a single clear action. Javadoc comments explain intent for both methods and the class itself. The import statements are minimal and relevant. The fluent setter pattern is idiomatic for Kafka options classes, enhancing readability and usability. Minor deductions: the class is very small and simple, so the high score reflects clarity rather than complexity handled well. Overall, it is concise, unambiguous, and easy to follow for any Java developer.

Run 1

Code Structure: A logically organized options class with one field, a getter, and a fluent setter. Nesting: Minimal, with no conditional or loop nesting. Clarity of intent: Descriptive names and Javadoc clearly explain validation-only behavior; however, referring to 'configs' rather than client quotas is slightly imprecise. Code length: Short and focused, with no unnecessary logic. Action granularity: Each statement performs one action on its own line. Reading flow: Natural progression from class documentation to state, getter, and setter; additional spacing around the package and imports would slightly improve visual separation.

Run 2

Code Structure: A logically organized options class with one field and clearly separated getter and fluent setter. Nesting: Flat, with no conditional or loop nesting. Clarity of intent: Descriptive names and Javadoc clearly explain validation-only behavior, though 'configs' is less precise than 'client quotas.' Code length: Concise, with minimal boilerplate; explicit initialization to false is redundant but readable. Action granularity: Each statement performs one action on its own line. Reading flow: Natural progression from class documentation to state, getter, and setter. Minor import-spacing and documentation precision issues prevent a perfect score.

Run 3

Code Structure: The class logically groups a single option with its getter and fluent setter. Nesting: Methods are flat, with no nested control flow. Clarity of intent: Descriptive names and Javadoc clearly explain validation-only behavior, though 'configs' is less precise than 'client quotas.' Code length: The implementation is concise and contains no unnecessary logic. Action granularity: Each statement performs one action on its own line. Reading flow: The field-to-getter-to-setter ordering is natural and easy to follow; additional spacing around the package and import sections would slightly improve presentation.