Sample
Schnappinger/junit4/org.junit.experimental.results.ResultMatchers
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 56.2Δ 13.3 |
| Scalabrino | 0.785 | 0–1; higher is more readable | 59.2Δ 16.3 |
| Dorn | 0.564 | 0–1; higher is more readable | 63.7Δ 20.8 |
| Mi | 0.41 | 0–1; higher is more readable | 25.1Δ 17.8 |
| LLOC | 20 | Logical lines; fewer is more readable | 59.7Δ 16.8 |
| DeepSeek V4 Pro | 16.33 | 0–20; mean of three runs | 53.1Δ 10.2 |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs | 73.8Δ 30.9 |
| BTTF | 0.642 | 0–1; higher is more readable | 65.0Δ 22.1 |
| Human | 3.75 | 1–4; original rating | 42.9 |
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. | 1522.384 | −50.239 |
| 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. | 4.451 | −6.676 |
Intercept 8.87 + feature contributions = -20.045 (log-odds).
Score = sigmoid(-20.045) = 0.
| Score | 0.785 |
|---|
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 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 54 | +1.131 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 54 | −0.818 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 89.732 | +0.643 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 69.837 | +0.566 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.063 | +0.331 |
| 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. | 90.986 | −0.189 |
Intercept 0.07 + feature contributions = 0.257 (log-odds).
Score = sigmoid(0.257) = 0.564.
| Score | 0.41 |
|---|
| Score | 20 |
|---|
Run 1
The code is well-structured with clear logical grouping of related matcher factory methods. Documentation is helpful and provides usage examples. Methods are concise and focused with good naming that indicates intent. Nesting is shallow, with anonymous inner classes used appropriately for Hamcrest matchers. One reviewer might argue that anonymous inner classes could be replaced with lambdas for brevity, but the original style maintains clarity. Action granularity is good, and reading flow is natural, making the utility's purpose easily understandable.
Run 2
The code is well-structured with clear purpose and good documentation. Each matcher is concise and follows a consistent pattern. Nesting is minimal - only anonymous inner classes add one level. Action granularity is generally one action per line, though the matches() method in hasSingleFailureContaining combines two operations in one return statement. Reading flow is natural, with methods organized by complexity. Minor issues: some methods could use @Override annotations consistently, and the hasFailureContaining method could be more specific in its matching logic. Overall, the code maintains good readability with clear intent and appropriate length.
Run 3
The code is well-structured and readable. It has a clear class purpose, well-documented matchers, and flat nesting. Each matcher is concise, with single-action methods. The reading flow is natural, moving from simple to complex matchers. Minor readability deductions: anonymous inner classes add structural weight, and `hasFailureContaining` uses `Object` instead of `PrintableResult` in its `matches` method, obscuring type intent. Overall, the code is clear, self-explaining, and easy to follow.
Run 1
Code Structure: Well-organized utility class with small, focused matcher factories and useful documentation. Nesting: Anonymous matcher classes add modest nesting, but there are no deeply nested control structures. Clarity of intent: Descriptive method names and comments make the purpose clear; however, hasFailureContaining checks the result's string representation rather than explicitly checking failures, and hasSingleFailureContaining uses a less-specific Object type. Code length: Concise overall, with some necessary anonymous-class boilerplate. Action granularity: Most lines perform one clear action; the combined condition in hasSingleFailureContaining remains easy to understand. Reading flow: Methods progress naturally from general success and failure-count checks to content checks. Minor inconsistencies in matcher types, method ordering within anonymous classes, and @Override annotations slightly reduce readability.
Run 2
Code Structure: Well-organized matcher factory methods, with useful reuse through failureCountIs. Nesting: Anonymous classes introduce moderate but consistent nesting; there are no deeply nested conditionals. Clarity of intent: Descriptive method names and documentation explain the purpose, although hasFailureContaining checks the entire string representation rather than explicitly checking individual failures, making its documented intent less evident. Code length: Concise overall, with some repetitive anonymous-class boilerplate. Action granularity: Statements generally perform one action per line; the combined condition in hasSingleFailureContaining remains easy to understand. Reading flow: Consistent formatting and self-contained methods support natural reading, though inconsistent matcher types and method ordering within anonymous classes slightly reduce uniformity.
Run 3
Code Structure: Related matcher factories are logically grouped, and isSuccessful reuses failureCountIs. Nesting: Anonymous matcher classes add moderate structural nesting, but method bodies remain flat and simple. Clarity of intent: Descriptive method names and Javadoc clearly communicate purpose; however, hasFailureContaining checks the entire string representation rather than explicitly checking failures, making its documented behavior less apparent. Code length: Compact overall, with some repetitive matcher boilerplate. Action granularity: Statements generally perform one action per line; the combined condition in hasSingleFailureContaining remains easy to understand. Reading flow: Consistent formatting and progression from basic success checks to failure-content checks support natural reading. Generic parameter names such as string and item, plus inconsistent use of @Override, slightly reduce polish.