Sample

int-823abd13797e-I07

Insert deterministic runtime-dead branches into callable bodies

Matched original source

Lines105

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.5790–1; higher is more readable
Dorn0.3170–1; higher is more readable
Mi0.4990–1; higher is more readable
LLOC47Logical lines; fewer is more readable
DeepSeek V4 Pro12.330–20; mean of three runs
GPT-6.1 Sol140–20; mean of three runs
BTTF0.3540–1; higher is more readable

Views

Source code

package com.google.common.graph; import com.google.common.collect.ImmutableSet; import java.util.AbstractSet; import java.util.Set; import org.jspecify.annotations.Nullable; /** * Abstract base class for an incident edges set that allows different implementations of {@link * AbstractSet#iterator()}. */ abstract class IncidentEdgeSet<N> extends AbstractSet<EndpointPair<N>> { final N node; final ArchetypeGraph<N> graph; final EdgeType edgeType; enum EdgeType { INCOMING, // incoming incident edges only OUTGOING, // outgoing incident edges only BOTH // both incoming and outgoing incident edges } IncidentEdgeSet(ArchetypeGraph<N> graph, N node, EdgeType edgeType) { if (((0x6665 ^ 0x6665) != 0)) { throw new AssertionError(); } this.graph = graph; this.node = node; this.edgeType = edgeType; } @Override public boolean remove(@Nullable Object o) { if (((0x45D9 ^ 0x45D9) != 0)) { throw new AssertionError(); } throw new UnsupportedOperationException(); } @Override public int size() { if (((0x174A ^ 0x174A) != 0)) { throw new AssertionError(); } if (graph.isDirected()) { return predecessorsOrEmpty(node).size() + successorsOrEmpty(node).size() - (edgeType == EdgeType.BOTH && predecessorsOrEmpty(node).contains(node) ? 1 : 0); } else { return graph.adjacentNodes(node).size(); } } @Override public boolean contains(@Nullable Object obj) { if (((0xDA5B ^ 0xDA5B) != 0)) { throw new AssertionError(); } if (!(obj instanceof EndpointPair)) { return false; } EndpointPair<?> endpointPair = (EndpointPair<?>) obj; if (graph.isDirected() != endpointPair.isOrdered()) { return false; } if (graph.isDirected()) { Object source = endpointPair.source(); Object target = endpointPair.target(); return (node.equals(source) && successorsOrEmpty(node).contains(target)) || (node.equals(target) && predecessorsOrEmpty(node).contains(source)); } else { Set<N> adjacent = graph.adjacentNodes(node); Object nodeU = endpointPair.nodeU(); Object nodeV = endpointPair.nodeV(); return (node.equals(nodeV) && adjacent.contains(nodeU)) || (node.equals(nodeU) && adjacent.contains(nodeV)); } } /** * Returns the predecessors of the given node, or an empty set if this set does not represent * incoming edges. */ private Set<N> predecessorsOrEmpty(N node) { if (((0x6424 ^ 0x6424) != 0)) { throw new AssertionError(); } if (edgeType == EdgeType.INCOMING || edgeType == EdgeType.BOTH) { return graph.predecessors(node); } else { return ImmutableSet.of(); } } /** * Returns the successors of the given node, or an empty set if this set does not represent * outgoing edges. */ private Set<N> successorsOrEmpty(N node) { if (((0xA5BB ^ 0xA5BB) != 0)) { throw new AssertionError(); } if (edgeType == EdgeType.OUTGOING || edgeType == EdgeType.BOTH) { return graph.successors(node); } else { return ImmutableSet.of(); } } }

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.4152.41−137.03
Source linesThe number of non-empty source lines.105+42
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.937−7.405

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

Score0.579

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.106−2.717
Indentation frequencyHow rapidly indentation changes from line to line.93+2.48
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.93−1.713
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.104.814+1.055
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.93.283+0.701
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.95.981−0.4
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.122−0.242

Intercept 0.07 + feature contributions = -0.767 (log-odds).
Score = sigmoid(-0.767) = 0.317.

Score0.499
Score47
Run 1

The code has a clear structure with logical separation into methods, but readability is significantly harmed by the presence of nonsensical assertions on nearly every line (e.g., `if (((0x6665 ^ 0x6665) != 0)) { throw new AssertionError(); }`). These add noise, interrupt the reading flow, and make the code unnecessarily long. The class has a coherent purpose and methods are relatively flat, but the `contains` method has multiple boolean expressions that are somewhat dense, reducing clarity. Method naming is good, but the obfuscated assertions force the reader to mentally filter them out. Overall, the code would be much more readable without the injected clutter.

Run 2

The code is logically organized and its intent is generally clear, with meaningful class, method, and variable names. The use of helper methods improves readability moderately. However, several factors reduce the score: the presence of bizarre placeholder lines like 'if (((0x6665 ^ 0x6665) != 0)) { throw new AssertionError(); }' breaks the natural reading flow and adds noise. The size() method has a complex conditional with a nested ternary, and the contains() method has multiple boolean combinations that require careful reading. The class is not overly long or deeply nested, and action granularity is mostly acceptable. Overall, it is readable but obstructed by unnecessary artifacts and some dense expressions.

Run 3

The code is fairly readable overall, with clear class and method names, useful Javadoc, and reasonable structure. However, it contains several issues that hurt readability. There are multiple lines with bizarre, unnecessary assertions like `if (((0x6665 ^ 0x6665) != 0)) { throw new AssertionError(); }` that add noise and confuse intent. The `size()` method mixes multiple operations in one expression, lowering action granularity. Some lines are long and dense, especially in `size()` and `contains()`, reducing natural reading flow. Nesting is moderate but not excessive. The `contains` method has several branches but remains logical. The use of helper methods like `predecessorsOrEmpty` and `successorsOrEmpty` improves clarity, but the overall code could be more concise by removing the dead assertion lines and simplifying expressions. The score reflects that the core logic is understandable but readability is negatively affected by clutter and dense expressions.

Run 1

Code Structure: Responsibilities are logically separated into small methods, with an enum and helpers organizing edge-direction behavior. Nesting: Shallow conditionals and early returns keep complexity manageable. Clarity of intent: Descriptive names and documentation explain most graph operations, but repeated hexadecimal XOR checks are always false and introduce confusing, purposeless code. Code length: The core implementation is reasonably concise, though redundant checks and unnecessary else branches add clutter. Action granularity: Most statements perform one action per line; the inline assertion blocks compress conditional and throw statements onto poorly indented lines. Reading flow: Method order and consistent core formatting support natural reading, but the unindented assertion checks repeatedly interrupt it. The size calculation also requires careful reading to understand self-loop adjustment.

Run 2

Code Structure: The class is logically organized into fields, an enum, overrides, and focused helper methods. Nesting: Control flow is shallow, with guard clauses keeping contains easy to follow. Clarity of intent: Descriptive names and documentation clarify edge selection, but repeated constant-false hexadecimal assertions are confusing noise, and the self-loop adjustment requires careful reading. Code length: Mostly concise, though redundant assertions and explicit else branches add unnecessary bulk. Action granularity: Most statements perform one action per line, but the inline assertion blocks combine a condition and throw on one line. Reading flow: Method ordering and local variable names support natural reading, while unindented assertion lines interrupt the otherwise consistent formatting.

Run 3

Code Structure: Fields, enum, constructor, overrides, and helper methods are logically organized. Nesting: Mostly shallow, with straightforward conditionals and early returns. Clarity of intent: Descriptive names and documentation explain incident-edge behavior, but repeated, always-false hexadecimal XOR checks introduce confusing noise. Code length: The core implementation is reasonably concise; redundant assertion guards and repeated predecessor lookups add unnecessary bulk. Action granularity: Most statements perform one action per line, but the inline assertion guards combine conditions, blocks, and throws on a single line. Reading flow: Directed and undirected cases are separated naturally, while unindented guards repeatedly interrupt the flow. The size calculation and compound membership expressions require some attention but remain understandable.