Sample
int-91d1c3685055-I08
Select one of ten high-readability unrelated code templates per class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.442 | 0–1; higher is more readable |
| Dorn | 0.19 | 0–1; higher is more readable |
| Mi | 0.038 | 0–1; higher is more readable |
| LLOC | 43 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 11 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15 | 0–20; mean of three runs |
| BTTF | 0.363 | 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. | 5083.518 | −167.756 |
| Source linesThe number of non-empty source lines. | 110 | +44 |
| 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.772 | −7.158 |
Intercept 8.87 + feature contributions = -122.044 (log-odds).
Score = sigmoid(-122.044) = 0.
| Score | 0.442 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 106 | +2.929 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 111 | −2.894 |
| 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.982 | −2.391 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 106 | −2.012 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 142.991 | +1.503 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 109.896 | +1.126 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.075 | +0.217 |
Intercept 0.07 + feature contributions = -1.451 (log-odds).
Score = sigmoid(-1.451) = 0.19.
| Score | 0.038 |
|---|
| Score | 43 |
|---|
Run 1
The code is generally structured and readable, with clear method names and minimal nesting. However, there are several issues that reduce readability. The leaderEpoch method contains a completely unrelated code block (a loop calculating a running total) that is not part of the intended functionality, which severely impacts clarity and is confusing. The endOffsetMetadata method lacks braces for its if-else statements, which reduces readability and increases risk of errors. Some methods have slightly long lines, though not excessively so. The import of scala.Some is used inconsistently, with Optional.empty() used in one place and new Some<>() in another. Overall, the code structure is decent and methods have clear intent, but the unexplained loop and inconsistent style choices prevent a higher score.
Run 2
The code is generally readable with clear method names and logical organization. However, it contains a random, unrelated code block inside the leaderEpoch method that severely impacts readability - it appears to be leftover debug code that has no purpose. This breaks the reading flow and clarity of intent. The methods are concise and follow a consistent pattern, with each performing a single action. The nesting is minimal with only simple if-else checks. Variable names are descriptive. The code would score higher without the extraneous block, which creates confusion about the method's actual purpose.
Run 3
The code has a clear overall structure and purpose, but contains a critical flaw. An unrelated loop computing a running total is accidentally inserted inside the leaderEpoch() method, which is dead code that severely damages readability and confuses intent. Beyond that, there are issues: repeated timestamp-fetching logic is not factored out, leading to redundancy; the use of both Scala Option and Java Optional is inconsistent; method calls are chained across lines without intermediate variables, hurting clarity; and ternary or switch logic in endOffsetMetadata could be clearer. The action granularity is mostly reasonable, but the accidental block, inconsistent exception messages, and mixed types make the flow unnatural. While parts are readable, the dead-code insertion and redundancy reduce clarity significantly.
Run 1
Code Structure: Mostly well-organized, with focused methods and a shared partition lookup helper, but an unrelated summation block disrupts leaderEpoch. Nesting: Generally shallow; the unnecessary block and loop add avoidable nesting. Clarity of intent: Descriptive method names, types, and isolation comments clarify behavior, while the unused runningTotal calculation and boolean arguments obscure intent. Code length: Mostly concise, though three timestamp methods repeat similar fetch-and-validation logic, and the summation adds needless code. Action granularity: Statements generally perform one action each; chained fetch calls remain understandable but are somewhat dense. Reading flow: Method ordering and consistent patterns support natural reading, but the summation block's inconsistent indentation, long lines, tightly packed imports, and unbraced conditional branches reduce consistency.
Run 2
Code Structure: Methods are logically organized around partition metadata operations, but leaderEpoch contains an unrelated summation block. Nesting: Mostly flat, with simple conditionals; the unnecessary block and loop add avoidable nesting. Clarity of intent: Descriptive names, interface overrides, and isolation comments clarify purpose, while the unused runningTotal and boolean arguments obscure intent. Code length: Generally concise, although three timestamp methods duplicate fetching and error-handling logic. Action granularity: Statements generally perform one action each, with moderately dense chained calls. Reading flow: Consistent method patterns make the class easy to follow, but the poorly indented summation block sharply interrupts that flow; long lines and unbraced conditionals also slightly reduce readability.
Run 3
Code Structure: Methods are logically separated by metadata operation, with a shared partition-validation helper, but leaderEpoch contains an unrelated summation block. Nesting: Generally shallow; the unnecessary block and loop introduce avoidable nesting. Clarity of intent: Descriptive method and variable names, useful isolation comments, and explicit exceptions communicate purpose well. The unused runningTotal calculation and positional boolean arguments obscure intent. Code length: Most methods are concise, although timestamp lookup and error-handling logic are repeated across three methods. Action granularity: Statements generally perform one action each; chained calls and long argument lists slightly increase reading effort. Reading flow: Consistent method patterns support scanning, but the abruptly unindented summation block disrupts flow. Long lines, uneven import grouping, and omitted braces in the isolation conditional modestly reduce readability.