Sample

int-86d6f9da4472-SRC

Unmodified source class

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.670–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

This is highly readable code. The package structure is clear, the import is appropriate, and the class-level documentation succinctly states its purpose. The interface has no nesting or complex logic; it simply declares three methods. Each method represents a single, clearly named action, with no ambiguity in intent or parameters. The code is concise and avoids any unnecessary length. The reading flow is natural: documentation, declaration, then method signatures in logical order (increment, add, sum). It adheres perfectly to Java interface conventions.

Run 2

The code is a small, well-structured interface definition. It has a clear package and import, a concise Javadoc explaining the purpose, and three straightforward method signatures. There is no nesting, the intent is immediately obvious, and the formatting follows standard Java conventions. Each method declaration is on its own line, contributing to a natural reading flow.

Run 3

The code is highly readable due to its clear separation of interface declaration, documentation, and method signatures. It follows a natural reading flow: package statement, import, Javadoc with purpose and author, annotation, and then a concise interface definition. Each method is on its own line with a clear name (increment, add, sum) and appropriate parameters. There is zero nesting, minimal length, and the intent is unambiguous—defining a contract for concurrent long addition. Action granularity is perfect: one operation per method. The only minor deductions are the lack of a newline between import and Javadoc and the absence of explicit modifiers (e.g., public), though these are acceptable for package-private interfaces.

Run 1

Code Structure: A logically organized interface with a package declaration, import, documentation, annotation, and three methods. Nesting: Minimal, with only the interface body. Clarity of intent: The interface name, documentation, and method names clearly convey concurrent accumulation of long values, though the parameter name 'x' and unspecified concurrency semantics leave minor ambiguity. Code length: 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 2

Code Structure: A small, logically organized interface with a package declaration, import, documentation, annotation, and method declarations. Nesting: Flat, with only the interface body. Clarity of intent: Documentation and descriptive method names clearly convey concurrent accumulation of long values; the parameter name 'x' is less descriptive, and 'Abstract interface' is redundant. Code length: Concise, with no unnecessary implementation detail. 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 logically organized interface with three related operations and minimal imports. Nesting: No nested control flow; only the interface scope. Clarity of intent: The documentation and method names clearly convey adding long values and retrieving their sum, though the parameter name 'x' is generic and concurrency semantics are not detailed. Code length: Concise, with no unnecessary implementation or boilerplate. Action granularity: Each method declaration occupies its own line. Reading flow: Methods progress naturally from incrementing to adding an arbitrary value to obtaining the sum, with blank lines separating declarations.