Sample

int-3ebe906b4d45-I10

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

Matched original source

Lines67

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.4150–1; higher is more readable
Dorn0.0240–1; higher is more readable
Mi0.0150–1; higher is more readable
LLOC32Logical lines; fewer is more readable
DeepSeek V4 Pro70–20; mean of three runs
GPT-6.1 Sol11.330–20; mean of three runs
BTTF0.2310–1; higher is more readable

Views

Source code

package com.google.common.collect; import static com.google.common.collect.Sets.unmodifiableNavigableSet; import com.google.common.annotations.GwtCompatible; import com.google.common.annotations.GwtIncompatible; import com.google.common.annotations.J2ktIncompatible; import com.google.common.collect.Multisets.UnmodifiableMultiset; import com.google.errorprone.annotations.concurrent.LazyInit; import java.util.Comparator; import java.util.NavigableSet; import org.jspecify.annotations.Nullable; /** * Implementation of {@link Multisets#unmodifiableSortedMultiset(SortedMultiset)}, split out into * its own file so it can be GWT emulated (to deal with the differing elementSet() types in GWT and * non-GWT). * * @author Louis Wasserman */ @GwtCompatible final class UnmodifiableSortedMultiset<E extends @Nullable Object> extends UnmodifiableMultiset<E> implements SortedMultiset<E> { UnmodifiableSortedMultiset(SortedMultiset<E> delegate) { super(delegate); } @Override protected SortedMultiset<E> delegate() { return (SortedMultiset<E>) super.delegate(); } @Override public Comparator<? super E> comparator() { return delegate().comparator(); } @Override NavigableSet<E> createElementSet() { return unmodifiableNavigableSet(delegate().elementSet()); } @Override public NavigableSet<E> elementSet() { return (NavigableSet<E>) super.elementSet(); } @LazyInit private transient @Nullable UnmodifiableSortedMultiset<E> descendingMultiset; // TODO(b/418181860): This method creates retain cycles in J2ObjC. In order to break the cycle, // there needs to be separate classes for primary and descending multiset, where the primary one // would hold {@code @LazyInit @RetainedWith @Nullable} reference to its descending multiset, and // the other {@code final} reference. @Override public SortedMultiset<E> descendingMultiset() { UnmodifiableSortedMultiset<E> result = descendingMultiset; if (result == null) { result = new UnmodifiableSortedMultiset<>(delegate().descendingMultiset()); result.descendingMultiset = this; return descendingMultiset = result; } return result; } @Override public @Nullable Entry<E> firstEntry() { return delegate().firstEntry(); } @Override public @Nullable Entry<E> lastEntry() { return delegate().lastEntry(); } @Override public @Nullable Entry<E> pollFirstEntry() { throw new UnsupportedOperationException(); } @Override public @Nullable Entry<E> pollLastEntry() { throw new UnsupportedOperationException(); } @Override public SortedMultiset<E> headMultiset(@ParametricNullness E upperBound, BoundType boundType) { return Multisets.unmodifiableSortedMultiset(delegate().headMultiset(upperBound, boundType)); } @Override public SortedMultiset<E> subMultiset( @ParametricNullness E lowerBound, BoundType lowerBoundType, @ParametricNullness E upperBound, BoundType upperBoundType) { return Multisets.unmodifiableSortedMultiset( delegate().subMultiset(lowerBound, lowerBoundType, upperBound, upperBoundType)); } @Override public SortedMultiset<E> tailMultiset(@ParametricNullness E lowerBound, BoundType boundType) { return Multisets.unmodifiableSortedMultiset(delegate().tailMultiset(lowerBound, boundType)); } @GwtIncompatible @J2ktIncompatible private static final long serialVersionUID = 0; }

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.3200.27−105.609
Source linesThe number of non-empty source lines.67+26.8
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.897−7.345

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

Score0.415

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.238.956−6.456
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.239+3.052
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.68−1.371
Indentation frequencyHow rapidly indentation changes from line to line.57+1.234
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.57−0.887
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.66.812+0.524
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.085+0.119

Intercept 0.07 + feature contributions = -3.716 (log-odds).
Score = sigmoid(-3.716) = 0.024.

Score0.015
Score32
Run 1

The code is readable in terms of overall class structure and naming, but formatting issues significantly harm readability. Multiple statements are crammed onto single lines, inconsistent line breaks appear before closing braces and annotations, and some method declarations are inline with preceding code. The core logic is straightforward, and intent is mostly clear for each method, but the disorder in formatting disrupts natural reading flow, action granularity, and overall clarity. While the nesting is flat and decomposition is logical, the inconsistent spacing and line breaks make the code unnecessarily difficult to scan and maintain.

Run 2

The code is quite difficult to read due to poor formatting and dense layout. There are many violations of typical Java style conventions: multiple statements per line, imports on the same line, method bodies sharing lines with signatures, inconsistent indentation, and missing line breaks between methods. The logical structure of the class is understandable (it extends UnmodifiableMultiset and implements SortedMultiset), but the visual clutter obscures this. Nesting is not deep, which is good, and the intent of each method is generally clear from the names, but the formatting defeats readability. The code is actually concise in terms of logic, but unnecessarily compressed in presentation. Reading flow is severely disrupted—readers must visually parse line-by-line to separate declarations and statements. A simple reformatting with standard IDE settings would bring this from unreadable to reasonably readable, but as presented it rates low on most criteria.

Run 3

The code is difficult to read due to inconsistent formatting and compressed lines. Multiple statements are placed on the same line (e.g., imports, method declarations with bodies), violating the 'one action per line' principle. Nesting is generally flat, but the irregular line breaks disrupt natural reading flow and make the structure feel tangled. Intent is somewhat clear from the class and method names, but the formatting obscures the logical organization. Several methods are unnecessarily long due to squeezed lines and missing line breaks between modifiers, return types, and method names. The overall structure is logical but presented poorly. Despite recognizable patterns from the Guava library, the code requires deliberate effort to parse and would benefit significantly from consistent formatting and separation of concerns per line.

Run 1

Code Structure: The class logically groups delegation, immutable views, and mutation rejection, but compressed formatting obscures method boundaries. Nesting: Very shallow; only the descending-multiset cache introduces a conditional. Clarity of intent: Descriptive names, standard overrides, and documentation clearly convey an unmodifiable sorted-multiset wrapper. Code length: Methods are concise and largely avoid unnecessary logic; the longer TODO provides useful context. Action granularity: Several lines combine imports, annotations, declarations, assignments, returns, or adjacent methods, making individual actions harder to distinguish. Reading flow: Inconsistent brace placement, long lines, and merged method boundaries interrupt scanning despite the straightforward implementation. Overall, the semantics are readable, but presentation substantially reduces accessibility.

Run 2

Code Structure: The wrapper class has logically grouped delegation, view creation, and mutation-blocking methods, but compressed formatting obscures their boundaries. Nesting: Minimal nesting, with only a single conditional in descendingMultiset(), makes control flow straightforward. Clarity of intent: Descriptive method names, standard overrides, and explanatory comments clearly communicate an unmodifiable sorted-multiset wrapper; caching and reciprocal references require slightly more attention. Code length: The implementation is appropriately concise, with little unnecessary logic. Action granularity: Multiple imports, declarations, assignments, returns, annotations, and method boundaries share lines, making individual actions harder to distinguish. Reading flow: Inconsistent brace placement, long lines, and adjacent method definitions repeatedly interrupt scanning. Overall, clear underlying logic is substantially undermined by poor formatting.

Run 3

Code Structure: The wrapper class is logically organized around delegation, immutable views, and cached descending access, but compressed method boundaries obscure that organization. Nesting: Minimal nesting, with only one conditional, makes control logic easy to follow. Clarity of intent: Descriptive names, standard overrides, documentation, and explicit unsupported operations clearly communicate the unmodifiable multiset's purpose. Code length: Methods are concise and avoid unnecessary complexity; long signatures and delegation expressions would benefit from wrapping. Action granularity: Multiple imports, declarations, assignments, returns, and method boundaries share lines, making individual actions harder to distinguish. Reading flow: Inconsistent brace placement, crowded annotations, and irregular line breaks interrupt scanning and blur transitions between methods. Overall, straightforward logic and clear naming provide moderate readability, substantially reduced by formatting.