Sample
int-5d719c330842-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.628 | 0–1; higher is more readable |
| Dorn | 0.466 | 0–1; higher is more readable |
| Mi | 0.596 | 0–1; higher is more readable |
| LLOC | 30 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 8.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15 | 0–20; mean of three runs |
| BTTF | 0.42 | 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. | 2118.174 | −69.9 |
| Source linesThe number of non-empty source lines. | 63 | +25.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.904 | −7.357 |
Intercept 8.87 + feature contributions = -43.186 (log-odds).
Score = sigmoid(-43.186) = 0.
| Score | 0.628 |
|---|
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. | 64 | −1.23 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 53 | +1.096 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 53 | −0.795 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 96.406 | +0.751 |
| 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. | 97.984 | −0.485 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 62.778 | +0.468 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.098 | −0.011 |
Intercept 0.07 + feature contributions = -0.136 (log-odds).
Score = sigmoid(-0.136) = 0.466.
| Score | 0.596 |
|---|
| Score | 30 |
|---|
Run 1
The code has a clear structure with a private constructor, constants, and a well-documented public method. However, it contains a serious structural error: an extra nested block with a Fibonacci sequence calculation inside the constructor body, which is completely unrelated to the class purpose. This creates invalid syntax and severely hurts readability. The defaultValue method is flat and logically organized, with a clear if-else chain for primitive types, but the action granularity is inconsistent—multiple casts and returns share lines. The reading flow is mostly natural, but the stray block disrupts it. Clarity of intent is good in the method documentation and constant names. Code length is reasonable, though the if-else chain could be simplified with a switch or map. Overall, the unexpected constructor block makes the code confusing and undermines what would otherwise be fairly readable utility code.
Run 2
The code has a fatal structural flaw: a random Fibonacci sequence block is embedded inside the private constructor, breaking logical organization and reading flow. The actual `defaultValue` method uses a long if-else chain inside nested conditionals, which is repetitive and reduces clarity. There are stray extra braces, indicating tangled code. The method intent is somewhat clear but obscured by the lengthy primitive-type checks and unnecessary boxing for types with cached constants. Action granularity is okay in the method body but the closure braces are poor. Overall, the code is difficult to read and maintain due to the structural anomaly and verbose conditional logic.
Run 3
The code is generally clear and well-structured, with a logical class purpose and a straightforward if-else chain in defaultValue. However, there is a significant structural flaw: a stray, nonsensical block appears inside the private constructor, containing unrelated Fibonacci-like logic. This confuses intent and breaks reading flow. The if-else chain, while flat and easy to follow, is somewhat repetitive and could benefit from a switch or map. Method documentation is helpful, and variable names are clear. Overall readability is moderate—mostly understandable, but the misplaced block is a notable issue.
Run 1
Code Structure: The utility class, constants, and default-value method are logically organized, but the constructor contains an unrelated sequence calculation with poorly formatted braces. Nesting: The main method has manageable two-level nesting; the constructor adds an unnecessary nested block. Clarity of intent: Documentation, descriptive names, and explicit primitive-type checks make the main purpose clear, while the unused constructor calculation is distracting and unexplained. Code length: The type-dispatch chain is reasonably concise for its task, but the constructor adds needless lines. Action granularity: Statements generally perform one action per line, supporting easy scanning. Reading flow: The ordered checks and consistent return patterns read naturally, though the constructor's indentation and irrelevant logic interrupt an otherwise clean flow.
Run 2
Code Structure: The utility class and default-value method are logically organized, but the unrelated Fibonacci-style calculation in the private constructor disrupts cohesion. Nesting: The main method has modest nesting; the constructor adds an unnecessary block with poorly aligned braces. Clarity of intent: Documentation, descriptive names, and explicit type checks clearly communicate the main purpose, while the unused constructor calculation is unexplained. Code length: The type-specific branches are reasonably concise, but the constructor adds unnecessary code. Action granularity: Statements generally perform one action per line, making operations easy to follow. Reading flow: The primitive checks follow a predictable sequence and end naturally with null, but inconsistent constructor indentation and minimal spacing around imports interrupt the flow.
Run 3
Code Structure: The utility class and default-value method are logically organized, but the unrelated Fibonacci calculation in the private constructor disrupts cohesion. Nesting: The primitive check and conditional chain have manageable depth; the constructor adds an unnecessary nested block. Clarity of intent: Documentation, descriptive names, and explicit type comparisons clearly explain the main functionality, while the unused constructor calculation is unexplained. Code length: The type-handling chain is reasonably concise, but the constructor contains unnecessary code. Action granularity: Statements generally perform one action per line, making operations easy to follow. Reading flow: The main method follows a predictable sequence, but inconsistent constructor indentation and stray-looking braces interrupt the otherwise natural flow.