Sample
int-5dca0a3da3d9-I05
Rewrite eligible decimal integer literals in hexadecimal notation
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.461 | 0–1; higher is more readable |
| Dorn | 0.707 | 0–1; higher is more readable |
| Mi | 0.038 | 0–1; higher is more readable |
| LLOC | 39 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 16.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs |
| BTTF | 0.464 | 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. | 4819.225 | −159.034 |
| Source linesThe number of non-empty source lines. | 103 | +41.2 |
| 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.757 | −7.135 |
Intercept 8.87 + feature contributions = -116.099 (log-odds).
Score = sigmoid(-116.099) = 0.
| Score | 0.461 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 99 | +2.687 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 104 | −2.646 |
| 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. | 142.99 | −2.391 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 142.981 | +1.502 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 102.854 | +1.028 |
| 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.073 | +0.233 |
Intercept 0.07 + feature contributions = 0.881 (log-odds).
Score = sigmoid(0.881) = 0.707.
| Score | 0.038 |
|---|
| Score | 39 |
|---|
Run 1
The code is highly readable with a clear, logical structure and class-level responsibility. Methods are short, focused, and follow a consistent pattern for error handling. Nesting is minimal, with if/else branches in only two small methods. The intent is explicit, supported by descriptive method names, comments, and specific exception messages. Action granularity is mostly one action per line, though the final method chains a logger call with a throw; minor. The helper method `partition` effectively centralizes partition fetching and leader validation, reducing duplication. The lack of early returns in `endOffsetMetadata` is acceptable given its concise branching structure. Overall, the code demonstrates strong adherence to readability principles, with only minor verbosity in the repeated timestamp fetch blocks, which are still clear and understandable.
Run 2
The code is generally readable, with clear method names indicating intent, consistent formatting, and shallow nesting. The class has a single responsibility and uses helper methods effectively. However, there is some duplication across offsetForEarliestTimestamp, offsetForLatestTimestamp, and offsetForTimestamp that could be consolidated. The offset fetching logic is slightly dense due to multiple arguments on separate lines, and the empty-check pattern repeats. Error messages are clear. Overall the code is well-structured and maintainable, but not maximally concise.
Run 3
The code is generally readable with clear class purpose and well-named methods. Structure is logical, grouping related offset methods and partition helpers. Nesting is minimal. However, there are repeated code patterns across offsetForEarliestTimestamp, offsetForLatestTimestamp, and offsetForTimestamp—each calls fetchOffsetForTimestamp, checks for empty, and throws an exception. This duplication could be extracted into a helper method to improve conciseness and reduce cognitive load. The endOffsetMetadata method uses an if-else chain that could be a switch statement for clarity. Import organization is slightly cluttered, and line lengths in some method calls exceed typical readability standards. Overall, the code is readable but could benefit from minor refactoring to eliminate duplication and improve flow.
Run 1
Code Structure: Well-organized class with focused interface implementations and a shared partition-validation helper. Nesting: Shallow conditionals and early exceptions keep control flow simple. Clarity of intent: Descriptive method and variable names, explanatory isolation comments, and specific exception messages make behavior clear; positional boolean arguments are less obvious. Code length: Generally concise, although the three timestamp lookup methods repeat fetching and validation logic. Action granularity: Statements mostly perform one clear action, with a few chained calls and long argument lists requiring extra attention. Reading flow: Methods follow a consistent pattern and delegation is straightforward. Minor drawbacks include unbraced conditionals in endOffsetMetadata, long lines, and tightly packed imports.
Run 2
Code Structure: Well-organized, focused implementation with short interface methods and a shared partition-validation helper. Nesting: Minimal; simple guards and shallow conditional branches keep complexity low. Clarity of intent: Descriptive method and variable names, explanatory isolation-level comments, and informative exceptions make behavior clear. Boolean arguments and Java/Scala optional-type mixing introduce minor ambiguity. Code length: Generally concise, although the three timestamp lookup methods repeat fetching and error-handling logic. Action granularity: Statements generally perform one clear action; chained fetch/result extraction slightly increases density. Reading flow: Consistent formatting and straightforward delegation support natural reading. Long argument lists and exception-message lines, unbraced conditional branches, and minimally separated imports slightly reduce readability.
Run 3
Code Structure: Well-organized provider implementation with focused methods and a shared partition lookup helper. Nesting: Shallow conditionals and straightforward returns keep complexity low. Clarity of intent: Descriptive method and variable names, explicit exceptions, and isolation-level comments clearly communicate purpose; boolean arguments and mixed Java/Scala optional types introduce minor ambiguity. Code length: Mostly concise, although the three timestamp lookup methods repeat fetching and error-handling patterns. Action granularity: Statements generally perform one clear action; chained fetch calls and lengthy argument lists slightly increase reading effort. Reading flow: Consistent method layout and predictable delegation make the code easy to follow. Long exception lines, tightly packed imports, and omitted braces in endOffsetMetadata slightly reduce visual consistency.