Sample
int-5b17f851a535-I05
Rewrite eligible decimal integer literals in hexadecimal notation
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.453 | 0–1; higher is more readable |
| Dorn | 0.756 | 0–1; higher is more readable |
| Mi | 0.442 | 0–1; higher is more readable |
| LLOC | 25 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 15.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs |
| BTTF | 0.462 | 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. | 2825.028 | −93.226 |
| Source linesThe number of non-empty source lines. | 75 | +30 |
| 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.445 | −6.668 |
Intercept 8.87 + feature contributions = -61.024 (log-odds).
Score = sigmoid(-61.024) = 0.
| Score | 0.453 |
|---|
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. | 76 | −1.655 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 68 | +1.615 |
| 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. | 112 | −1.079 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 111.961 | +1.002 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 74.867 | +0.637 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.083 | +0.14 |
Intercept 0.07 + feature contributions = 1.128 (log-odds).
Score = sigmoid(1.128) = 0.756.
| Score | 0.442 |
|---|
| Score | 25 |
|---|
Run 1
The code is generally readable but has some issues. The class structure is clear with a single field and two public methods. However, the 'all()' method is problematic: it uses a stream to collect failed partitions but then iterates over ALL values with a traditional loop, creating redundancy. This method could be simplified by filtering the entrySet once. The lambda callbacks in both methods are moderately nested (3 levels deep), slightly impacting readability. Clarity of intent is mostly good, but the error message construction in 'all()' is verbose and duplicated. Code length is acceptable for the functionality, though the 'all()' method is unnecessarily long due to the dual iteration approach. Action granularity is reasonable in most places, but the error handling in 'all()' packs multiple operations into single lines. The reading flow is natural in 'partitionResult()' but becomes choppy in 'all()' due to the mixed streaming and imperative styles.
Run 2
The code is generally well-structured with clear separation of concerns, good use of Javadoc, and logical organization. The `partitionResult` method has acceptable nesting with a clear flow of error handling. However, the `all()` method has unnecessary complexity: it first collects failed partitions into a list, then loops through all values again to find the first error. This could be streamlined. The lambda in `all()` contains multiple operations and a conditional with duplicated code, reducing clarity. While naming is descriptive and imports are clean, the `all()` method's logic lacks optimal readability due to redundant iteration and duplicated exception-throwing branches. Overall, the code is maintainable but could be more concise and direct in its error aggregation logic.
Run 3
The code is well-structured with clear separation of concerns between partition-level and aggregate results. It uses a single level of nesting with flat, linear logic. Intent is explicit through method names and Javadoc comments. The lambda in `all()` is slightly long but still readable. One minor issue: the stream collects `partitionsFailed` but the subsequent loop iterates values rather than entries, making the collection of failed partitions feel slightly disconnected. Overall, clear and maintainable.
Run 1
Code Structure: The class is logically organized around a shared future, with separate methods for partition-specific and aggregate results. Nesting: Callback conditionals and the loop in all() introduce moderate nesting, but remain manageable. Clarity of intent: Descriptive names, types, and Javadoc make the purpose clear; asynchronous completion and exception conversion require some familiarity with Kafka. Code length: Generally concise, though repeated exception construction and message formatting could be consolidated. Action granularity: Statements mostly perform one action each, and the stream pipeline separates its operations across lines. Reading flow: Execution follows a natural progression from validation to completion or failure, although nested error handling slightly interrupts the flow. Minor formatting inconsistencies, including tightly packed imports and extra whitespace before a lambda body, reduce polish.
Run 2
Code Structure: The class cleanly separates per-partition results from aggregate results, with a simple constructor and focused methods. Nesting: Callback conditionals and the loop in all() introduce moderate nesting, but remain manageable. Clarity of intent: Descriptive method names, types, and Javadoc make the purpose clear; the null-as-success convention is implicit, and the generic field name future is less informative. Code length: Mostly concise, though aggregate failure handling duplicates message construction and traverses the map twice. Action granularity: Statements generally perform one action each, and the stream pipeline is split into readable steps. Reading flow: Execution follows a natural sequence from completion checks to success or failure handling. Minor spacing inconsistencies and nested error-message branches slightly interrupt an otherwise readable flow.
Run 3
Code Structure: The class is logically organized around a stored future and two focused result-access methods. Nesting: partitionResult has moderate conditional nesting, while all combines a callback, loop, and nested conditions; guard clauses could flatten these paths. Clarity of intent: Descriptive method and variable names, types, and Javadocs make the asynchronous success and failure behavior clear, though the null-as-success convention is implicit. Code length: Mostly concise, but all repeats exception construction and message text that could be consolidated. Action granularity: Statements generally perform one action each; the stream pipeline is clearly split across lines. Reading flow: Constructor-to-method ordering and consistent formatting support natural reading, although collecting failed partitions before separately scanning exceptions adds a small cognitive burden.