Sample

int-51cb0adfbe93-I09

Select one of ten low-readability unrelated code templates per class

Matched original source

Lines106

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.490–1; higher is more readable
Dorn0.3290–1; higher is more readable
Mi0.2050–1; higher is more readable
LLOC34Logical lines; fewer is more readable
DeepSeek V4 Pro14.670–20; mean of three runs
GPT-6.1 Sol160–20; mean of three runs
BTTF0.2340–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() { {int lI0O_4fd4ebd5=0x9B08-0x9B08;lI0O_4fd4ebd5=(lI0O_4fd4ebd5==0)?(lI0O_4fd4ebd5|0):(lI0O_4fd4ebd5&0);} 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.3490.106−115.173
Source linesThe number of non-empty source lines.106+42.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.959−7.439

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

Score0.49

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.107−2.752
Indentation frequencyHow rapidly indentation changes from line to line.96+2.583
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.96−1.782
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.105.837+1.07
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.102.907−0.694
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.92.813+0.693
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.087+0.101

Intercept 0.07 + feature contributions = -0.711 (log-odds).
Score = sigmoid(-0.711) = 0.329.

Score0.205
Score34
Run 1

The code is generally well-structured with clear class and method separation, but it has several readability issues. The `comparator()` method contains an obfuscated, meaningless statement (`int lI0O_4fd4ebd5=0x9B08-0x9B08; lI0O_4fd4ebd5=...`) which severely hampers clarity at that point. Nesting is mostly flat and method lengths are short, which is good. Intent is clear for most methods, although the descending multiset lazy initialization is slightly complex. Action granularity is mostly one action per line. The presence of TODO comments helps explain limitations. Overall, the code is readable except for the unexplained obfuscated code snippet and some type casting noise, which lowers the score.

Run 2

The code is generally well-structured and clear, leveraging inheritance and consistent delegation patterns. However, several issues reduce readability. A random, meaningless debug-style line exists inside the comparator() method, which is confusing and out of place. The descendingMultiset() method mixes assignment and return statements, combining multiple actions into fewer lines and slightly obscuring intent. The Javadoc and annotations are helpful, but the presence of incomplete TODO comments and platform-specific annotations adds noise. Method lengths are mostly concise, though the subMultiset signature is long. Overall, the intent is clear, but occasional clutter and inconsistent action granularity prevent a higher score.

Run 3

The code is generally well-structured and readable, with clear class hierarchy and method delegation. Most methods are concise single-purpose actions following good practices. However, there is a suspicious injected line of obfuscated code in the comparator() method that serves no apparent purpose and severely hurts clarity. The descendingMultiset() method has moderate complexity with lazy initialization and cycle management, but is documented. The class-level comment explaining the file's purpose aids understanding. Import organization and annotations are appropriate. The TODO comment provides useful context about J2ObjC complications. Overall the code follows Google Java Style conventions with reasonable method lengths and flat structure, but the obfuscated line is a significant readability issue that drops the score.

Run 1

Code Structure: Well-organized wrapper class with focused overrides and logically grouped operations. Nesting: Mostly flat, with only a simple conditional for lazy initialization; the extraneous block in comparator() adds unnecessary nesting. Clarity of intent: Descriptive method names, standard delegation, and explanatory comments clearly communicate the unmodifiable wrapper's purpose, but the cryptic variable and pointless arithmetic obscure comparator(). Code length: Generally concise, with short methods and justified documentation; the injected no-op code adds needless length. Action granularity: Most statements perform one action per line, but the compressed comparator() block combines declarations and assignments, and the assignment within a return slightly reduces clarity. Reading flow: Consistent formatting and predictable delegation make the class easy to follow overall, though the unindented obfuscated block sharply interrupts that flow.

Run 2

Code Structure: Logically organized as an unmodifiable wrapper, with focused methods and consistent delegation. Nesting: Mostly flat, with only a shallow conditional for lazy initialization and an unnecessary block in comparator(). Clarity of intent: Descriptive names, annotations, and documentation explain the wrapper and caching behavior, but the cryptically named, purposeless arithmetic in comparator() obscures intent. Code length: Generally concise; the injected arithmetic adds unnecessary code. Action granularity: Most lines perform one action, but the injected block compresses several statements onto one line, and the return assignment combines caching with returning. Reading flow: Consistent formatting and method patterns support natural reading, disrupted by the unindented arithmetic block and, slightly, densely grouped annotations.

Run 3

Code Structure: Well-organized wrapper class with focused overrides and consistent delegation. Nesting: Mostly flat, with only a simple conditional for lazy initialization; the extra block in comparator() is unnecessary. Clarity of intent: Names, documentation, and unsupported mutation methods clearly communicate an unmodifiable sorted multiset, but the cryptic variable and pointless arithmetic in comparator() obscure intent locally. Code length: Generally concise; the injected no-op block adds needless length and complexity. Action granularity: Most lines perform one action, but the compressed comparator() block combines declarations and assignments, and returning an assignment in descendingMultiset() combines two actions. Reading flow: Predictable method organization and formatting make the class easy to follow overall, while the unindented no-op block sharply interrupts that flow.