Sample

int-30bba825d566-I10

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

Matched original source

Lines66

Scores

MethodScoreScale
Posnett0.4160–1; higher is more readable
Scalabrino0.7360–1; higher is more readable
Dorn0.5790–1; higher is more readable
Mi0.1810–1; higher is more readable
LLOC5Logical lines; fewer is more readable
DeepSeek V4 Pro3.670–20; mean of three runs
GPT-6.1 Sol150–20; mean of three runs
BTTF0.5410–1; higher is more readable

Views

Source code

package com.google.common.collect; import com.google.common.annotations.GwtCompatible; import com.google.errorprone.annotations.CanIgnoreReturnValue; import java.util.Collection; import java.util.List; import java.util.Map; import org.jspecify.annotations.Nullable; /** * A {@code Multimap} that can hold duplicate key-value pairs and that maintains the insertion * ordering of values for a given key. See the {@link Multimap} documentation for information common * to all multimaps. * * <p>The {@link #get}, {@link #removeAll}, and {@link #replaceValues} methods each return a {@link * List} of values. Though the method signature doesn't say so explicitly, the map returned by * {@link #asMap} has {@code List} values. * * <p>See the Guava User Guide article on <a href= * "https://github.com/google/guava/wiki/NewCollectionTypesExplained#multimap">{@code Multimap}</a>. * * @author Jared Levy * @since 2.0 */ @GwtCompatible public interface ListMultimap<K extends @Nullable Object, V extends @Nullable Object> extends Multimap<K, V> { /** * {@inheritDoc} * * <p>Because the values for a given key may have duplicates and follow the insertion ordering, * this method returns a {@link List}, instead of the {@link java.util.Collection} specified in * the {@link Multimap} interface. */ @Override List<V> get(@ParametricNullness K key); /** * {@inheritDoc} * * <p>Because the values for a given key may have duplicates and follow the insertion ordering, * this method returns a {@link List}, instead of the {@link java.util.Collection} specified in * the {@link Multimap} interface. */ @CanIgnoreReturnValue @Override List<V> removeAll(@Nullable Object key); /** * {@inheritDoc} * * <p>Because the values for a given key may have duplicates and follow the insertion ordering, * this method returns a {@link List}, instead of the {@link java.util.Collection} specified in * the {@link Multimap} interface. */ @CanIgnoreReturnValue @Override List<V> replaceValues(@ParametricNullness K key, Iterable<? extends V> values); /** * {@inheritDoc} * * <p><b>Note:</b> The returned map's values are guaranteed to be of type {@link List}. To obtain * this map with the more specific generic type {@code Map<K, List<V>>}, call {@link * Multimaps#asMap(ListMultimap)} instead. */ @Override Map<K, Collection<V>> asMap(); /** * Compares the specified object to this multimap for equality. * * <p>Two {@code ListMultimap} instances are equal if, for each key, they contain the same values * in the same order. If the value orderings disagree, the multimaps will not be considered equal. * * <p>An empty {@code ListMultimap} is equal to any other empty {@code Multimap}, including an * empty {@code SetMultimap}. */ @Override boolean equals(@Nullable Object obj); }

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.859.051−28.349
Source linesThe number of non-empty source lines.66+26.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.84−7.26

Intercept 8.87 + feature contributions = -0.339 (log-odds).
Score = sigmoid(-0.339) = 0.416.

Score0.736

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.65−1.265
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.109.94−0.991
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.109.925+0.969
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.028+0.674
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.65.829+0.51
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.20−0.045

Intercept 0.07 + feature contributions = 0.32 (log-odds).
Score = sigmoid(0.32) = 0.579.

Score0.181
Score5
Run 1

The code has severe formatting issues that make it difficult to read. Multiple imports are on the same line, annotations and Javadoc comments are merged into single lines with method declarations, and there's inconsistent spacing. The interface itself has clear purpose and follows logical structure, but the presentation undermines readability. The nesting is minimal (good), but action granularity is violated - multiple declarations and comments are crammed together. The reading flow is disorganized due to compressed formatting. While the code's intent is discernible and the logic is simple (interface definition), the physical layout makes it unnecessarily hard to parse. Proper line breaks and separation would significantly improve readability.

Run 2

The code is highly unreadable due to severe formatting issues. Imports and Javadoc comments are crammed onto single lines, making the header section dense and difficult to scan. Annotations, method signatures, and comments are frequently placed on the same line, violating the 'one action per line' principle and creating visual clutter. This also disrupts the natural reading flow, as methods do not follow a standard vertical structure. The lack of blank lines between major sections further compounds the issue. While the underlying logic is simple (an interface definition), the tangled presentation makes it hard to quickly identify the API contract or distinguish comments from code. Proper indentation and line breaks would dramatically improve clarity.

Run 3

This code is essentially unreadable as presented. The imports are all on the same line (1), the Javadoc and class declaration are on the same line (1, 5), method declarations run into each other (8), and the closing brace is attached to the last line (25). There is no logical separation between type parameters, method signatures, and documentation blocks. The flattened structure eliminates any natural reading flow and makes it impossible to discern where one method ends and the next begins. While the underlying semantic content (a well-documented interface from Guava) would be highly readable if formatted normally, the actual given text violates every structural criterion: it has zero visual hierarchy, multiple actions per line, no whitespace grouping, and no code organization. It reads as a dense wall of characters rather than as evaluable source code.

Run 1

Code Structure: The interface is logically organized, with imports, a type declaration, and related method contracts, but inconsistent formatting weakens separation. Nesting: Flat declarations with no nested control flow make scanning easy. Clarity of intent: Descriptive method names, precise types, and detailed Javadoc clearly explain ordering, duplicates, return types, and equality. Code length: The API is concise, though repeated documentation adds some verbosity. Action granularity: Most method declarations occupy individual lines, but several imports share lines, annotations are compressed together, and comments begin on declaration lines. Reading flow: The method sequence is natural, but merged imports, attached Javadoc boundaries, and the closing brace on the final declaration line interrupt visual flow. Overall, the semantics are highly readable, while layout inconsistencies prevent a higher score.

Run 2

Code Structure: The interface is logically organized, with related method declarations and relevant documentation. Nesting: Flat declarations and no nested control flow make it easy to follow. Clarity of intent: Descriptive names, explicit types, and detailed Javadoc clearly explain ordering, duplicates, and return types. Code length: The interface is concise, although repeated method documentation adds bulk. Action granularity: Several imports share lines, and annotations, comment boundaries, and the closing brace are sometimes attached to declarations, reducing visual separation. Reading flow: Method ordering is natural, but inconsistent spacing and compressed formatting interrupt scanning. Overall, the API is understandable, with formatting rather than structural complexity being the main readability weakness.

Run 3

Code Structure: The interface is logically organized, with related operations grouped and documented. Nesting: Flat method declarations and no control flow make it easy to scan. Clarity of intent: Descriptive names, precise types, and thorough Javadoc clearly explain ordering, duplicates, and return-value guarantees. Code length: The interface itself is concise, but repeated documentation adds bulk. Action granularity: Several imports share lines, annotations appear beside comment endings, and some declarations share lines with subsequent comments, weakening visual separation. Reading flow: Method order is natural, but inconsistent line breaks, crowded annotations, and the closing brace on the final declaration interrupt scanning. Overall, the semantics are highly readable, while formatting noticeably reduces readability.