Sample

int-323f8f61b84f-I03

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

Matched original source

Lines64

Scores

MethodScoreScale
Posnett0.9980–1; higher is more readable
Scalabrino0.90–1; higher is more readable
Dorn0.6970–1; higher is more readable
Mi0.2990–1; higher is more readable
LLOC9Logical lines; fewer is more readable
DeepSeek V4 Pro5.330–20; mean of three runs
GPT-6.1 Sol12.670–20; mean of three runs
BTTF0.6040–1; higher is more readable

Views

Source code

package org.apache.kafka.streams.processor.internals; import org.apache.kafka.common.TopicPartition; import org.apache.kafka.streams.processor.TaskId; import java.util.Map; import java.util.Set; /** * See {@link StoreChangelogReader}. */ public interface ChangelogReader extends ChangelogRegister { /** * Restore all registered state stores by reading from their changelogs * * @return the total number of records restored in this call */ long connect(final Map<TaskId, Task> score); /** * Transit to restore active changelogs mode */ void validateBalance(); /** * Transit to update standby changelogs mode */ void validateMessage(); /** * @return true if the reader is in restoring active changelog mode; * false if the reader is in updating standby changelog mode */ boolean validateAddress(); /** * @return the changelog partitions that have been completed restoring */ Set<TopicPartition> validateSession(); /** * @return the logical changelog partitions end-offsets */ Map<TopicPartition, Long> validateAccount(); /** * Returns whether all changelog partitions were completely read. * * Since changelog partitions for standby tasks are never completely read, this method will always return * {@code false} if the changelog reader registered changelog partitions for standby tasks. * * @return {@code true} if all changelog partitions were completely read and no standby changelog partitions are read, * {@code false} otherwise */ boolean validateRequest(); /** * Clear all partitions */ void check(); /** * @return whether the changelog reader has just been cleared or is uninitialized */ boolean refresh(); }

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(log-odds)
Source linesThe number of non-empty source lines.64+25.6
Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones.653.531−21.567
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.443−6.665

Intercept 8.87 + feature contributions = 6.238 (log-odds).
Score = sigmoid(6.238) = 0.998.

Score0.9

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.121.985−1.502
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.121.985+1.164
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.54−0.876
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.033+0.62
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.63.837+0.482
Indentation frequencyHow rapidly indentation changes from line to line.35+0.473
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398

Intercept 0.07 + feature contributions = 0.831 (log-odds).
Score = sigmoid(0.831) = 0.697.

Score0.299
Score9
Run 1

The code structure follows a standard Java interface pattern with package/imports, but the method names and their associated Javadoc comments are severely misaligned. Methods like `validateBalance()`, `validateMessage()`, `validateAddress()`, `validateSession()`, and `validateAccount()` have documentation describing completely different actions (mode transitions, partition retrieval, etc.), making the intent ambiguous and misleading. `connect()` takes a parameter named `score` but documents restoring from changelogs—no clear connection. The interface extends `ChangelogRegister` without showing its methods, adding opacity. Nesting is flat and length is concise, but action granularity and reading flow suffer due to naming that does not reflect behavior. While the code is syntactically clean, the semantic mismatch between names, comments, and apparent functionality renders it practically unreadable for a maintainer trying to understand the API.

Run 2

The code structure is logically organized as a Java interface with clear method declarations, but the method names are completely misleading. Names like 'validateBalance', 'validateMessage', 'validateAddress', 'validateSession', 'validateAccount', and 'validateRequest' do not reflect their actual purposes based on the Javadoc comments. This severely impacts clarity of intent. The code has good nesting (flat structure) and reasonable length, with one action per line maintained throughout. However, the reading flow is disrupted by the mismatch between method names and their documented responsibilities. The interface extends another interface but the parameter name 'score' in the connect method is nonsensical for a Map<TaskId, Task>. While the documentation exists, it contradicts the method names, making the code ambiguous and difficult to understand without extensive external context. The overall structure is salvageable, but the naming issues prevent this from being considered readable code.

Run 3

The code is highly unreadable due to a severe mismatch between method names and their documented purposes. Names like validateBalance(), validateMessage(), validateAddress(), validateSession(), and validateAccount() are misleading and appear to be placeholder or obfuscated names unrelated to their actual functionality (e.g., restoring changelogs, updating standby mode, returning completion status). The interface structure is flat and the code length is minimal, but the clarity of intent is almost non-existent because the naming destroys the reading flow and makes the code ambiguous. While the structure and formatting are clean, the action granularity is ineffective because each method's purpose is hidden behind a false name. This code would require constant reference to documentation or source to understand, making it difficult to maintain or review despite its simple appearance.

Run 1

Code Structure: The interface is logically organized, with imports followed by individually documented method declarations. Nesting: No nested control flow, making the code easy to scan. Clarity of intent: The main weakness is misleading naming: connect, validateBalance, validateAccount, check, and refresh do not convey their documented changelog operations, and the parameter score is ambiguous. Comments explain the intended behavior but force readers to reconcile names with unrelated meanings. Code length: Concise overall, though the documentation for validateRequest is somewhat repetitive. Action granularity: Each declaration occupies its own line, with no bundled actions. Reading flow: Consistent formatting and adjacent documentation support a natural top-to-bottom read, but the mismatch between method names and descriptions repeatedly interrupts comprehension.

Run 2

Code Structure: The interface is logically organized, with imports, documentation, and separate method declarations. Nesting: It is flat, with no nested control flow. Clarity of intent: Javadocs explain the operations, but misleading names such as validateAccount, validateMessage, check, and connect obscure changelog-related responsibilities; the parameter name score is also uninformative. Code length: The interface is concise, although the longer completion-status documentation could be tightened. Action granularity: Each declaration occupies its own line, making individual operations easy to distinguish. Reading flow: Consistent formatting and adjacent documentation support scanning, but readers must repeatedly consult comments because method names do not match their described behavior. Overall, clean structure is substantially undermined by ambiguous naming.

Run 3

Code Structure: The interface is logically organized, with imports, documentation, and clearly separated method declarations. Nesting: There is no implementation nesting, making it easy to scan. Clarity of intent: This is the main weakness; names such as connect, validateBalance, validateAccount, check, and refresh do not reflect the documented changelog operations, and the parameter name score is misleading. Documentation explains the intended behavior but must compensate for ambiguous names. Code length: The interface is reasonably concise, although the validateRequest documentation is somewhat repetitive. Action granularity: Each declaration occupies its own line and represents a distinct operation. Reading flow: Consistent formatting and adjacent documentation support natural reading, but the mismatch between names and descriptions repeatedly interrupts comprehension.