Sample

int-4053a47a1f41-I01

Remove line comments, block comments, and Javadoc

Matched original source

Lines51

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.6050–1; higher is more readable
Dorn0.4520–1; higher is more readable
Mi0.30–1; higher is more readable
LLOC15Logical lines; fewer is more readable
DeepSeek V4 Pro17.330–20; mean of three runs
GPT-6.1 Sol180–20; mean of three runs
BTTF0.610–1; higher is more readable

Views

Source code

package com.google.common.graph; import static com.google.common.base.Preconditions.checkNotNull; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterators; import com.google.common.collect.UnmodifiableIterator; import java.util.AbstractSet; import java.util.Map; import org.jspecify.annotations.Nullable; final class EdgesConnecting<E> extends AbstractSet<E> { private final Map<?, E> nodeToOutEdge; private final Object targetNode; EdgesConnecting(Map<?, E> nodeToEdgeMap, Object targetNode) { this.nodeToOutEdge = checkNotNull(nodeToEdgeMap); this.targetNode = checkNotNull(targetNode); } @Override public UnmodifiableIterator<E> iterator() { E connectingEdge = getConnectingEdge(); return (connectingEdge == null) ? ImmutableSet.<E>of().iterator() : Iterators.singletonIterator(connectingEdge); } @Override public int size() { return getConnectingEdge() == null ? 0 : 1; } @Override public boolean contains(@Nullable Object edge) { E connectingEdge = getConnectingEdge(); return connectingEdge != null && connectingEdge.equals(edge); } private @Nullable E getConnectingEdge() { return nodeToOutEdge.get(targetNode); } }

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.1511.099−49.866
Source linesThe number of non-empty source lines.51+20.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.794−7.192

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

Score0.605

Feature contributions

FeatureValueContribution
(log-odds)
Indentation frequencyHow rapidly indentation changes from line to line.51+1.027
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.64.962+0.914
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.52−0.805
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.51−0.749
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.50.803+0.3
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.112−0.144

Intercept 0.07 + feature contributions = -0.192 (log-odds).
Score = sigmoid(-0.192) = 0.452.

Score0.3
Score15
Run 1

The code is highly readable overall. Structure is logical with a clear class purpose: representing edges connecting a target node. Nesting is minimal, with only one level in the iterator method. Intent is clear from method and field names (e.g., nodeToOutEdge, getConnectingEdge). Code length is concise, and action granularity is appropriate—each meaningful operation generally occupies its own line. Reading flow is natural: fields, constructor, accessor methods, and a private helper at the end. Minor deductions: the iterator method has a ternary that spans multiple lines, slightly reducing readability, and a few extra blank lines in the imports section create minor visual noise. Overall, the code is well-structured and self-explanatory.

Run 2

The code is highly readable. Structure is logical, with a single class focused on a clear responsibility. Nesting is minimal—just one ternary expression and one condition in contains(). Intent is obvious: represent a set of edges connecting two nodes, containing at most one element. The code is concise, with no redundant logic. Each line performs a single action, and methods are short and cohesive. The reading flow is natural: field declarations, constructor, then standard set methods (iterator, size, contains), with a private helper at the end. Nullability annotations enhance clarity. Minor deductions for the slightly awkward null-check in contains() and reliance on Guava-specific types, but overall this is exemplary code.

Run 3

The code is highly readable. It is well-structured with a clear class purpose and logical separation of fields, constructor, and overridden methods. Nesting is minimal, with concise ternary expressions used appropriately. Intent is clear: the class represents the edges connecting to a target node in a graph. Code length is appropriate, avoiding unnecessary verbosity while remaining complete. Action granularity is good, with one primary operation per line in most cases. Reading flow follows a natural top-down progression from fields to constructor to public methods and finally the private helper. Minor deductions are for the unconventional field name 'nodeToOutEdge' (mismatched with constructor parameter 'nodeToEdgeMap') and the slightly dense ternary expressions, but overall the code is clean and maintainable.

Run 1

Code Structure: Fields, constructor, set operations, and lookup helper are logically organized. Nesting: Flat methods with simple conditional expressions make control flow easy to follow. Clarity of intent: Descriptive names and standard Set overrides clearly convey a zero-or-one-edge view, though the map's wildcard key type and lack of class documentation leave some context implicit. Code length: The implementation is concise without unnecessary logic, but excessive blank lines after imports distract. Action granularity: Each statement performs a focused action, with no crowded multi-statement lines. Reading flow: Consistent formatting and short methods support natural reading; the multiline ternary remains straightforward, while missing spacing between package and imports slightly reduces polish.

Run 2

Code Structure: The class is logically organized into fields, constructor, set-operation overrides, and a private lookup helper. Nesting: Methods are flat, with simple conditionals and no nested blocks. Clarity of intent: Descriptive names and familiar collection methods clearly communicate a set containing zero or one connecting edge, though a brief class comment could clarify the map-backed behavior. Code length: The implementation is concise, but excessive blank lines before the class add unnecessary visual space. Action granularity: Each statement performs a focused action; compact ternary expressions remain easy to understand. Reading flow: The progression from initialization to public behavior and then the helper is natural, with consistent formatting apart from the leading whitespace.

Run 3

Code Structure: The class is logically organized into fields, constructor, standard set operations, and a private lookup helper. Nesting: Methods are flat, with only simple conditional expressions. Clarity of intent: Descriptive names and familiar collection overrides clearly convey a set containing zero or one connecting edge; the backing-map relationship could benefit from brief documentation. Code length: The implementation is concise, though excessive blank lines before the class add visual clutter. Action granularity: Each statement performs one focused action, with readable conditional expressions. Reading flow: Consistent formatting and method order make the code easy to follow, slightly weakened by the large whitespace gap and minor naming inconsistency between nodeToEdgeMap and nodeToOutEdge.