Sample

int-50032eb97bc4-I03

Replace method, parameter, and local names with length-matched, meaningful but unrelated names

Matched original source

Lines57

Scores

MethodScoreScale
Posnett0.9980–1; higher is more readable
Scalabrino0.9320–1; higher is more readable
Dorn0.7060–1; higher is more readable
Mi0.3350–1; higher is more readable
LLOC3Logical lines; fewer is more readable
DeepSeek V4 Pro120–20; mean of three runs
GPT-6.1 Sol120–20; mean of three runs
BTTF0.6090–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 com.google.errorprone.annotations.DoNotMock; import java.util.Iterator; import java.util.NoSuchElementException; import org.jspecify.annotations.Nullable; /** * An iterator that supports a one-element lookahead while iterating. * * <p>See the Guava User Guide article on <a href= * "https://github.com/google/guava/wiki/CollectionHelpersExplained#peekingiterator">{@code * PeekingIterator}</a>. * * @author Mick Killianey * @since 2.0 */ @DoNotMock("Use Iterators.peekingIterator") @GwtCompatible public interface PeekingIterator<E extends @Nullable Object> extends Iterator<E> { /** * Returns the next element in the iteration, without advancing the iteration. * * <p>Calls to {@code peek()} should not change the state of the iteration, except that it * <i>may</i> prevent removal of the most recent element via {@link #remove()}. * * @throws NoSuchElementException if the iteration has no more elements according to {@link * #hasNext()} */ @ParametricNullness E load(); /** * {@inheritDoc} * * <p>The objects returned by consecutive calls to {@link #peek()} then {@link #next()} are * guaranteed to be equal to each other. */ @CanIgnoreReturnValue @Override @ParametricNullness E send(); /** * {@inheritDoc} * * <p>Implementations may or may not support removal when a call to {@link #peek()} has occurred * since the most recent call to {@link #next()}. * * @throws IllegalStateException if there has been a call to {@link #peek()} since the most recent * call to {@link #next()} and this implementation does not support this sequence of calls * (optional) */ @Override void choose(); }

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(log-odds)
Source linesThe number of non-empty source lines.57+22.8
Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones.560.253−18.488
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.764−7.146

Intercept 8.87 + feature contributions = 6.036 (log-odds).
Score = sigmoid(6.036) = 0.998.

Score0.932

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.57−0.982
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.96.621+0.754
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.029+0.656
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.99.948−0.568
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.56.881+0.385
Indentation frequencyHow rapidly indentation changes from line to line.26+0.162

Intercept 0.07 + feature contributions = 0.876 (log-odds).
Score = sigmoid(0.876) = 0.706.

Score0.335
Score3
Run 1

The code is well-structured as an interface with clear Javadoc, but readability is significantly harmed by misleading method names: 'load', 'send', and 'choose' do not reflect their actual behavior as 'peek', 'next', and 'remove'. This obscures intent and forces readers to rely on documentation. Structure and flat nesting are good, and action granularity is fine. However, the odd naming, redundant/inconsistent nullness annotations, and verbose Javadoc for simple methods reduce clarity and reading flow. Concise but confusing.

Run 2

The code is highly readable: it has a clear, logical interface structure with well-organized Javadoc. Nesting is minimal (none), and intent is unambiguous through descriptive method names and documentation. Action granularity is appropriate, with one annotation or declaration per line improving scanability. Reading flow is natural, following standard Java conventions. However, the method names ('load', 'send', 'choose') appear to be placeholders or obfuscated names that contradict the documentation (which refers to 'peek', 'next', 'remove'), slightly reducing clarity of intent. Otherwise, the code is concise and well-structured.

Run 3

The code is heavily obfuscated: 'load', 'send', and 'choose' replace 'peek', 'next', and 'remove', making the intent completely unclear relative to the documented PeekingIterator contract. Structure and indentation are fine, and nesting is absent, but clarity of intent is severely damaged by misleading naming. Action granularity is appropriate, but the reading flow is unnatural because the method names contradict their Javadoc and inherited semantics. The class is also suspiciously minimal for an interface with such misleading vocabulary, suggesting deliberate or accidental corruption. While formatting and brevity are acceptable, the core purpose is ambiguous and confusing, making the code hard to read and maintain in practice.

Run 1

Code Structure: The interface is logically organized, with imports, type documentation, and individually documented methods. Nesting: Flat declarations make scanning easy. Clarity of intent: Significantly weakened by method names load(), send(), and choose(), which conflict with documentation describing peek(), next(), and remove(). The @Override annotations on send() and choose() also contradict Iterator's method contracts. Code length: Reasonably concise, though extensive documentation becomes distracting because it describes different methods. Action granularity: Each declaration and annotation occupies its own line; there are no bundled actions. Reading flow: Conventional Java layout provides a natural sequence, but repeatedly reconciling names, documentation, and inheritance interrupts comprehension.

Run 2

Code Structure: The interface is logically organized, with imports, class documentation, and individually documented methods. Nesting: There is no deep nesting, making the declarations easy to scan. Clarity of intent: Significantly weakened by method names load(), send(), and choose(), which conflict with documentation describing peek(), next(), and remove(). The @Override annotations on send() and choose() are also inconsistent with Iterator's methods, making the intended contract confusing. Code length: The interface is concise, although documentation occupies most of the snippet. Action granularity: Each declaration and annotation is on its own line; there are no bundled operations. Reading flow: Formatting and method ordering are natural, but repeated references to undeclared methods interrupt comprehension and undermine otherwise clear documentation.

Run 3

Code Structure: The interface is logically organized with grouped imports and separately documented methods. Nesting: There is no deep nesting, making the layout easy to scan. Clarity of intent: Significantly weakened by method names load(), send(), and choose(), which conflict with documentation describing peek(), next(), and remove(). The @Override annotations on send() and choose() also contradict Iterator's API, creating confusion. Code length: Declarations are concise, though extensive documentation becomes distracting because it describes different methods. Action granularity: Each declaration and annotation occupies its own line, supporting readability. Reading flow: Formatting and method separation are consistent, but mismatches between names, documentation links, and inherited contracts repeatedly interrupt comprehension.