Sample
int-95dd5b61c175-I02
Shorten method, parameter, and local names without collisions
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.94 | 0–1; higher is more readable |
| Dorn | 0.647 | 0–1; higher is more readable |
| Mi | 0.714 | 0–1; higher is more readable |
| LLOC | 28 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 6.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 13.33 | 0–20; mean of three runs |
| BTTF | 0.545 | 0–1; higher is more readable |
Views
Loading feature diagnosis…
Source regions
Feature contributions
Feature contributions
| Feature | Value | Contribution (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. | 2096.68 | −69.19 |
| Source linesThe number of non-empty source lines. | 114 | +45.6 |
| 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.384 | −6.577 |
Intercept 8.87 + feature contributions = -21.297 (log-odds).
Score = sigmoid(-21.297) = 0.
| Score | 0.94 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 115 | −3.035 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 73 | +1.788 |
| 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. | 120.983 | −1.459 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 113.934 | +1.183 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 120.991 | +1.148 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.044 | +0.516 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
Intercept 0.07 + feature contributions = 0.608 (log-odds).
Score = sigmoid(0.608) = 0.647.
| Score | 0.714 |
|---|
| Score | 28 |
|---|
Run 1
The code has good documentation and a logical interface structure, but suffers from severe readability issues in naming and abstraction. Method names like 'mil()', 'nan()', 'sle()', 'tim()', and 'wait2()' are cryptic abbreviations that obscure intent. Parameter names like 'con', 'obj', 'fut', 'timeout2', and 'deadline2' are similarly ambiguous. The wait() method uses an infinite loop with multiple exit points, making control flow harder to follow. wait2() has complex timeout handling logic with a nullable TimeoutException variable, creating tangled flow. The import of java.time.Duration appears unused. While each method generally performs one action per line and nesting is moderate, the overall naming scheme and abbreviated identifiers significantly hamper clarity and maintainability. The code would benefit from descriptive names and clearer control flow patterns.
Run 2
The code is extremely difficult to read due to heavily abbreviated and non-descriptive method and parameter names (e.g., 'mil', 'nan', 'sle', 'con', 'tim', 'wait2', 'deadline2'). This severely obscures the intent of the code, despite the presence of Javadoc comments. The original naming from Kafka's Time interface (milliseconds, nanoseconds, sleep, waitObject) is concise but clear; replacing them with arbitrary abbreviations destroys clarity. Structure and nesting are acceptable, but the reading flow is broken by having to constantly map cryptic names to their meanings. The overall score is low primarily because code readability fundamentally depends on self-documenting names.
Run 3
The code has some structure with clear sections and Javadoc comments, but many method and parameter names are excessively abbreviated (mil, nan, sle, con, tim, wait2, fut, deadline2), obscuring intent. Comments do not compensate for ambiguous naming. The Time interface mixes several unrelated responsibilities (time retrieval, sleeping, condition waiting, future waiting), reducing logical organization. Some methods are reasonably flat, but wait2 contains a loop with nested try-catch and ternary throw, harming flow. Action granularity is mostly acceptable, though several lines combine multiple actions. The code is not excessively long but lacks consistency in naming style and clarity of purpose.
Run 1
Code Structure: Logically organized as a clock abstraction, with related operations grouped into small methods. Nesting: Mostly flat; synchronization, loops, and conditionals create moderate nesting in the waiting methods. Clarity of intent: Documentation explains the purpose, but abbreviated names such as mil, nan, sle, tim, con, and fut, plus arbitrary suffixes like wait2 and deadline2, obscure meaning. Several documentation parameter names do not match the signatures. Code length: Implementations are concise, though documentation is comparatively lengthy and timer comments repeat. Action granularity: Statements generally perform one action per line, making execution easy to follow. Reading flow: Consistent formatting and method separation support natural reading, but cryptic naming, omitted conditional braces, and the retry behavior in wait2 require extra interpretation.
Run 2
Code Structure: The interface logically groups clock access, sleeping, timers, and waiting, with small, focused methods. Nesting: Mostly shallow; the synchronized waiting loop and future retry loop introduce manageable nesting. Clarity of intent: Documentation explains behavior, but abbreviated names such as mil, nan, sle, tim, con, and fut obscure intent. Names like wait2, timeout2, and deadline2 are particularly uninformative. Several documentation parameter names do not match the actual signatures, and hi references a nonexistent nanoseconds method name. Code length: Implementations are concise; extensive documentation is generally useful rather than redundant. Action granularity: Statements typically perform one action per line, although the conditional exception expression requires slightly more interpretation. Reading flow: Method ordering and whitespace support natural reading, but inconsistent naming, omitted braces on some conditionals, and unusual signature formatting interrupt it.
Run 3
Code Structure: Methods are logically grouped in a small clock abstraction, with timing and waiting responsibilities clearly separated. Nesting: Mostly flat; the synchronized loop and conditional checks introduce moderate, manageable nesting. Clarity of intent: Documentation explains behavior well, but abbreviated names such as mil, nan, sle, tim, con, and wait2 obscure purpose. Several Javadoc parameter names do not match the actual signatures, reducing trust and clarity. Code length: Implementations are concise; lengthy documentation is generally useful rather than redundant. Action granularity: Statements typically perform one action per line, although the conditional exception expression requires extra interpretation. Reading flow: Consistent formatting and early returns support natural reading, but arbitrary numeric suffixes, omitted conditional braces, and inconsistent method-signature layout create friction.