Sample
int-9206c0d41636-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.786 | 0–1; higher is more readable |
| Dorn | 0.488 | 0–1; higher is more readable |
| Mi | 0.217 | 0–1; higher is more readable |
| LLOC | 11 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 9 | 0–20; mean of three runs |
| GPT-6.1 Sol | 13.33 | 0–20; mean of three runs |
| BTTF | 0.38 | 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. | 1327.786 | −43.817 |
| Source linesThe number of non-empty source lines. | 70 | +28 |
| Byte entropyHow varied the bytes in the source text are. Repeated bytes give a lower value; a more even mixture gives a higher value. | 5.173 | −7.76 |
Intercept 8.87 + feature contributions = -14.707 (log-odds).
Score = sigmoid(-14.707) = 0.
| Score | 0.786 |
|---|
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. | 71 | −1.478 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 103.958 | +0.873 |
| 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. | 103.972 | −0.739 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 42 | +0.716 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 69.848 | +0.567 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 42 | −0.543 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.047 | +0.488 |
Intercept 0.07 + feature contributions = -0.046 (log-odds).
Score = sigmoid(-0.046) = 0.488.
| Score | 0.217 |
|---|
| Score | 11 |
|---|
Run 1
The class begins with a clear, well-documented structure typical of Spring Framework code, but readability is severely compromised by an extraneous code block inside the setObjectMapper method. This block appears to be accidental or misplaced code that counts even numbers, completely unrelated to the method's purpose. It introduces unnecessary nesting (method > block > loop > conditional) and confuses the reading flow. While the rest of the code is concise with single-action lines, this anomaly breaks clarity of intent. The deprecated annotations and Javadoc are well-formatted, but the stray logic makes the overall code appear tangled and ambiguous. Removing the unrelated block would greatly improve the score.
Run 2
The code contains a severe structural error: an unrelated block of loop logic is injected inside the setObjectMapper method, disrupting functionality and readability. The class structure itself is logical with clear Javadocs, constructors, and overridden method, but the injected code fragment breaks the method's purpose. Nesting is generally flat except for the erroneous loop's if statement. The intent is clear for the class as a whole, but the misplaced loop is completely ambiguous. The code is otherwise concise and follows Spring conventions, with good action granularity and natural reading flow up to the error point. The accidental inclusion of unrelated code is a critical readability and correctness issue.
Run 3
The code is largely readable but contains a critical flaw: an unrelated code block (counting even numbers) is incorrectly inserted inside the `setObjectMapper` method, disrupting logical organization and reading flow. This block is deeply misplaced, creating ambiguity about intent and reducing clarity. The rest of the code is well-structured, with clear Javadocs, shallow nesting, and concise methods. However, the extraneous nested block breaks the flow and violates action granularity by mixing unrelated logic. Without this erroneous insertion, the code would be highly readable; with it, the score drops significantly.
Run 1
Code Structure: Constructors and mapper configuration are logically organized, but an unrelated counting block disrupts the setter. Nesting: Most code is flat; the extra block, loop, and conditional introduce unnecessary nesting. Clarity of intent: Names, documentation, and CBOR validation clearly communicate the converter's purpose, while the unused even-number count has no apparent relevance. Code length: The implementation is otherwise concise, but the counting block adds needless lines. Action granularity: Statements generally perform one action per line, making individual operations easy to follow. Reading flow: Constructor delegation and validation flow naturally; inconsistent indentation and irrelevant logic in setObjectMapper interrupt that flow.
Run 2
Code Structure: The class is logically organized into constructors and an overridden setter, but an unrelated counting block disrupts cohesion. Nesting: Most code is flat; the setter introduces an unnecessary block containing a loop and conditional. Clarity of intent: Naming, documentation, and CBOR validation clearly explain the converter, but the unused evenNumberCount obscures the setter's purpose. Code length: The converter implementation is concise, though the counting block adds unnecessary lines. Action granularity: Statements generally perform one action per line; the conventional for-loop header remains easy to understand. Reading flow: Constructors followed by the setter provide a natural sequence, but inconsistent indentation and the unrelated block interrupt that flow.
Run 3
Code Structure: Constructors and the override are logically organized, but an unrelated counting block disrupts the setter. Nesting: Most code is flat; the redundant block, loop, and conditional introduce unnecessary nesting. Clarity of intent: Names, documentation, and factory validation clearly express the converter's purpose, but the unused evenNumberCount obscures the setter's intent. Code length: The converter is concise overall, though the counting block adds needless code. Action granularity: Statements generally perform one action per line, making individual operations easy to follow. Reading flow: Constructor delegation and validation flow naturally, but inconsistent indentation and the irrelevant block interrupt reading.