Sample
int-461304bfa06e-I02
Shorten method, parameter, and local names without collisions
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.49 | 0–1; higher is more readable |
| Dorn | 0.77 | 0–1; higher is more readable |
| Mi | 0.347 | 0–1; higher is more readable |
| LLOC | 25 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 15.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs |
| BTTF | 0.41 | 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. | 2844.562 | −93.871 |
| 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.426 | −6.639 |
Intercept 8.87 + feature contributions = -61.64 (log-odds).
Score = sigmoid(-61.64) = 0.
| Score | 0.49 |
|---|
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 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 106.961 | +0.921 |
| 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. | 106.987 | −0.866 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 74.87 | +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.088 | +0.089 |
Intercept 0.07 + feature contributions = 1.209 (log-odds).
Score = sigmoid(1.209) = 0.77.
| Score | 0.347 |
|---|
| Score | 25 |
|---|
Run 1
The code demonstrates clear intent with well-named methods (`partition`, `all`) and appropriate use of `KafkaFuture` for asynchronous operations. The structure is logical, separating per-partition and overall result handling. Nesting within `partition()` is moderate (3 levels) but controlled. However, `all()` contains redundant logic: it collects partitions, then iterates all values and throws only when a non-null error is found, making the `partitions` list unused until an error occurs. The message construction is slightly awkward with string concatenation. Action granularity is mostly one action per line; the lambda in `all()` could be simplified by filtering error entries directly. Overall the code is readable but could be improved by streamlining the error traversal and message building.
Run 2
The code is generally readable but has some issues. Structure is logical with clear separation between constructor and methods, though the class is simple. Nesting depth is moderate (3 levels in both methods), which is acceptable but could be improved. Intent is mostly clear from method names and documentation, but the use of generic parameter names like 'par', 'thr', 'exc2', and 'mes' reduces clarity. Code length is reasonable for the functionality. Action granularity is good in most places, but the lambda in all() combines multiple operations that could be extracted. Reading flow is natural overall, though the all() method's logic of collecting partitions before checking errors is slightly awkward. The variable naming inconsistency (sometimes 'par', sometimes 'partition'; 'fut' vs 'future') could confuse maintainers. Error handling logic is duplicated between the two methods.
Run 3
The code is generally well-structured with clear intent, appropriate use of Javadoc, and reasonable nesting. However, the 'all()' method contains a redundant stream operation to collect partitions before iterating values again, which slightly hurts readability and efficiency. Variable naming could be more descriptive (e.g., 'topic' instead of 'topicPartitionErrorsMap'). The logic in 'all()' has two separate iterations that could be combined, and error message construction could be simplified. The 'partition()' method is clean with clear branching. Overall the code is readable but has minor inefficiencies and naming clarity issues.
Run 1
Code Structure: The class is logically organized around a stored future and two focused result-access methods. Nesting: Both methods have moderate nesting within callbacks; nested error handling adds some complexity. Clarity of intent: Javadocs and method names clearly describe partition-specific and aggregate results, but abbreviated names such as par, res, thr, exc2, and mes reduce clarity, and topic misleadingly names a map. Code length: Generally concise, though aggregate error-message construction duplicates text and could be simplified. Action granularity: Statements generally perform one action per line, and the stream pipeline separates its operations clearly. Reading flow: Constructor-to-method ordering is natural, and success/error paths are understandable. However, collecting failed partitions before separately scanning errors requires tracking two traversals, while minor formatting inconsistencies slightly interrupt the flow.
Run 2
Code Structure: The class is logically organized around a shared future and two focused result-access methods. Nesting: Both methods have moderately nested conditionals inside callbacks, especially all(), increasing reading effort. Clarity of intent: Method names, types, and documentation explain the purpose, but abbreviated names such as par, res, thr, exc2, and mes reduce clarity; topic misleadingly names a partition-error map. Code length: Generally concise, though repeated exception construction and message handling add avoidable length. Action granularity: Statements typically perform one action per line, and the stream pipeline separates its operations clearly. Reading flow: Constructor-to-method ordering and explicit success/error branches are natural, but switching from a stream to a loop and then nested message checks slightly interrupts the flow. Overall, readable and well-contained, with naming and conditional simplification opportunities.
Run 3
Code Structure: The class is logically organized around a shared future, with separate methods for partition-specific and aggregate results. Nesting: Moderate nesting in callbacks, especially the loop and conditional branches in all(), adds cognitive overhead. Clarity of intent: Javadocs and public method names clearly convey purpose, but abbreviated variables such as par, res, exc2, and mes, plus the misleading map name topic, reduce clarity. Code length: Generally concise, though aggregate error-message construction is duplicated and could be simplified. Action granularity: Statements generally perform one action per line; the stream pipeline is sensibly broken across lines. Reading flow: Constructor-to-method ordering and straightforward error handling support natural reading, but inconsistent naming and minor formatting issues interrupt the flow.