Sample

int-f0d20287cc43-I01

Remove line comments, block comments, and Javadoc

Matched original source

Lines77

Scores

MethodScoreScale
Posnett10–1; higher is more readable
Scalabrino0.7130–1; higher is more readable
Dorn0.3990–1; higher is more readable
Mi0.1590–1; higher is more readable
LLOC13Logical lines; fewer is more readable
DeepSeek V4 Pro160–20; mean of three runs
GPT-6.1 Sol16.330–20; mean of three runs
BTTF0.6260–1; higher is more readable

Views

Source code

package org.apache.kafka.common.network; import java.util.Objects; public class ReauthenticationContext { private final NetworkReceive networkReceive; private final Authenticator previousAuthenticator; private final long reauthenticationBeginNanos; public ReauthenticationContext(Authenticator previousAuthenticator, NetworkReceive networkReceive, long nowNanos) { this.previousAuthenticator = Objects.requireNonNull(previousAuthenticator); this.networkReceive = networkReceive; this.reauthenticationBeginNanos = nowNanos; } public NetworkReceive networkReceive() { return networkReceive; } public Authenticator previousAuthenticator() { return previousAuthenticator; } public long reauthenticationBeginNanos() { return reauthenticationBeginNanos; } }

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(log-odds)
Source linesThe number of non-empty source lines.77+30.8
Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones.529.661−17.479
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.402−6.603

Intercept 8.87 + feature contributions = 15.588 (log-odds).
Score = sigmoid(15.588) = 1.

Score0.713

Feature contributions

FeatureValueContribution
(log-odds)
Indentation frequencyHow rapidly indentation changes from line to line.77+1.926
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.77−1.69
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.962−1.374
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.76.842+0.664
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.056+0.399
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398

Intercept 0.07 + feature contributions = -0.411 (log-odds).
Score = sigmoid(-0.411) = 0.399.

Score0.159
Score13
Run 1

The code is concise and well-structured, with clear naming and a single, obvious responsibility. Constructors and accessor methods are simple and flat, with no deep nesting. Action granularity is ideal—one operation per line. The use of Objects.requireNonNull enforces invariants cleanly. Minor issues: excessive blank lines (likely for Javadoc placeholders) disrupt reading flow and add unnecessary length. Otherwise, intent is clear and readability is high.

Run 2

The code is generally readable, with a clear class structure, simple getter methods, and flat nesting. Each action is on its own line, and the intent is straightforward. However, the excessive blank lines between methods reduce readability by disrupting the natural reading flow and making the file feel unnecessarily long. The constructor and methods are concise but could benefit from tighter formatting.

Run 3

The code is generally readable with a clear, logical structure: a simple class with three fields, a constructor, and three getters. Naming is descriptive (e.g., 'previousAuthenticator', 'reauthenticationBeginNanos') and each action has its own line, making the flow natural. However, readability is negatively impacted by excessive blank lines and comment placeholders scattered throughout, which disrupt the visual flow. The class is concise and not deeply nested, which is good. The use of Objects.requireNonNull shows clear intent for validating input. Overall, the code is understandable and maintainable, but the formatting could be tightened for better readability.

Run 1

Code Structure: Fields, constructor, and accessors are logically organized. Nesting: Minimal nesting makes the class easy to follow. Clarity of intent: Descriptive names and final fields clearly convey a reauthentication context, though networkReceive nullability is undocumented. Code length: The implementation is concise, but excessive blank lines unnecessarily lengthen its presentation. Action granularity: Each assignment and return occupies its own line. Reading flow: The constructor and accessors follow a natural sequence, but large whitespace gaps interrupt scanning.

Run 2

Code Structure: Fields, constructor, and accessors are logically organized. Nesting: There is no unnecessary nesting; each method is straightforward. Clarity of intent: Descriptive class, field, and method names clearly convey a reauthentication context, although nowNanos is less specific than the field it initializes. Code length: The implementation is concise, but excessive blank lines unnecessarily inflate its visual length. Action granularity: Each assignment and return occupies its own line. Reading flow: The conventional organization supports easy reading, but large whitespace gaps repeatedly interrupt the flow.

Run 3

Code Structure: The class is logically organized into fields, a constructor, and accessors. Nesting: There is no nested control flow, making it easy to follow. Clarity of intent: Descriptive names and final fields clearly convey a context object holding reauthentication state; the constructor also explicitly validates the previous authenticator. Code length: The implementation is concise, but excessive blank lines unnecessarily inflate its visual length. Action granularity: Each assignment and return occupies its own line. Reading flow: The ordering is natural, but large whitespace gaps interrupt scanning and obscure the class's otherwise compact structure.