Sample

int-92c2ae7f87a0-I09

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

Matched original source

Lines16

Scores

MethodScoreScale
Posnett0.8840–1; higher is more readable
Scalabrino0.9670–1; higher is more readable
Dorn0.8490–1; higher is more readable
Mi0.770–1; higher is more readable
LLOC3Logical lines; fewer is more readable
DeepSeek V4 Pro19.330–20; mean of three runs
GPT-6.1 Sol190–20; mean of three runs
BTTF0.6910–1; higher is more readable

Views

Source code

package com.google.common.cache; import com.google.common.annotations.GwtCompatible; /** * Abstract interface for objects that can concurrently add longs. * * @author Louis Wasserman */ @GwtCompatible interface LongAddable { void increment(); void add(long x); long sum(); }

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(log-odds)
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.704−7.055
Source linesThe number of non-empty source lines.16+6.4
Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones.187.296−6.181

Intercept 8.87 + feature contributions = 2.034 (log-odds).
Score = sigmoid(2.034) = 0.884.

Score0.967

Feature contributions

FeatureValueContribution
(log-odds)
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.65.941+0.872
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.17+0.434
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
Indentation frequencyHow rapidly indentation changes from line to line.12−0.322
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.66+0.26
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.076+0.203
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.15.806−0.189

Intercept 0.07 + feature contributions = 1.727 (log-odds).
Score = sigmoid(1.727) = 0.849.

Score0.77
Score3
Run 1

The code is exceptionally readable. It is a small, highly focused interface with a clear purpose: defining operations for concurrent long addition. The package and import are minimal and correct, and the Javadoc succinctly explains the abstraction. The methods are named using standard conventions (`increment`, `add`, `sum`) and have unambiguous signatures. No nesting exists, and action granularity is ideal—one declaration per line. The structure follows standard Java interface organization, and the reading flow is natural: documentation, then method declarations in a logical order. Concise without being terse.

Run 2

The code is exceptionally readable. It defines a small, focused interface with a clear purpose. The structure is logical, with a package declaration, a single import, and a concise Javadoc comment explaining the interface's intent. There is no nesting, and each method declaration occupies its own line, demonstrating excellent action granularity. The method names (increment, add, sum) clearly convey their actions, and the overall length is minimal. The reading flow is natural and easy to follow.

Run 3

The code is highly readable. It is well-structured as a small, focused interface with a clear package declaration and a single relevant import. The nesting is flat, with no control structures or conditional logic. The intent is immediately clear from the interface name 'LongAddable', the Javadoc comment, and the self-explanatory method names like 'increment', 'add', and 'sum'. The code is concise, avoiding any unnecessary methods or fields. Each action is declared on its own line, following standard Java formatting. The reading flow is natural, moving from package declaration to import, then to type declaration and methods. The only minor deductions are due to the lack of detailed Javadocs for the individual methods, but the interface's purpose is simple enough that this does not significantly impact clarity.

Run 1

Code Structure: The interface is logically organized, with its package, import, documentation, annotation, and method declarations clearly separated. Nesting: Only a single interface scope exists, so there is no complex nesting. Clarity of intent: The documentation and method names clearly communicate a concurrent long-value accumulator, though the parameter name 'x' is generic and the comment's phrase 'Abstract interface' is redundant. Code length: The code is concise without unnecessary implementation details. Action granularity: Each method declaration occupies its own line. Reading flow: The conventional declaration order and blank lines between methods make the code easy to scan; a blank line after the package declaration would slightly improve formatting.

Run 2

Code Structure: The package, import, documentation, annotation, and interface are logically organized. Nesting: Only one interface level, with no nested logic. Clarity of intent: LongAddable and its increment, add, and sum methods clearly communicate their purpose; the parameter name x and limited method documentation leave minor ambiguity. Code length: Extremely concise, with no unnecessary implementation or boilerplate. Action granularity: Each method declaration occupies its own line. Reading flow: Natural top-to-bottom progression, with blank lines separating methods; a blank line between the package and import would slightly improve formatting.

Run 3

Code Structure: A single, logically organized interface with three related operations. Nesting: No nested control flow or unnecessary structural depth. Clarity of intent: The interface documentation and method names clearly communicate long-value accumulation, though concurrency guarantees and sum semantics are not specified. Code length: Minimal and appropriate for the interface. Action granularity: Each method declaration occupies its own line. Reading flow: Package, import, documentation, annotation, and methods appear in a natural order; a blank line between the package and import would slightly improve formatting.