Sample

int-853cadb4376c-I01

Remove line comments, block comments, and Javadoc

Matched original source

Lines88

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.450–1; higher is more readable
Dorn0.1460–1; higher is more readable
Mi0.4650–1; higher is more readable
LLOC19Logical lines; fewer is more readable
DeepSeek V4 Pro150–20; mean of three runs
GPT-6.1 Sol160–20; mean of three runs
BTTF0.3950–1; higher is more readable

Views

Source code

package com.google.common.collect; import com.google.common.annotations.GwtCompatible; import com.google.common.annotations.GwtIncompatible; import com.google.common.annotations.J2ktIncompatible; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.util.LinkedHashMap; import org.jspecify.annotations.Nullable; @GwtCompatible public final class LinkedHashMultiset<E extends @Nullable Object> extends AbstractMapBasedMultiset<E> { public static <E extends @Nullable Object> LinkedHashMultiset<E> create() { return new LinkedHashMultiset<>(); } public static <E extends @Nullable Object> LinkedHashMultiset<E> create(int distinctElements) { return new LinkedHashMultiset<>(distinctElements); } public static <E extends @Nullable Object> LinkedHashMultiset<E> create( Iterable<? extends E> elements) { LinkedHashMultiset<E> multiset = create(Multisets.inferDistinctElements(elements)); Iterables.addAll(multiset, elements); return multiset; } private LinkedHashMultiset() { super(new LinkedHashMap<E, Count>()); } private LinkedHashMultiset(int distinctElements) { super(Maps.newLinkedHashMapWithExpectedSize(distinctElements)); } @GwtIncompatible @J2ktIncompatible private void writeObject(ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); Serialization.writeMultiset(this, stream); } @GwtIncompatible @J2ktIncompatible private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); int distinctElements = stream.readInt(); setBackingMap(new LinkedHashMap<E, Count>()); Serialization.populateMultiset(this, stream, distinctElements); } @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.2055.329−67.826
Source linesThe number of non-empty source lines.88+35.2
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.892−7.338

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

Score0.45

Feature contributions

FeatureValueContribution
(log-odds)
Indentation frequencyHow rapidly indentation changes from line to line.88+2.307
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.89−2.115
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.88−1.599
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.87.909+0.819
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
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.97.966−0.484
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.093+0.04

Intercept 0.07 + feature contributions = -1.767 (log-odds).
Score = sigmoid(-1.767) = 0.146.

Score0.465
Score19
Run 1

The code is well-structured with clear separation of concerns: constructors, factory methods, and serialization logic are logically organized. The class purpose is evident from its name and inheritance pattern. Nesting is minimal, with only a single-level conditional in the factory method. Action granularity is mostly one action per line, particularly in constructors and factory methods. The reading flow is natural, progressing from public API to implementation details. However, there are several readability issues: excessive blank lines after imports and before annotations, inconsistent indentation in the writeObject/readObject methods (annotations and methods are misaligned), and the serialization methods have slightly convoluted logic that could benefit from comments explaining the distinct element handling. The score reflects good overall structure but with formatting inconsistencies that make the code feel less polished than it could be.

Run 2

The code is generally well-structured with clear class hierarchy, sensible method organization, and good use of static factory methods. The class purpose is evident, and the methods follow logical grouping. However, there are notable readability issues: excessive blank lines (13 consecutive empty lines after imports), inconsistent indentation before @GwtIncompatible annotations on writeObject and readObject methods, and some formatting inconsistencies that disrupt reading flow. The generic type parameter syntax with @Nullable adds complexity but is understandable. Action granularity is mostly one action per line. The code could be improved with cleaner formatting and removing unnecessary blank lines to enhance readability.

Run 3

The code has reasonably good structure overall: a clear class with factory methods and serialization logic. It is mostly flat, with only one nested method and no deep nesting. Intent is mostly clear, especially for the factory methods and constructors. However, readability is reduced by inconsistent indentation in the writeObject/readObject methods, excessive blank lines, and verbose Javadoc placeholder comments. Some actions are grouped, but the irregular formatting disrupts the natural reading flow. The code is concise overall, but the formatting inconsistencies and redundant comments slightly obscure the clarity of intent.

Run 1

Code Structure: Factory methods, constructors, and serialization methods are logically grouped, with responsibilities delegated to helpers. Nesting: Methods are flat, with no nested control flow. Clarity of intent: Descriptive class and method names make the purpose clear, although serialization details depend on external helpers and there is no explanatory documentation. Code length: The implementation is concise, but excessive blank lines unnecessarily stretch the file. Action granularity: Statements generally perform one action per line; the final line compresses annotations and a field declaration. Reading flow: The ordering is natural, but large whitespace gaps and inconsistent indentation of serialization methods interrupt scanning.

Run 2

Code Structure: Factory methods, constructors, and serialization methods are logically grouped. Nesting: Methods are flat, with no nested control flow. Clarity of intent: Descriptive names and straightforward operations communicate purpose, although some behavior depends on inherited methods and external utilities. Code length: Executable code is concise, but excessive blank lines unnecessarily lengthen the presentation. Action granularity: Statements generally perform one action per line; the final field declaration compresses annotations and modifiers onto one line. Reading flow: The ordering is natural, but large whitespace gaps and inconsistent indentation of serialization method declarations interrupt scanning.

Run 3

Code Structure: Factory methods, constructors, and serialization hooks are logically grouped. Nesting: Methods are flat, with no nested control flow. Clarity of intent: Descriptive names and straightforward delegation make the purpose clear, although inherited behavior and serialization helpers require external context. Code length: The implementation is concise, but excessive blank lines unnecessarily expand its visual length. Action granularity: Statements generally perform one action per line; the final line compresses two annotations and a field declaration. Reading flow: The member order is natural, but large whitespace gaps and inconsistent indentation of serialization methods interrupt scanning. Overall, the code is readable and well organized, with formatting issues accounting for most deductions.