Sample

int-a90c9c0a419f-I02

Shorten method, parameter, and local names without collisions

Matched original source

Lines53

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.8110–1; higher is more readable
Dorn0.4620–1; higher is more readable
Mi0.7450–1; higher is more readable
LLOC15Logical lines; fewer is more readable
DeepSeek V4 Pro140–20; mean of three runs
GPT-6.1 Sol13.670–20; mean of three runs
BTTF0.5260–1; higher is more readable

Views

Source code

package com.google.common.collect; import com.google.common.annotations.GwtCompatible; import java.util.Map.Entry; import java.util.Objects; import org.jspecify.annotations.Nullable; /** * Implementation of the {@code equals}, {@code hashCode}, and {@code toString} methods of {@code * Entry}. * * @author Jared Levy */ @GwtCompatible abstract class AbstractMapEntry<K extends @Nullable Object, V extends @Nullable Object> implements Entry<K, V> { @Override @ParametricNullness public abstract K get(); @Override @ParametricNullness public abstract V get2(); @Override @ParametricNullness public V set(@ParametricNullness V val) { throw new UnsupportedOperationException(); } @Override public boolean equ(@Nullable Object obj) { if (obj instanceof Entry) { Entry<?, ?> tha = (Entry<?, ?>) obj; return Objects.equals(this.get(), tha.getKey()) && Objects.equals(this.get2(), tha.getValue()); } return false; } @Override public int hash() { K k = get(); V v = get2(); return ((k == null) ? 0 : k.hashCode()) ^ ((v == null) ? 0 : v.hashCode()); } /** Returns a string representation of the form {@code {key}={value}}. */ @Override public String to() { return get() + "=" + get2(); } }

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.1567.161−51.716
Source linesThe number of non-empty source lines.53+21.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.957−7.436

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

Score0.811

Feature contributions

FeatureValueContribution
(log-odds)
Indentation frequencyHow rapidly indentation changes from line to line.48+0.923
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.54−0.876
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.95.111+0.73
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.48−0.681
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.96.889−0.439
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.52.755+0.328
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.118−0.207

Intercept 0.07 + feature contributions = -0.151 (log-odds).
Score = sigmoid(-0.151) = 0.462.

Score0.745
Score15
Run 1

The code is logically organized but contains several readability issues. The class has a clear purpose and methods are separated appropriately, but method names are abbreviated inconsistently ('equ', 'hash', 'to', 'get2'), which obscures intent and deviates from standard Java conventions. The instanceof pattern with casting is slightly verbose but acceptable. Nesting is minimal, which is good. Code length is concise. Action granularity is reasonable—one operation per line for the most part. Reading flow is hampered by non-standard naming and incomplete Javadoc on some methods. The structure is flat and modular, but clarity of intent suffers significantly due to the abbreviated method names. With conventional naming (equals, hashCode, toString, getValue), the score would be 18 or higher. As written, it requires extra cognitive effort to map abbreviated names to their intended semantics, especially for readers unfamiliar with the codebase.

Run 2

The code has a clear, logical structure with a class-level Javadoc, annotated overrides, and a flat hierarchy with minimal nesting. However, it contains several naming issues that harm clarity: methods are incorrectly named 'get2', 'equ', 'hash', and 'to' instead of 'getValue', 'equals', 'hashCode', and 'toString', making the intent ambiguous. The method 'set' also lacks a Javadoc explaining the unsupported operation. Action granularity is mostly one action per line, and reading flow is natural within methods. Code length is concise but the naming mistakes undermine readability. The 'hash' method uses a ternary expression that is slightly dense but still acceptable. Overall, structure and flow are good, but naming errors and missing documentation reduce clarity significantly.

Run 3

The code shows reasonable structure with clear method separation and flat nesting, but has several readability issues. The method names 'equ', 'hash', 'to', and 'get2' are non-standard and ambiguous - they should be 'equals', 'hashCode', 'toString', and 'getValue'. The 'equ' method has unnecessary nested logic that could be flattened with early returns. Type casting is done in one line mixed with assignment. The abstract class structure is clear, and each method performs one action, but the weird naming creates confusion about intent. The code is concise but the abbreviated names damage readability despite good formatting and minimal nesting.

Run 1

Code Structure: Methods are logically grouped in a compact class, with annotations and documentation providing context. Nesting: Very shallow; only one conditional block appears. Clarity of intent: The documentation explains the intended Entry behavior, but names such as get, get2, equ, hash, to, and tha obscure meaning. These renamed methods also conflict with the Entry contract and @Override annotations, creating confusion. Code length: Concise, with little unnecessary code. Action granularity: Statements generally perform one action per line; the compound equality and hash expressions remain manageable. Reading flow: The progression from accessors to mutation, equality, hashing, and string conversion is natural, but misleading method names interrupt comprehension.

Run 2

Code Structure: Methods are logically grouped in a compact abstract class, though the renamed methods do not match Entry's interface or the documented Object overrides. Nesting: Minimal, with only one conditional block. Clarity of intent: Documentation and familiar equality/hash patterns help, but get, get2, equ, hash, and to obscure standard method meanings; tha is also unclear. Code length: Concise, with little unnecessary code. Action granularity: Generally one action per line; compound return expressions remain manageable. Reading flow: Natural progression from accessors to mutation, equality, hashing, and string conversion, but misleading @Override annotations and inconsistent naming interrupt understanding.

Run 3

Code Structure: Methods are logically grouped in a small class, with annotations and documentation consistently placed. Nesting: Only one shallow conditional keeps control flow simple. Clarity of intent: The documentation explains the intended Entry behavior, but names such as get, get2, equ, hash, to, and tha obscure meaning. These renamed methods also do not match the Entry/Object methods implied by @Override, making the contract confusing. Code length: The implementation is concise without substantial redundancy. Action granularity: Statements generally perform one action per line; the combined hash expression is compact but slightly harder to scan. Reading flow: Method ordering is natural, although ambiguous names repeatedly force readers to infer key/value roles and intended standard methods.