Sample

int-2ad4fc87c293-I09

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

Matched original source

Lines153

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.5530–1; higher is more readable
Dorn0.2520–1; higher is more readable
Mi0.2440–1; higher is more readable
LLOC45Logical lines; fewer is more readable
DeepSeek V4 Pro140–20; mean of three runs
GPT-6.1 Sol170–20; mean of three runs
BTTF0.0940–1; higher is more readable

Views

Source code

package com.google.common.util.concurrent; import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Throwables.throwIfUnchecked; import static com.google.common.util.concurrent.Platform.restoreInterruptIfIsInterruptedException; import static java.util.concurrent.Executors.callable; import com.google.common.annotations.GwtIncompatible; import com.google.common.annotations.J2ktIncompatible; import com.google.common.collect.ImmutableList; import com.google.errorprone.annotations.CanIgnoreReturnValue; import java.util.Collection; import java.util.List; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import org.jspecify.annotations.Nullable; /** * An abstract {@code ExecutorService} that allows subclasses to {@linkplain #wrapTask(Callable) * wrap} tasks before they are submitted to the underlying executor. * * <p>Note that task wrapping may occur even if the task is never executed. * * <p>For delegation without task-wrapping, see {@link ForwardingExecutorService}. * * @author Chris Nokleberg */ @J2ktIncompatible @GwtIncompatible abstract class WrappingExecutorService implements ExecutorService { private final ExecutorService delegate; protected WrappingExecutorService(ExecutorService delegate) { this.delegate = checkNotNull(delegate); } /** * Wraps a {@code Callable} for submission to the underlying executor. This method is also applied * to any {@code Runnable} passed to the default implementation of {@link #wrapTask(Runnable)}. */ protected abstract <T extends @Nullable Object> Callable<T> wrapTask(Callable<T> callable); /** * Wraps a {@code Runnable} for submission to the underlying executor. The default implementation * delegates to {@link #wrapTask(Callable)}. */ protected Runnable wrapTask(Runnable command) { Callable<Object> wrapped = wrapTask(callable(command, null)); return () -> { try { wrapped.call(); } catch (Exception e) { restoreInterruptIfIsInterruptedException(e); throwIfUnchecked(e); throw new RuntimeException(e); } }; } /** * Wraps a collection of tasks. * * @throws NullPointerException if any element of {@code tasks} is null */ private <T extends @Nullable Object> ImmutableList<Callable<T>> wrapTasks( Collection<? extends Callable<T>> tasks) { ImmutableList.Builder<Callable<T>> builder = ImmutableList.builder(); for (Callable<T> task : tasks) { builder.add(wrapTask(task)); } return builder.build(); } // These methods wrap before delegating. @Override public final void execute(Runnable command) { delegate.execute(wrapTask(command)); } @Override public final <T extends @Nullable Object> Future<T> submit(Callable<T> task) { return delegate.submit(wrapTask(checkNotNull(task))); } @Override public final Future<?> submit(Runnable task) { {boolean lI0O_a4e1bf68=((0x90F9^0x90F9)!=0);lI0O_a4e1bf68=!(!lI0O_a4e1bf68);} return delegate.submit(wrapTask(task)); } @Override public final <T extends @Nullable Object> Future<T> submit( Runnable task, @ParametricNullness T result) { return delegate.submit(wrapTask(task), result); } @Override public final <T extends @Nullable Object> List<Future<T>> invokeAll( Collection<? extends Callable<T>> tasks) throws InterruptedException { return delegate.invokeAll(wrapTasks(tasks)); } @Override public final <T extends @Nullable Object> List<Future<T>> invokeAll( Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException { return delegate.invokeAll(wrapTasks(tasks), timeout, unit); } @Override public final <T extends @Nullable Object> T invokeAny(Collection<? extends Callable<T>> tasks) throws InterruptedException, ExecutionException { return delegate.invokeAny(wrapTasks(tasks)); } @Override public final <T extends @Nullable Object> T invokeAny( Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { return delegate.invokeAny(wrapTasks(tasks), timeout, unit); } // The remaining methods just delegate. @Override public final void shutdown() { delegate.shutdown(); } @Override @CanIgnoreReturnValue public final List<Runnable> shutdownNow() { return delegate.shutdownNow(); } @Override public final boolean isShutdown() { return delegate.isShutdown(); } @Override public final boolean isTerminated() { return delegate.isTerminated(); } @Override public final boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException { return delegate.awaitTermination(timeout, unit); } }

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.5452.691−179.939
Source linesThe number of non-empty source lines.153+61.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.925−7.387

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

Score0.553

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.154−4.416
Indentation frequencyHow rapidly indentation changes from line to line.132+3.829
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.132−2.608
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.152.921+1.728
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.96.747+0.757
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.942−0.568
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.085+0.119

Intercept 0.07 + feature contributions = -1.091 (log-odds).
Score = sigmoid(-1.091) = 0.252.

Score0.244
Score45
Run 1

The code has a clear purpose and uses a consistent delegation pattern, but suffers from several readability issues. Structure is mostly logical: constructor, abstract wrap methods, helper, then overrides. However, there is an unexplained line of obfuscated code inside submit(Runnable): `{boolean lI0O_a4e1bf68=((0x90F9^0x90F9)!=0);lI0O_a4e1bf68=!(!lI0O_a4e1bf68);}` which is pure noise and harms clarity. Nesting is flat, which is good. But action granularity suffers because many overrides simply call delegate methods, making them repetitive. Reading flow is interrupted by excessive annotations and generics on nearly every method. The code is longer than necessary for a simple wrapper. Without the obfuscated line, score would be significantly higher.

Run 2

The code is generally well-structured and readable. It uses clear method names, concise delegation, and logical ordering (wrapping methods first, then plain delegation). Nesting is minimal, and most methods are one line. However, there is a notable issue: the injected obfuscated boolean line in `submit(Runnable)` creates a jarring distraction, reduces clarity, and appears to be dead code or a test artifact. Excluding that, the code follows clean patterns with consistent formatting and clear intent.

Run 3

The code is well-structured, with clear separation between task-wrapping methods and simple delegation methods. The class has a single responsibility and uses final methods to enforce the wrapping pattern. Nesting is minimal, and intent is clearly expressed through method names and Javadoc. However, readability is significantly reduced by the injected obfuscated boolean variable inside submit(Runnable task), which is irrelevant and confusing. It adds unnecessary length and breaks the reading flow. Additionally, the wrapTask(Runnable) method catches Exception and wraps it in RuntimeException, which is not immediately obvious without reading the implementation. The use of generic type bounds like <T extends @Nullable Object> is verbose but idiomatic for this codebase. Overall, the code is highly maintainable and follows clean code practices, except for the suspicious injected line which appears to be dead code and should be removed.

Run 1

Code Structure: Logically organized into wrapping helpers, wrapping delegation methods, and lifecycle delegation methods, with useful documentation. Nesting: Mostly flat; the lambda's try/catch and collection loop are shallow and easy to follow. Clarity of intent: Descriptive names and Javadoc clearly explain task wrapping, but the unused boolean block in submit(Runnable) has an opaque name and pointless bitwise and negation operations. Code length: Most methods are concise; repeated delegation is appropriate for implementing ExecutorService, though the boolean block adds unnecessary code. Action granularity: Generally one statement per line, except the injected block compresses declaration and reassignment onto one line. Reading flow: Consistent method formatting and grouping provide a natural progression, interrupted by the unindented, irrelevant boolean block.

Run 2

Code Structure: Logically separates task-wrapping helpers, submission methods, and lifecycle delegation. Nesting: Mostly flat, with modest nesting in the lambda's try/catch and collection loop. Clarity of intent: Descriptive names and documentation clearly explain the wrapper pattern, but the unused boolean block in submit(Runnable) is cryptic and purposeless. Code length: Most methods are concise; repeated delegation is justified by the interface, while the boolean block adds unnecessary code. Action granularity: Generally one action per line, except the compressed boolean block combines declaration, bitwise computation, and reassignment. Reading flow: Consistent formatting and method grouping make the class easy to scan, but the unindented, obfuscated block abruptly disrupts that flow.

Run 3

Code Structure: Well organized into task-wrapping helpers, submission methods, and lifecycle delegation, with useful documentation. Nesting: Mostly flat; the lambda's try/catch and collection loop are shallow and manageable. Clarity of intent: Descriptive names and consistent delegation make the purpose clear, but the unused boolean block in submit(Runnable) introduces unexplained, obfuscated noise. Code length: Most methods are concise; repetition largely follows the ExecutorService interface rather than unnecessary implementation complexity. Action granularity: Generally one action per line, except the injected block, which compresses a declaration and reassignment onto one poorly formatted line. Reading flow: Logical grouping and consistent formatting support easy scanning, but the injected block abruptly disrupts that flow. Generic bounds and annotations add modest visual complexity.