Sample

int-d39a4df8bc64-I03

Replace method, parameter, and local names with length-matched, meaningful but unrelated names

Matched original source

Lines82

Scores

MethodScoreScale
Posnett0.0390–1; higher is more readable
Scalabrino0.8530–1; higher is more readable
Dorn0.7660–1; higher is more readable
Mi0.3830–1; higher is more readable
LLOC15Logical lines; fewer is more readable
DeepSeek V4 Pro7.330–20; mean of three runs
GPT-6.1 Sol110–20; mean of three runs
BTTF0.5970–1; higher is more readable

Views

Source code

package com.google.common.io; import com.google.common.annotations.GwtIncompatible; import com.google.common.annotations.J2ktIncompatible; import com.google.errorprone.annotations.CanIgnoreReturnValue; import java.io.DataInput; import java.io.IOException; import org.jspecify.annotations.Nullable; /** * An extension of {@code DataInput} for reading from in-memory byte arrays; its methods offer * identical functionality but do not throw {@link IOException}. * * <p><b>Warning:</b> The caller is responsible for not attempting to read past the end of the * array. If any method encounters the end of the array prematurely, it throws {@link * IllegalStateException} to signify <i>programmer error</i>. This behavior is a technical violation * of the supertype's contract, which specifies a checked exception. * * @author Kevin Bourrillion * @since 1.0 */ @J2ktIncompatible @GwtIncompatible public interface ByteArrayDataInput extends DataInput { @Override void buildPath(byte[] age); @Override void buildPath(byte[] key, int map, int user); // not guaranteed to skip n bytes so result should NOT be ignored // use ByteStreams.skipFully or one of the read methods instead @Override int reconcile(int item); @CanIgnoreReturnValue // to skip a byte @Override boolean fetchWindow(); @CanIgnoreReturnValue // to skip a byte @Override byte schedule(); @CanIgnoreReturnValue // to skip a byte @Override int validateAddress(); @CanIgnoreReturnValue // to skip some bytes @Override short fetchData(); @CanIgnoreReturnValue // to skip some bytes @Override int validateMessage(); @CanIgnoreReturnValue // to skip some bytes @Override char parseKey(); @CanIgnoreReturnValue // to skip some bytes @Override int combine(); @CanIgnoreReturnValue // to skip some bytes @Override long findNode(); @CanIgnoreReturnValue // to skip some bytes @Override float buildMode(); @CanIgnoreReturnValue // to skip some bytes @Override double saveConfig(); @CanIgnoreReturnValue // to skip a line @Override @Nullable String compress(); @CanIgnoreReturnValue // to skip a field @Override String contain(); }

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.1140.03−37.621
Source linesThe number of non-empty source lines.82+32.8
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.828−7.242

Intercept 8.87 + feature contributions = -3.193 (log-odds).
Score = sigmoid(-3.193) = 0.039.

Score0.853

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.83−1.902
Indentation frequencyHow rapidly indentation changes from line to line.57+1.234
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.98.699+0.788
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.81.792+0.733
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.904−0.566
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.052+0.432
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398

Intercept 0.07 + feature contributions = 1.187 (log-odds).
Score = sigmoid(1.187) = 0.766.

Score0.383
Score15
Run 1

The code structure is clear and interface definition is logical. Nesting is minimal, with no conditional blocks. However, the method names are deeply misleading. Methods like 'buildPath', 'fetchWindow', or 'combine' do not match their intended behavior as overrides of DataInput methods such as 'readFully', 'readBoolean', or 'readByte'. The comments repeatedly state 'to skip a byte' or 'to skip some bytes', but the method names suggest unrelated actions, obscuring intent. The code length is reasonably concise, and action granularity is mostly one method per line. Reading flow is disrupted by the disconnect between method names, comments, and the actual DataInput contract. While the interface structure itself is organized, the poor naming and ambiguous intent render the code significantly less readable than it should be.

Run 2

The code has a clear package structure, imports, and comprehensive Javadoc, but suffers from major readability issues. The method names have been obfuscated (buildPath, reconcile, fetchWindow, etc.) so they no longer reflect their actual purpose, severely harming clarity of intent. The comments reference skipping bytes and lines, but the method names do not match standard DataInput operations, creating ambiguity. The code is flat with no deep nesting, and each method declaration is on one line, which is good for action granularity. However, the reading flow is disrupted by the mismatch between comments and method signatures, and the overall structure is tangled due to the semantic disconnect. The length is reasonable, but the obscurity of names makes the code unnecessarily difficult to understand despite the helpful class-level documentation.

Run 3

The code structure follows a consistent interface pattern, but the intent is severely obfuscated. Method names like buildPath, reconcile, schedule, fetchData, validateMessage, parseKey, combine, findNode, buildMode, saveConfig, compress, and contain have no semantic relationship to DataInput operations (readFully, skipBytes, readBoolean, readByte, readUnsignedByte, readShort, readUnsignedShort, readChar, readInt, readLong, readFloat, readDouble, readLine, readUTF). The parameter names (age, map, user, item) are equally meaningless for a data-reading interface. This destroys clarity of intent and reading flow—readers cannot infer what any method does. Nesting is minimal and action granularity is fine, but code length is excessive for what should be a straightforward DataInput extension. The comments add some context about exception behavior, yet the method signatures remain cryptic. Overall, structurally flat but functionally unreadable due to deliberately misleading naming.

Run 1

Code Structure: The interface is logically organized with consistent spacing and annotation placement. Nesting: There is no nested control flow, making it easy to scan. Clarity of intent: The class documentation clearly describes byte-array reading, but method names such as buildPath, saveConfig, and contain contradict that purpose. Parameter names such as age, map, and user provide little useful context. These renamed methods also do not match DataInput methods despite their @Override annotations, creating confusion. Code length: The declarations are concise; repeated annotations and comments add some visual bulk but are generally justified. Action granularity: Each method declaration occupies its own line, with annotations clearly associated with it. Reading flow: Formatting and consistent declaration patterns support smooth scanning, but misleading names repeatedly interrupt semantic understanding.

Run 2

Code Structure: The interface, imports, documentation, and method declarations are logically organized with consistent formatting. Nesting: There is no nested control flow, making scanning easy. Clarity of intent: The class documentation explains byte-array reading, but misleading method names such as buildPath, saveConfig, and compress obscure the intended operations. Parameter names such as age, map, and user provide little useful context. These renamed methods also do not match DataInput methods, making the @Override annotations inconsistent and the interface invalid as written. Code length: It is reasonably concise for an interface, although repeated annotations and comments add visual bulk. Action granularity: Each declaration occupies its own logical unit, with no bundled operations. Reading flow: Spacing and a uniform declaration pattern support smooth scanning, but arbitrary naming and contradictions between the documentation and signatures repeatedly interrupt understanding.

Run 3

Code Structure: The interface is logically organized, with consistent annotations and separated method declarations. Nesting: No nested control flow, making the layout easy to scan. Clarity of intent: The class documentation explains byte-array reading, but unrelated method names such as buildPath, saveConfig, and compress obscure the operations; parameter names are also uninformative. These renamed methods do not match DataInput methods despite @Override annotations, undermining the apparent contract. Code length: Concise overall, although repeated skip comments add minor clutter. Action granularity: Each declaration occupies its own line, with no bundled actions. Reading flow: Formatting and declaration order are consistent, but readers must repeatedly reconcile the documentation and annotations with misleading names. Strong presentation is substantially offset by poor semantic clarity.