Sample
Schnappinger/junit4/org.junit.internal.ArrayComparisonFailure
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 59.9Δ 9.6 |
| Scalabrino | 0.801 | 0–1; higher is more readable | 62.3Δ 7.1 |
| Dorn | 0.561 | 0–1; higher is more readable | 63.0Δ 6.4 |
| Mi | 0.766 | 0–1; higher is more readable | 92.7Δ 23.3 |
| LLOC | 23 | Logical lines; fewer is more readable | 55.9Δ 13.5 |
| DeepSeek V4 Pro | 17.33 | 0–20; mean of three runs | 73.9Δ 4.5 |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs | 73.8Δ 4.3 |
| BTTF | 0.666 | 0–1; higher is more readable | 71.3Δ 1.8 |
| Human | 3.95 | 1–4; original rating | 69.5 |
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. | 1297.07 | −42.803 |
| Source linesThe number of non-empty source lines. | 62 | +24.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.612 | −6.917 |
Intercept 8.87 + feature contributions = -16.051 (log-odds).
Score = sigmoid(-16.051) = 0.
| Score | 0.801 |
|---|
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. | 63 | −1.194 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 49 | +0.958 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 49 | −0.704 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 91.476 | +0.671 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 61.957 | +0.456 |
| 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. | 92.984 | −0.273 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.07 | +0.259 |
Intercept 0.07 + feature contributions = 0.244 (log-odds).
Score = sigmoid(0.244) = 0.561.
| Score | 0.766 |
|---|
| Score | 23 |
|---|
Run 1
The code is well-structured and follows clear object-oriented principles. The class has a single responsibility, with methods that are short and focused. Nesting is minimal, limited to a single loop and conditional check. Intent is clearly communicated through meaningful names, Javadoc comments, and overridden methods. Code length is appropriate, with no repetitive logic or unnecessary abstractions. Action granularity is good: each statement performs one logical action, especially in `getMessage()`. Reading flow is natural, moving from fields to constructor to methods, with override methods placed last. Minor deductions: the loop in `getMessage()` could theoretically use `String.join` or a helper, and the use of Hungarian-style 'f' prefix fields is outdated, but these do not significantly impair readability.
Run 2
The code is highly readable. It has a clear, logical structure with a single class and well-separated methods. Nesting is minimal; only one loop exists with no conditional depth. Intent is explicit through descriptive names like `addDimension`, `fIndices`, and thorough Javadoc. The code is concise — no dead code or unnecessary abstraction. Each line performs a distinct action, especially in `getMessage()` where appending operations are separated clearly. Reading flow is natural: fields, constructor, mutator, then overridden methods follow a logical order. Minor deductions: the use of the legacy prefix `f` for fields and direct `getCause().getMessage()` without a null-check could slightly reduce clarity, but overall it is very maintainable.
Run 3
The code is well-structured and readable. It follows a logical organization with clear field declarations, a well-documented constructor, and focused helper methods. Nesting is minimal; the only loop in getMessage() is flat and easy to follow. The intent is clearly stated through the class name, Javadoc, and method names like addDimension and getMessage. Code length is appropriate and avoids unnecessary verbosity. Each line performs a single clear action, especially in the message-building loop. Reading flow is natural — the constructor initializes state, addDimension mutates it cleanly, and getMessage composes the output step by step. Minor drawbacks are a slightly outdated naming convention (fIndices, fMessage) and possible confusion around the list insertion order, but overall the code is easy to understand and maintain.
Run 1
Code Structure: The class is logically organized into fields, construction, index tracking, and message formatting. Nesting: A single conditional and a simple loop keep nesting shallow. Clarity of intent: Descriptive method names and documentation explain the purpose, though legacy f-prefixed fields, sb, and each are less expressive, and prepending indices could use clarification. Code length: The implementation is concise, with only minor verbosity in documentation and separate append calls. Action granularity: Statements generally perform one action per line, making operations easy to follow. Reading flow: Methods progress naturally from initialization to message construction and string representation; the missing constructor documentation for message is a small inconsistency.
Run 2
Code Structure: The class is logically organized into fields, construction, index tracking, and message formatting. Nesting: A single conditional and a simple loop keep nesting shallow. Clarity of intent: The class name, documentation, and method names clearly communicate its purpose; however, f-prefixed fields and names like sb and each are less descriptive, and prepending indices could benefit from explanation. Code length: The implementation is compact with little unnecessary code, although some documentation is boilerplate. Action granularity: Statements generally perform one action per line, making operations easy to follow. Reading flow: Message construction follows a natural sequence from the optional prefix through array indices to the underlying cause, with consistent formatting throughout.
Run 3
Code Structure: The class is logically organized into fields, a constructor, and focused methods. Nesting: A single conditional and loop keep nesting shallow. Clarity of intent: The class documentation and method names clearly explain its purpose, though names such as fIndices, sb, and each are less descriptive, and prepending indices could benefit from a brief explanation. Code length: The implementation is concise, with little unnecessary code. Action granularity: Each statement performs one clear action; message construction is easy to inspect line by line. Reading flow: Initialization, dimension tracking, and message formatting follow a natural sequence. Minor documentation gaps, including the missing message parameter description, slightly reduce readability.