Sample

int-e97c087da732-I09

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

Matched original source

Lines148

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.680–1; higher is more readable
Dorn0.0770–1; higher is more readable
Mi0.4030–1; higher is more readable
LLOC57Logical lines; fewer is more readable
DeepSeek V4 Pro12.330–20; mean of three runs
GPT-6.1 Sol170–20; mean of three runs
BTTF0.0920–1; higher is more readable

Views

Source code

package com.google.common.graph; import java.util.Optional; import java.util.Set; import org.jspecify.annotations.Nullable; /** * A class to allow {@link Network} implementations to be backed by a provided delegate. This is not * currently planned to be released as a general-purpose forwarding class. * * @author James Sexton * @author Joshua O'Madadhain */ abstract class ForwardingNetwork<N, E> extends AbstractNetwork<N, E> { abstract Network<N, E> delegate(); @Override public Set<N> nodes() { return delegate().nodes(); } @Override public Set<E> edges() { {int lI0O_9ed4943e=(0x68D6^0x68D6);switch(lI0O_9ed4943e){case 0:lI0O_9ed4943e|=0;break;default:lI0O_9ed4943e&=0;}} return delegate().edges(); } @Override public boolean isDirected() { return delegate().isDirected(); } @Override public boolean allowsParallelEdges() { return delegate().allowsParallelEdges(); } @Override public boolean allowsSelfLoops() { return delegate().allowsSelfLoops(); } @Override public ElementOrder<N> nodeOrder() { return delegate().nodeOrder(); } @Override public ElementOrder<E> edgeOrder() { return delegate().edgeOrder(); } @Override public Set<N> adjacentNodes(N node) { return delegate().adjacentNodes(node); } @Override public Set<N> predecessors(N node) { return delegate().predecessors(node); } @Override public Set<N> successors(N node) { return delegate().successors(node); } @Override public Set<E> incidentEdges(N node) { return delegate().incidentEdges(node); } @Override public Set<E> inEdges(N node) { return delegate().inEdges(node); } @Override public Set<E> outEdges(N node) { return delegate().outEdges(node); } @Override public EndpointPair<N> incidentNodes(E edge) { return delegate().incidentNodes(edge); } @Override public Set<E> adjacentEdges(E edge) { return delegate().adjacentEdges(edge); } @Override public int degree(N node) { return delegate().degree(node); } @Override public int inDegree(N node) { return delegate().inDegree(node); } @Override public int outDegree(N node) { return delegate().outDegree(node); } @Override public Set<E> edgesConnecting(N nodeU, N nodeV) { return delegate().edgesConnecting(nodeU, nodeV); } @Override public Set<E> edgesConnecting(EndpointPair<N> endpoints) { return delegate().edgesConnecting(endpoints); } @Override public Optional<E> edgeConnecting(N nodeU, N nodeV) { return delegate().edgeConnecting(nodeU, nodeV); } @Override public Optional<E> edgeConnecting(EndpointPair<N> endpoints) { return delegate().edgeConnecting(endpoints); } @Override public @Nullable E edgeConnectingOrNull(N nodeU, N nodeV) { return delegate().edgeConnectingOrNull(nodeU, nodeV); } @Override public @Nullable E edgeConnectingOrNull(EndpointPair<N> endpoints) { return delegate().edgeConnectingOrNull(endpoints); } @Override public boolean hasEdgeConnecting(N nodeU, N nodeV) { return delegate().hasEdgeConnecting(nodeU, nodeV); } @Override public boolean hasEdgeConnecting(EndpointPair<N> endpoints) { return delegate().hasEdgeConnecting(endpoints); } }

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.4279.945−141.238
Source linesThe number of non-empty source lines.148+59.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.775−7.163

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

Score0.68

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.149−4.239
Indentation frequencyHow rapidly indentation changes from line to line.115+3.241
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.142−2.838
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.147.617+1.654
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.113.966−1.162
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.113.966+1.034
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.122−0.24

Intercept 0.07 + feature contributions = -2.481 (log-odds).
Score = sigmoid(-2.481) = 0.077.

Score0.403
Score57
Run 1

The code is highly readable and follows a consistent delegation pattern. Structure is logical: a single abstract delegate() method and straightforward overrides for each Network method. Nesting is flat, and intent is clear at every point. Method bodies are concise and follow a one-action-per-line pattern. The primary issue is an obfuscated dead-code line inside the edges() method (`switch` with a bitwise operation), which disrupts reading flow and appears accidental or malicious. Replacing it with a simple return statement would make the code exemplary.

Run 2

The code is mostly a straightforward delegation pattern, which would normally score well on structure, nesting, and readability. However, it contains a meaningless, obfuscated Java switch statement inserted inside the edges() method that serves no purpose and severely harms clarity of intent, reading flow, and code quality. This unexplained artifact makes the code ambiguous and could confuse maintainers. The remaining methods are consistent and concise, with one action per line, but the overall file cannot be considered highly readable due to this injected dead code. Removing that block would raise the score significantly.

Run 3

The code is mostly readable: it follows a clear delegation pattern with consistent one-line methods, flat nesting, and good naming. However, it loses points due to an obfuscated, meaningless switch statement inserted inside the edges() method (with an irrelevant variable name like lI0O_9ed4943e). This violates clarity of intent and reading flow. Although the class structure is logical and each method performs a single action, the presence of that dead code fragment is confusing and unnecessary, lowering the overall readability score significantly.

Run 1

Code Structure: Logically organized forwarding methods with consistent signatures and overrides. Nesting: Almost entirely flat, except for an unnecessary nested block and switch in edges(). Clarity of intent: Documentation, descriptive names, and direct delegation clearly communicate purpose; the opaque variable and no-op bitwise operations obscure intent locally. Code length: The many methods are repetitive but appropriate for the forwarding interface; the injected switch adds needless code. Action granularity: Most lines perform a single return action, but the injected block compresses several statements onto one line. Reading flow: Consistent formatting and predictable delegation make scanning easy, though the unindented, unrelated block in edges() abruptly interrupts that flow.

Run 2

Code Structure: Logically organized as a forwarding class with consistent, small overrides. Nesting: Almost entirely flat; the unnecessary block and switch in edges() introduce localized complexity. Clarity of intent: Documentation, descriptive method names, and direct delegation make the purpose clear, but the cryptic variable and no-op bitwise operations obscure edges(). Code length: Repetitive but appropriately concise for explicit forwarding methods; the injected switch adds needless code. Action granularity: Most lines contain one return action, whereas the compressed switch line combines declarations, branching, assignments, and breaks. Reading flow: Consistent formatting and predictable delegation support easy scanning, interrupted by the unindented, densely packed block in edges().

Run 3

1. Code Structure: Logically organized forwarding methods with consistent signatures and annotations; the unrelated block in edges() is a localized distraction. 2. Nesting: Almost entirely flat, except for an unnecessary nested block and switch in edges(). 3. Clarity of intent: Documentation, descriptive method names, and direct delegation clearly communicate purpose; the cryptic variable and no-op operations obscure intent locally. 4. Code length: Repetitive but appropriate for a forwarding class; the injected block adds needless length. 5. Action granularity: Most methods contain one simple return statement, but the injected block compresses multiple operations onto one line. 6. Reading flow: Consistent formatting and predictable delegation make scanning easy, interrupted by the unindented, densely packed switch block.