Sample
Schnappinger/junit4/org.junit.internal.TextListener
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 35.1Δ 45.2 |
| Scalabrino | 0.767 | 0–1; higher is more readable | 53.4Δ 26.9 |
| Dorn | 0.249 | 0–1; higher is more readable | 44.9Δ 35.5 |
| Mi | 0.685 | 0–1; higher is more readable | 79.9Δ 0.5 |
| LLOC | 43 | Logical lines; fewer is more readable | 41.1Δ 39.3 |
| DeepSeek V4 Pro | 16.67 | 0–20; mean of three runs | 59.9Δ 20.5 |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs | 73.8Δ 6.6 |
| BTTF | 0.364 | 0–1; higher is more readable | 29.7Δ 50.7 |
| Human | 3.96 | 1–4; original rating | 80.4 |
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. | 3573.601 | −117.929 |
| Source linesThe number of non-empty source lines. | 101 | +40.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.527 | −6.791 |
Intercept 8.87 + feature contributions = -75.45 (log-odds).
Score = sigmoid(-75.45) = 0.
| Score | 0.767 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 96 | +2.583 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 102 | −2.575 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 96 | −1.782 |
| 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. | 117.98 | −1.332 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 117.961 | +1.099 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 100.908 | +1.001 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.114 | −0.166 |
Intercept 0.07 + feature contributions = -1.102 (log-odds).
Score = sigmoid(-1.102) = 0.249.
| Score | 0.685 |
|---|
| Score | 43 |
|---|
Run 1
The code is generally readable and well-structured. It follows a clear logical flow: testRunFinished orchestrates header, failures, and footer printing. Methods are concise, with one primary action per line in most cases. Nesting levels are shallow, maxing out at two levels inside printFailures and printFooter. Naming is mostly clear, especially method names that describe their purpose. The constructor overloading is straightforward. However, some issues affect readability: the field name fWriter uses outdated Hungarian notation, and the getWriter() method adds unnecessary indirection for private field access. The printFooter method has awkward string concatenation with a ternary operator inline, making it harder to parse. The printFailures method could use a modern string format for the failure count. The comment referencing 'BaseTestRunner. Fix it' indicates technical debt but doesn't impact current clarity. Overall, the code is maintainable and easy to follow, with minimal room for improvement.
Run 2
The code is well-structured into logical methods representing test lifecycle events, with clear separation between public callbacks and internal helpers. Nesting is minimal—only one level in conditionals and loops, maintaining flat control flow. Intent is clear through descriptive method and variable names (e.g., printFailures, elapsedTimeAsString). Code length is appropriate, with minimal duplication except for the documented elapsedTimeAsString method. Each line generally performs one action, though some print statements combine string concatenation. Reading flow is natural: header, failures, footer in sequential order. Minor critiques include the 'f' prefix notation in field names (legacy style), and the helper methods are protected rather than private for no apparent reason, which slightly obscures intent. Overall, the code is highly readable and maintainable.
Run 3
The code is well-structured, with a clear separation between public hooks and internal helper methods. Nesting is shallow, and each method performs a clear, single responsibility. The flow of execution is easy to follow: header, failures, footer. Minor deductions: the use of the cryptic 'f' prefix on the field is outdated, the duplicated time formatting comment signals unresolved tech debt, and the conditional string building in printFooter spans multiple lines, slightly disrupting readability. Overall, intent is clear and actions are appropriately granular.
Run 1
Code Structure: Well-organized listener callbacks delegate reporting to focused helper methods. Nesting: Shallow conditionals and a simple loop keep control flow easy to follow; an early return avoids unnecessary nesting. Clarity of intent: Descriptive method names clearly communicate test reporting, though fWriter, each, and the implicit milliseconds-to-seconds conversion are less explicit. Code length: Mostly concise, with minor repetition in writer access and failure-count formatting. Action granularity: Most lines perform one action, but printFailure(each, "" + i++) combines conversion, incrementing, and invocation. Reading flow: Callbacks followed by reporting helpers create a natural progression. Long concatenated output expressions and the embedded pluralization ternary slightly interrupt readability.
Run 2
Code Structure: Well organized into listener callbacks and focused output helpers, with clear separation of responsibilities. Nesting: Shallow conditionals and an early return keep control flow easy to follow. Clarity of intent: Descriptive method names make the reporting purpose obvious; fWriter, each, and the implicit milliseconds-to-seconds conversion are slightly less explicit. Code length: Concise overall, though repeated getWriter() and failures.size() calls add minor verbosity. Action granularity: Most lines perform one action, but printFailure(each, "" + i++) combines formatting, incrementing, and invocation. Reading flow: testRunFinished presents a natural header-failures-footer sequence, supported by consistently ordered helpers. Long concatenations and the inline pluralization ternary slightly interrupt otherwise smooth reading.
Run 3
Code Structure: Well organized into listener callbacks and focused output helpers, with reporting split into header, failures, and footer. Nesting: Shallow conditionals and a single loop; the early return avoids unnecessary nesting. Clarity of intent: Descriptive method names make the reporting purpose clear, although fWriter, each, and the implicit milliseconds-to-seconds conversion are less explicit. Code length: Concise overall, with minor repetition in writer access and failure-count retrieval. Action granularity: Most lines perform one action, but printFailure(each, "" + i++) combines formatting, incrementing, and a method call. Reading flow: testRunFinished presents a natural reporting sequence, and related methods are grouped logically. Long string concatenations and an inline pluralization ternary slightly interrupt readability.