Sample

int-5c34387e7f00-I10

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

Matched original source

Lines34

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.6410–1; higher is more readable
Dorn0.4080–1; higher is more readable
Mi0.0650–1; higher is more readable
LLOC15Logical lines; fewer is more readable
DeepSeek V4 Pro8.670–20; mean of three runs
GPT-6.1 Sol120–20; mean of three runs
BTTF0.4590–1; higher is more readable

Views

Source code

package com.google.common.collect; import com.google.common.annotations.GwtCompatible; import java.util.Map.Entry; import java.util.Objects; import org.jspecify.annotations.Nullable; /** * Implementation of the {@code equals}, {@code hashCode}, and {@code toString} methods of {@code * Entry}. * * @author Jared Levy */ @GwtCompatible abstract class AbstractMapEntry<K extends @Nullable Object, V extends @Nullable Object> implements Entry<K, V> { @Override @ParametricNullness public abstract K getKey(); @Override @ParametricNullness public abstract V getValue(); @Override @ParametricNullness public V setValue(@ParametricNullness V value) { throw new UnsupportedOperationException(); } @Override public boolean equals(@Nullable Object object) { if (object instanceof Entry) { Entry<?, ?> that = (Entry<?, ?>) object; return Objects.equals(this.getKey(), that.getKey()) && Objects.equals(this.getValue(), that.getValue()); } return false; } @Override public int hashCode() { K k = getKey(); V v = getValue(); return ((k == null) ? 0 : k.hashCode()) ^ ((v == null) ? 0 : v.hashCode()); } /** Returns a string representation of the form {@code {key}={value}}. */ @Override public String toString() { return getKey() + "=" + getValue(); } }

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.1546.216−51.025
Source linesThe number of non-empty source lines.34+13.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.985−7.477

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

Score0.641

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.114.943−1.203
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.114.971+1.051
Indentation frequencyHow rapidly indentation changes from line to line.29+0.266
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.29−0.245
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.35−0.203
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.115−0.171
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.33.724+0.062

Intercept 0.07 + feature contributions = -0.374 (log-odds).
Score = sigmoid(-0.374) = 0.408.

Score0.065
Score15
Run 1

The code has a clear logical structure but suffers from severe formatting issues that harm readability. Multiple statements are crammed onto single lines, annotations are placed awkwardly on the same line as declarations, and brace placement is inconsistent. This creates dense, visually cluttered blocks that are difficult to scan. The nesting is minimal (one level for instanceof check), which is good. Intent is clear for each method, and the methods are appropriately granular—each does one thing. However, the reading flow is disrupted by poor line organization and compression of elements that should be vertically separated. Code length is reasonable, but vertical spacing would greatly improve comprehension. The equals method is concise but would benefit from proper line breaks. Overall, the logic is sound, but the presentation significantly reduces readability.

Run 2

The code suffers from severe formatting issues that significantly hamper readability. Multiple statements and annotations are crammed onto single lines (e.g., imports, method signatures with annotations, setValue implementation), violating the 'one action per line' principle. The inconsistent indentation and lack of vertical spacing between methods make the structure visually tangled, undermining logical organization. While the core logic (equals, hashCode, toString) is straightforward and the class purpose is documented, the reading flow is constantly interrupted by the compressed layout. The nesting is minimal, but this cannot compensate for the pervasive formatting defects. The code would be much clearer if standard Java formatting conventions were applied, separating annotations, signatures, and statements onto their own lines.

Run 3

The code is functionally complete but poorly formatted and difficult to read. The structure is tangled: multiple statements and annotations are packed onto single lines, and indentation is inconsistent, making it hard to distinguish logical blocks. Nesting is minimal, but the equals method still suffers from inline braces and condensed logic. Clarity of intent is obscured by the formatting—though the class's purpose is documented, the implementation is visually disorganized. Code length is concise but often at the expense of readability (e.g., collapsed braces, merged imports). Action granularity is poor: several distinct operations share lines, reducing scannability. Reading flow is disrupted by erratic line breaks and indentation. Overall, the logic is straightforward but the presentation severely hampers comprehension.

Run 1

Code Structure: The class is logically organized around standard Map.Entry methods, but compressed formatting obscures method boundaries. Nesting: Shallow, with only one conditional block, making control flow easy to follow. Clarity of intent: Familiar method names, documentation, and straightforward implementations clearly communicate purpose. Code length: Concise without substantial unnecessary code, though excessive compression reduces readability. Action granularity: Multiple imports, declarations, and statements share lines, especially in hashCode, making individual actions harder to scan. Reading flow: Inconsistent placement of annotations, braces, and method declarations interrupts an otherwise natural progression. Conventional line breaks and consistent formatting would significantly improve readability.

Run 2

Code Structure: Methods are logically organized around the Map.Entry contract, but compressed formatting obscures their boundaries. Nesting: Minimal nesting, with only one conditional in equals, makes control flow easy to follow. Clarity of intent: Standard method names, documentation, and straightforward implementations clearly communicate purpose, although k and v are less descriptive. Code length: The implementation is concise without unnecessary logic, but excessive line compression hurts readability. Action granularity: Multiple imports, declarations, statements, annotations, and closing braces share lines, making individual actions harder to scan. Reading flow: The method order is natural, but inconsistent spacing and misplaced annotations and braces interrupt visual flow. Overall, the logic is readable, while the formatting significantly reduces clarity.

Run 3

Code Structure: Methods are logically organized around Map.Entry behavior, but compressed formatting obscures their boundaries. Nesting: Shallow nesting, with only one conditional in equals, makes the logic easy to follow. Clarity of intent: Standard method names, annotations, and documentation clearly communicate purpose; abbreviated hashCode variables slightly reduce clarity. Code length: The implementation is concise and contains little unnecessary code, though excessive compression hurts readability. Action granularity: Multiple imports, declarations, and statements share lines, making individual actions harder to distinguish. Reading flow: Inconsistent placement of annotations, braces, and method declarations disrupts scanning. Overall, straightforward logic and sensible organization are undermined by poor formatting.