Sample
int-75f0fe74d47f-SRC
Unmodified source class
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 generally well-structured and readable. Methods are concise and follow single-responsibility principles, with clear naming that conveys intent. The class has a focused purpose as a metadata provider backed by ReplicaManager. Imports are organized, and error handling is consistent. However, there are a few minor issues: slightly verbose method calls with nested optional parameters reduce readability, and the endOffsetMetadata method uses if-else chains that could be simplified with a switch expression. The partition() helper method nicely consolidates leader validation, but the repeated emptiness checks across offset methods create some duplication. Overall, the code is maintainable and clear, though not exemplary.
Run 2
The code is well-structured with clear method separation and consistent naming. Each public method performs a single logical action (fetching offsets, adding listeners, etc.) with low nesting depth. The helper method 'partition' centralizes leader validation, reducing duplication. Method calls are multi-line and indented logically when they exceed one line, preserving readability. Comments explain non-obvious choices like isolation levels. The only minor issue is the three similar offset lookup methods, which include slight repetition, and the empty Optional use could be clarified, but overall the flow is natural and the intent is unambiguous.
Run 3
The code is well-structured and follows a clear, consistent pattern across methods. Each method has a single responsibility, methods are short, and nesting is minimal. Action granularity is good, with one primary operation per line mostly. Reading flow is natural and the class hierarchy aids clarity. Minor deductions: the exception-throwing pattern is slightly repetitive; the three offsetFor... methods could be refactored to reduce duplication, and the ternary-style if/else chain in endOffsetMetadata, while clear, could be a switch expression for conciseness. Overall, highly readable.
Run 1
Code Structure: Well-organized class with focused interface implementations and a shared partition-validation helper. Nesting: Shallow guard clauses and a simple conditional chain keep complexity low. Clarity of intent: Descriptive method and variable names, targeted comments, and explicit exceptions make behavior clear; boolean arguments and mixed Java/Scala optional types slightly obscure calls. Code length: Generally concise, although the three timestamp lookup methods repeat similar fetching and error-handling logic. Action granularity: Statements mostly perform one clear action, with only modest method chaining. Reading flow: Methods follow a natural lookup, metadata, and listener progression. Long invocation and exception lines, tightly packed imports, and omitted braces in endOffsetMetadata slightly reduce visual consistency.
Run 2
Code Structure: Well-organized implementation with focused public methods and a shared partition-validation helper. Nesting: Shallow conditionals and straightforward returns keep complexity low. Clarity of intent: Descriptive method and variable names, explicit exceptions, and useful isolation-level comments make behavior clear; boolean arguments and Java/Scala optional-type mixing introduce minor ambiguity. Code length: Mostly concise, although the three timestamp-offset methods repeat fetching and validation logic. Action granularity: Statements generally perform one action each, with a few chained calls that remain understandable. Reading flow: Consistent formatting and predictable method patterns support natural reading; long argument lists, exception-message lines, and unbraced conditionals slightly reduce scanability.
Run 3
Code Structure: Well-organized class with focused interface implementations and a shared partition-validation helper. Nesting: Minimal; simple guards and a shallow conditional chain keep control flow easy to follow. Clarity of intent: Descriptive method and variable names, explicit exceptions, and isolation-level comments communicate purpose clearly. Boolean arguments and mixed Java/Scala optional types slightly obscure API calls. Code length: Generally concise, although three timestamp lookup methods repeat retrieval and missing-offset handling. Action granularity: Statements mostly perform one action each; chained calls remain understandable, though long argument lists require closer reading. Reading flow: Consistent formatting and straightforward delegation support natural reading. Minor weaknesses include long exception lines, tightly packed imports, and omitted braces in endOffsetMetadata.