Sample

int-646839318cfa-SRC

Unmodified source class

Lines31

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.7520–1; higher is more readable
Dorn0.2210–1; higher is more readable
Mi0.1080–1; higher is more readable
LLOC11Logical lines; fewer is more readable
DeepSeek V4 Pro18.330–20; mean of three runs
GPT-6.1 Sol190–20; mean of three runs
BTTF0.6090–1; higher is more readable

Views

Source code

package org.apache.kafka.clients.consumer.internals.events; import org.apache.kafka.common.IsolationLevel; import org.apache.kafka.common.TopicPartition; import java.util.Objects; import java.util.OptionalLong; public class CurrentLagEvent extends CompletableApplicationEvent<OptionalLong> { private final TopicPartition partition; private final IsolationLevel isolationLevel; public CurrentLagEvent(final TopicPartition partition, final IsolationLevel isolationLevel, final long deadlineMs) { super(Type.CURRENT_LAG, deadlineMs); this.partition = Objects.requireNonNull(partition); this.isolationLevel = Objects.requireNonNull(isolationLevel); } public TopicPartition partition() { return partition; } public IsolationLevel isolationLevel() { return isolationLevel; } @Override public String toStringBase() { return super.toStringBase() + ", partition=" + partition + ", isolationLevel=" + isolationLevel; } }

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.909.583−30.016
Source linesThe number of non-empty source lines.31+12.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.68−7.02

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

Score0.752

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.119.969−1.416
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
Indentation frequencyHow rapidly indentation changes from line to line.31+0.335
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.077+0.197
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.31−0.061
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.30.769+0.02

Intercept 0.07 + feature contributions = -1.261 (log-odds).
Score = sigmoid(-1.261) = 0.221.

Score0.108
Score11
Run 1

The code is highly readable. It follows a clear, logical structure with a single-purpose class that extends a base event. The constructor uses null-checking with Objects.requireNonNull for validation, improving robustness. There is minimal nesting, and the flow is straightforward: field declarations, constructor, getters, and a toString override. Naming is clear and descriptive (e.g., partition, isolationLevel). Code length is concise and proportional to the class's purpose. Each action occupies its own line, aiding readability. The toStringBase method follows a consistent pattern. The only minor drawback is the lack of a class-level Javadoc, which would clarify purpose for future maintainers.

Run 2

This is a clean, well-structured immutable event class. It has a clear purpose: representing a request for the current lag of a partition at a given isolation level. The constructor validates non-null arguments using Objects.requireNonNull, and fields are declared final. Action granularity is good—each line performs one action. There is minimal nesting (only the class and constructor). The code is concise and does not repeat logic. Methods like partition() and isolationLevel() clearly communicate what they return. The toStringBase override is clear and readable. Minor deduction only because of missing Javadoc and slightly compact formatting, but overall it is highly readable.

Run 3

The code is highly readable. It has a clear structure: a single class with fields, a constructor, getters, and a toString method. Nesting is minimal. Intent is explicit from class and method names (e.g., CurrentLagEvent, partition, isolationLevel). The code is concise and avoids unnecessary length. Each logical action, such as field assignment and null checks, is on its own line. Reading flow is natural: fields declared first, then constructor, then accessors, then toString. The only minor deduction is that a short Javadoc on the class or methods could improve intent, but this is negligible.

Run 1

Code Structure: The class is logically organized into fields, constructor, accessors, and a string representation override. Nesting: Methods are flat, with no nested control flow. Clarity of intent: Descriptive class, field, and method names clearly communicate the event's purpose; constructor null checks make validation explicit. Code length: The implementation is concise, with no unnecessary logic or duplication. Action granularity: Each statement performs a single clear action. Reading flow: The conventional Java layout makes the code easy to follow. Minor formatting improvements, such as separating the package declaration from imports and wrapping the long constructor signature, would improve readability further.

Run 2

Code Structure: Fields, constructor, accessors, and string representation are logically organized. Nesting: Methods are flat, with no nested control flow. Clarity of intent: Descriptive class, field, and method names clearly convey a current-lag event; explicit null checks clarify required inputs. Code length: The class is concise, with no unnecessary logic or duplication. Action granularity: Each statement performs one clear action; the string concatenation is cohesive and easy to follow. Reading flow: The ordering is natural and formatting is consistent. Minor improvements include separating the package declaration from imports and wrapping the long constructor signature.

Run 3

Code Structure: Fields, constructor, accessors, and string representation are logically organized. Nesting: Methods are flat, with no nested control flow. Clarity of intent: Descriptive class, field, and method names clearly convey a current-lag event; constructor null checks make requirements explicit. Code length: The class is concise, with no unnecessary logic or duplication. Action granularity: Each statement performs one clear action, and constructor initialization is easy to follow. Reading flow: The conventional top-to-bottom organization supports natural reading. Minor formatting issues, including the lack of spacing between package and imports and relatively long constructor and return lines, slightly reduce readability.