Sample
int-c56d83d18040-I05
Rewrite eligible decimal integer literals in hexadecimal notation
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.918 | 0–1; higher is more readable |
| Dorn | 0.651 | 0–1; higher is more readable |
| Mi | 0.726 | 0–1; higher is more readable |
| LLOC | 28 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 17.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs |
| BTTF | 0.599 | 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. | 2107.815 | −69.558 |
| 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.421 | −6.631 |
Intercept 8.87 + feature contributions = -21.719 (log-odds).
Score = sigmoid(-21.719) = 0.
| Score | 0.918 |
|---|
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.991 | −1.46 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 113.861 | +1.182 |
| 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.042 | +0.535 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
Intercept 0.07 + feature contributions = 0.625 (log-odds).
Score = sigmoid(0.625) = 0.651.
| Score | 0.726 |
|---|
| Score | 28 |
|---|
Run 1
The code is highly readable with clear structure and intent. It is a well-documented interface with logical organization of methods, flat nesting levels, and natural reading flow. Each method has a single purpose and concise implementation. The waitForFuture method demonstrates clean handling of timeout logic with minimal nesting. Documentation is thorough without being excessive, explaining both purpose and edge cases. Minor deductions for slight verbosity in some comments and the multi-line method signature in waitForFuture.
Run 2
The code is highly readable. Structure is logical: interface constants, core time methods, then default utility methods (waitObject, timer, waitForFuture) that build on those primitives. Nesting is moderate but acceptable—waitObject uses a synchronized block with an inner loop, and waitForFuture uses a try/catch inside a loop, but neither is deeply confusing. Clarity of intent is strong, aided by Javadoc that explains non-obvious behaviors like negative nanoseconds or the caller's responsibility to notify. Code length is reasonable and avoids redundancy by converting Duration to millis. Action granularity is mostly one action per line, though some lines (e.g., the timeout throw with ternary) are slightly dense. Reading flow is natural, progressing from simple to more complex utilities. Minor deductions: the future wait method uses an exception variable as a control flag, which is slightly obscure, and some Javadoc references a TimeoutException that isn't fully validated by the method signature alone.
Run 3
The code is well-structured and highly readable. It clearly separates concerns with focused methods, flat nesting, and descriptive naming. The interface is logically organized, with related methods grouped together and comprehensive Javadoc explaining intent, especially for non-obvious behavior like `waitObject` and `waitForFuture`. Action granularity is appropriate—most lines perform a single coherent step. The main readability issue is slight verbosity in Javadoc (e.g., the long explanation for `nanoseconds()`), but this aids clarity for an abstract clock API. The `waitForFuture` method is slightly more complex due to loop and exception handling, but remains understandable. Overall, the code demonstrates excellent structure, clear intent, and natural reading flow.
Run 1
Code Structure: The interface logically groups clock operations, timers, and waiting helpers into small, cohesive methods. Nesting: Most methods are flat; waitObject has moderate nesting from synchronization, looping, and condition checks, while waitForFuture remains manageable. Clarity of intent: Descriptive names and thorough documentation clearly distinguish wall-clock and monotonic time. The retry behavior and retained timeout exception in waitForFuture could benefit from a brief explanation. Code length: Implementations are concise, and the longer documentation provides useful context rather than unnecessary verbosity. Action granularity: Each statement performs one clear action, with no compressed multi-statement lines. Reading flow: Methods generally progress naturally from basic clock access to higher-level utilities. Minor distractions include inconsistent parameter formatting, omitted braces on short conditionals, and the fully qualified timeout exception name.
Run 2
Code Structure: The interface is logically organized into clock access, sleeping, condition waiting, and timer/future utilities. Nesting: Most methods are flat; waitObject has moderate nesting through synchronization, a loop, and condition checks. Clarity of intent: Descriptive method names, explicit time units, and useful documentation make the purpose clear, though waitForFuture's timeout retry behavior could use explanation. Code length: Implementations are concise; documentation is extensive but largely justified by timing semantics. Action granularity: Statements generally perform one action per line, with no compressed multi-statement lines. Reading flow: Consistent spacing and small methods support natural reading. Minor distractions include unbraced conditionals, the fully qualified timeout exception, and slightly inconsistent method-signature formatting.
Run 3
Code Structure: The interface logically groups clock access, sleeping, timers, and waiting utilities into focused methods. Nesting: Most methods are flat; waitObject and waitForFuture have moderate, manageable nesting. Clarity of intent: Descriptive names, explicit time-unit suffixes, and useful documentation make the API clear, though retrying future.get after a timeout could benefit from an explanatory comment. Code length: Implementations are concise; extensive documentation is mostly justified by timing semantics. Action granularity: Statements generally perform one action per line, with no compressed multi-statement lines. Reading flow: Consistent organization and short methods support natural reading. Minor distractions include inconsistent braces on conditionals, unusual multiline parameter formatting, and a conditional expression inside a throw statement.