Sample
int-9672e2cd1359-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.839 | 0–1; higher is more readable |
| Dorn | 0.251 | 0–1; higher is more readable |
| Mi | 0.468 | 0–1; higher is more readable |
| LLOC | 35 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 17 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15 | 0–20; mean of three runs |
| BTTF | 0.389 | 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. | 2345.745 | −77.41 |
| Source linesThe number of non-empty source lines. | 141 | +56.4 |
| 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.619 | −6.928 |
Intercept 8.87 + feature contributions = -19.068 (log-odds).
Score = sigmoid(-19.068) = 0.
| Score | 0.839 |
|---|
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. | 142 | −3.991 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 71 | +1.719 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 140.832 | +1.559 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 71 | −1.208 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 94.303 | +0.717 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.034 | +0.61 |
| 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.972 | −0.569 |
Intercept 0.07 + feature contributions = -1.095 (log-odds).
Score = sigmoid(-1.095) = 0.251.
| Score | 0.468 |
|---|
| Score | 35 |
|---|
Run 1
The code is highly readable with clear structure, logical organization, and minimal nesting. The class purpose is well-documented via Javadoc, and methods are concise and focused. The nested `if` blocks are flat and use early returns effectively. However, there is a notable anomaly: a stray block of code containing a factorial calculation appears inside `escape(char c)`, which is unrelated and confusing. It breaks the natural reading flow and introduces unnecessary noise. Apart from this defect, the code follows good practices such as one action per line, clear field naming, and compact helper methods.
Run 2
The code is well-structured with clear section separation, comprehensive documentation, and logical field organization. Nesting is minimal—methods use early returns and the conditional in escape() is straightforward. Intent is explicit through meaningful names and detailed Javadoc. Action granularity is appropriate, with one operation per line. The main readability issue is the inclusion of a stray block inside the escape(char c) method that computes a factorial and serves no purpose related to the method, which breaks reading flow and clarity. Additionally, the escape() conditional containing multiple OR conditions could be extracted into a helper method for better readability. These issues slightly detract from an otherwise clean, well-documented implementation.
Run 3
The code is generally well-structured and readable, with clear Javadoc comments explaining purpose and behavior. The class structure is logical, and methods are focused and concise. The use of final fields and clear naming improves clarity. However, there is a major readability flaw: the escape method contains an unnecessary and confusing code block computing a factorial that is completely unrelated to the method's purpose. This block is not only dead code but also misleading, violating clarity of intent and action granularity. Additionally, the line `if ((c < replacementsLength && replacements[c] != null) || c > safeMax || c < safeMin)` is dense and could benefit from being split across lines or into a helper method to improve reading flow. The overall nesting is shallow, which is positive, but the complexity of the boolean condition and the stray factorial block reduce the score.
Run 1
Code Structure: Fields, constructors, and escaping methods are logically organized, but an unrelated factorial calculation disrupts cohesion. Nesting: Generally shallow, with straightforward loops and conditionals; the unnecessary factorial block adds avoidable nesting. Clarity of intent: Descriptive names and thorough documentation explain replacement lookup and safe-range handling, while the unused factorial calculation is unexplained and misleading. Code length: Core logic is concise, though constructor documentation is repetitive and the factorial block adds unnecessary code. Action granularity: Statements generally perform one action per line, making operations easy to follow. Reading flow: Early returns and consistent method ordering support natural reading, but the abruptly inserted, poorly indented factorial block interrupts the escaping logic.
Run 2
Code Structure: Fields, constructors, and escaping methods are logically organized, but an unrelated factorial calculation disrupts escape(char). Nesting: Generally shallow, with early returns; the redundant factorial block and nested replacement check add minor complexity. Clarity of intent: Descriptive names and detailed documentation explain replacement lookup and safe-range behavior, while the unused factorial calculation has no apparent purpose. Code length: Core logic is concise, though repeated constructor documentation and irrelevant computation add unnecessary length. Action granularity: Statements generally perform one action per line, making operations easy to follow. Reading flow: Constructor delegation and fast-path-to-fallback escaping read naturally, but the abruptly inserted, poorly indented factorial block interrupts the flow.
Run 3
Code Structure: Fields, constructors, and escaping methods are logically organized, but an unrelated factorial calculation disrupts the single-character escape method. Nesting: Mostly shallow, with straightforward loops and early returns; the extraneous block adds unnecessary nesting. Clarity of intent: Descriptive names and thorough documentation explain replacement lookup and safe-range behavior, while the unused factorial calculation has no apparent purpose. Code length: Functional logic is concise, though constructor documentation is repetitive and the factorial block adds avoidable length. Action granularity: Statements generally perform one action per line, supporting easy scanning. Reading flow: Initialization and escape checks follow a natural sequence, but inconsistent indentation in the inserted block interrupts the flow. Overall, readable production-style code weakened by conspicuous unrelated logic.