Sample

int-54af90df9052-I10

Remove about 40% of line-break groups while retaining structure

Matched original source

Lines19

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.6590–1; higher is more readable
Dorn0.0090–1; higher is more readable
Mi0.0240–1; higher is more readable
LLOC11Logical lines; fewer is more readable
DeepSeek V4 Pro70–20; mean of three runs
GPT-6.1 Sol12.670–20; mean of three runs
BTTF0.4480–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.19+7.6
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.728−7.092

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

Score0.659

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.195.95−4.635
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
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.20+0.328
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.079+0.173
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.18.802−0.147
Indentation frequencyHow rapidly indentation changes from line to line.19−0.08

Intercept 0.07 + feature contributions = -4.697 (log-odds).
Score = sigmoid(-4.697) = 0.009.

Score0.024
Score11
Run 1

The code is a small class but suffers from poor readability due to formatting: multiple statements are packed on single lines, inconsistent spacing, and missing line breaks between methods and declarations. This makes the structure feel tangled and the reading flow disorganized. While the logic is simple and intent is relatively clear, the lack of consistent formatting, deep one-line nesting of constructor logic, and unclear separation of actions reduce readability. Concise but unnecessarily compact.

Run 2

The code suffers from severe readability issues due to improper formatting and multiple statements on single lines, making it appear tangled and difficult to parse. While the class structure is logically simple (a small event class with two fields and basic methods), the implementation is obscured by inconsistent line breaks, especially in the constructor and toStringBase method. Nesting is flat, which is positive, but the reading flow is disjointed and unnatural. Action granularity is poor—multiple actions are compressed onto single lines, violating the one-action-per-line principle. Intent is relatively clear from method and field names, but the formatting undermines clarity. Code length is appropriately concise for a simple value object, yet the lack of proper indentation and spacing makes even this short class feel unnecessarily cryptic and disorganized.

Run 3

The code is poorly formatted with multiple statements on single lines, inconsistent spacing, and misplaced braces, making it difficult to read. The class structure itself is simple and logical, but the formatting obscures the intent. Nesting is minimal, which is good, but action granularity is violated with multiple actions crammed onto one line. Clarity of intent is reduced due to the lack of visual separation between methods and fields. Code length is appropriate but the unnecessary brevity of formatting harms readability. Reading flow is disrupted as readers must mentally separate concatenated statements. Proper indentation, line breaks, and consistent spacing would improve the score significantly.

Run 1

Code Structure: Fields, constructor, accessors, and string representation are logically organized, but compressed declarations obscure their boundaries. Nesting: Minimal nesting makes the code easy to follow. Clarity of intent: Descriptive class, field, and method names clearly convey the event's purpose; null checks are explicit. Code length: Appropriately concise for a small event class, though excessive compression reduces readability. Action granularity: Multiple imports and constructor operations share lines, making individual actions harder to scan. Reading flow: Inconsistent whitespace and method boundaries placed on the same line interrupt an otherwise natural progression.

Run 2

Code Structure: The class has a logical arrangement of fields, constructor, accessors, and string representation, but compressed formatting obscures those boundaries. Nesting: Minimal nesting makes the code easy to understand. Clarity of intent: Descriptive class, field, and method names clearly convey the event's purpose; null checks are explicit. Code length: The implementation is appropriately short, though packing statements together sacrifices readability rather than reducing complexity. Action granularity: Multiple imports, constructor statements, and method boundaries share lines, violating one-action-per-line formatting. Reading flow: Inconsistent line breaks and placement of braces and annotations interrupt an otherwise straightforward top-to-bottom flow.

Run 3

Code Structure: The class has a logical arrangement of fields, constructor, accessors, and string representation, but merged declarations obscure boundaries. Nesting: Minimal nesting makes the code easy to follow. Clarity of intent: Descriptive class, field, and method names clearly communicate the event's purpose; explicit null checks clarify constructor requirements. Code length: The implementation is concise without unnecessary logic. Action granularity: Multiple imports, constructor statements, and method boundaries share lines, making individual actions harder to scan. Reading flow: Inconsistent spacing and compressed formatting interrupt an otherwise natural progression. Conventional line breaks and consistent formatting would substantially improve readability.