Sample
int-08d7d555897b-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.696 | 0–1; higher is more readable |
| Dorn | 0.364 | 0–1; higher is more readable |
| Mi | 0.478 | 0–1; higher is more readable |
| LLOC | 34 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 15 | 0–20; mean of three runs |
| GPT-6.1 Sol | 14 | 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. | 2413.594 | −79.649 |
| Source linesThe number of non-empty source lines. | 117 | +46.8 |
| 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.541 | −6.812 |
Intercept 8.87 + feature contributions = -30.79 (log-odds).
Score = sigmoid(-30.79) = 0.
| Score | 0.696 |
|---|
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. | 117 | −3.106 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 73 | +1.788 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 73 | −1.254 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 116.792 | +1.223 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 99.966 | +0.808 |
| 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. | 99.941 | −0.568 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.047 | +0.481 |
Intercept 0.07 + feature contributions = -0.558 (log-odds).
Score = sigmoid(-0.558) = 0.364.
| Score | 0.478 |
|---|
| Score | 34 |
|---|
Run 1
The code has a clear overall purpose and some useful documentation, but there are significant readability issues. Structure is mostly organized, but findRedundantOffset() is confusingly named and has convoluted logic with comments that don't fully clarify the algorithm. Action granularity is good, with one operation per line. However, there is a stray code block inside lastRedundantOffset() (the runningTotal loop) that is clearly dead code and severely hurts reading flow and intent. The updateState method modifies lastRedundantOffset before calculating a new value, which obscures the logic. Comments are verbose in places but don't help where most needed. LastRedundantOffset is returned as Optional but the method name suggests a direct value. Overall the code is maintainable but not immediately understandable without deeper analysis.
Run 2
The code is well-structured with clear class purpose, good documentation, and logical method separation. The updateState and findRedundantOffset methods have clear intent and manageable nesting. However, there is a suspicious unexplained block of code inside lastRedundantOffset() that appears to be an accidental copy-paste of a loop, which breaks reading flow and should be removed. Additionally, the findRedundantOffset logic relies on subtle invariants (e.g., soFar vs lastRedundantOffset comparison) that could confuse readers. The use of Optional is good, and the overall action granularity is reasonable but slightly verbose in comments. Minor improvements could flatten the updateState logic and clarify the redundant offset calculation.
Run 3
The code is highly readable with clear structure, logical organization, and well-documented intent. Classes and methods have descriptive names, comments explain non-obvious logic (like timeline usage and redundant offset calculation), and action granularity is appropriate—one main action per statement. Nesting is minimal, with only one loop and one conditional inside a helper method. The code length is concise for its functionality. The main flaw is an inexplicable, unrelated block of code inside `lastRedundantOffset()`—a local variable that sums numbers 1 to 5, serving no purpose and severely disrupting reading flow while likely being a copy-paste error. Otherwise, the class is exemplary in clarity, structure, and documentation.
Run 1
Code Structure: Fields, constructor, update logic, helper, and accessors are logically organized, but an unrelated summation block disrupts the getter. Nesting: Mostly shallow, with straightforward loops and conditionals; the extraneous block adds unnecessary nesting. Clarity of intent: Descriptive names and documentation explain offset tracking, although 'lastRedundantOffset' versus 'smallest necessary offset' creates boundary ambiguity, and 'soFar' is vague. Code length: Core logic is compact, but lengthy, repetitive comments and unused summation code add noise. Action granularity: Generally one operation per line, making state changes easy to identify. Reading flow: Method ordering and early returns support natural reading, but inconsistent indentation in the inserted block and subtle deletion-after-calculation sequencing require extra attention.
Run 2
Code Structure: Fields, constructor, update logic, and query methods are logically organized, but an unrelated summation block disrupts the accessor. Nesting: Generally shallow, with simple conditionals and a loop; the extraneous block adds unnecessary nesting. Clarity of intent: Descriptive names and documentation explain offset tracking, although lastRedundantOffset ambiguously denotes a redundancy boundary versus a redundant record. The unused runningTotal calculation has no apparent purpose. Code length: Core methods are concise, but lengthy comments and the unrelated loop add avoidable bulk. Action granularity: Statements generally perform one action per line, making individual operations easy to follow. Reading flow: The main update and minimum-offset calculation flow naturally, but inconsistent indentation in the accessor and excessive explanatory comments interrupt scanning.
Run 3
Code Structure: Fields, constructor, update logic, and query methods are logically organized, but an unrelated summation block disrupts lastRedundantOffset(). Nesting: Mostly shallow, with straightforward guards and loops; the stray block adds unnecessary nesting. Clarity of intent: Descriptive names and documentation explain offset tracking, though lastRedundantOffset describes a necessary boundary somewhat ambiguously, and runningTotal has no purpose or use. Code length: Implementation is reasonably concise, but verbose comments and the irrelevant loop add avoidable length. Action granularity: Statements generally perform one action per line, making updates easy to follow. Reading flow: Method ordering and early returns support natural reading, but inconsistent indentation in the inserted block and lengthy inline commentary interrupt the flow.