Sample
Schnappinger/junit4/org.junit.internal.builders.AnnotatedBuilder
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 52.2Δ 5.1 |
| Scalabrino | 0.542 | 0–1; higher is more readable | 12.7Δ 34.4 |
| Dorn | 0.076 | 0–1; higher is more readable | 30.4Δ 16.7 |
| Mi | 0.052 | 0–1; higher is more readable | 6.6Δ 40.4 |
| LLOC | 16 | Logical lines; fewer is more readable | 64.9Δ 17.8 |
| DeepSeek V4 Pro | 16.67 | 0–20; mean of three runs | 59.9Δ 12.9 |
| GPT-6.1 Sol | 17.67 | 0–20; mean of three runs | 62.2Δ 15.2 |
| BTTF | 0.527 | 0–1; higher is more readable | 46.2Δ 0.8 |
| Human | 3.87 | 1–4; original rating | 47.0 |
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. | 1398.684 | −46.157 |
| Source linesThe number of non-empty source lines. | 41 | +16.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.563 | −6.844 |
Intercept 8.87 + feature contributions = -27.73 (log-odds).
Score = sigmoid(-27.73) = 0.
| Score | 0.542 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| 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. | 151.951 | −2.771 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 41 | +0.681 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 41 | −0.415 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.076 | +0.199 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 39.824 | +0.147 |
Intercept 0.07 + feature contributions = -2.496 (log-odds).
Score = sigmoid(-2.496) = 0.076.
| Score | 0.052 |
|---|
| Score | 16 |
|---|
Run 1
The code is well-structured and readable. It has a clear logical organization with a single public method entry point and a focused helper. Nesting is shallow, with only one nested try-catch inside the main try. Intent is clear: build a runner from the @RunWith annotation, falling back from a simple constructor to one accepting a RunnerBuilder. Action granularity is mostly one operation per line, though the constructor calls are somewhat dense. Naming is conventional and descriptive, though `fSuiteBuilder` uses an older prefix style. Minor deductions: the nested catch has duplicate logic and the constructor fallback could be refactored, but overall this is concise (< 30 lines of logic) and flows naturally from annotation detection to construction to error handling.
Run 2
The code is well-structured and readable. It follows a clear logical organization with a single purpose class. Nesting is limited to two levels within a try-catch, which is acceptable for the exception-handling logic. Intent is clear through descriptive method names like runnerForClass and buildRunner, and the error message constant contributes to clarity. Code length is concise, avoiding unnecessary verbosity. However, action granularity is somewhat mixed: the nested getConstructor/newInstance call combines multiple actions on one line, which slightly reduces readability. Overall reading flow is natural, progressing from annotation lookup to runner construction, with adequate exception handling. The main deductions come from the slightly dense constructor invocation lines and the moderate nesting in the catch block, but these are minor issues in an otherwise clean implementation.
Run 3
The code is well-structured with clear separation of concerns, minimal nesting (only two levels deep), and concise methods. Each line performs a single logical action, maintaining good action granularity. The use of a descriptive constant for the error message improves clarity. The reading flow is natural: annotation check, then builder invocation. The nested try-catch in buildRunner adds slight complexity but remains readable. Naming is clear except for 'fSuiteBuilder' (a legacy prefix), which is a minor issue. Overall, the code demonstrates high readability with only minor stylistic concerns.
Run 1
Code Structure: Well organized, separating annotation lookup from runner construction and centralizing the error message. Nesting: Mostly shallow, though nested try-catch blocks make constructor fallback slightly harder to follow. Clarity of intent: Method names, types, and the error message clearly communicate the purpose; fSuiteBuilder and generic exception names are less descriptive. Code length: Concise, with no unnecessary logic. Action granularity: Statements generally perform one action, although chained reflection calls combine constructor lookup and instantiation. Reading flow: Natural progression from annotation detection to preferred constructor, fallback constructor, and initialization error; line wrapping and nested exception handling introduce minor friction.
Run 2
Code Structure: Well organized, with annotation detection and runner construction separated into focused methods. Nesting: Mostly shallow, though nested try-catch blocks add complexity to constructor fallback handling. Clarity of intent: Method names, types, and the descriptive error message clearly communicate the purpose; fSuiteBuilder and generic exception names are slightly less expressive. Code length: Concise, with little unnecessary code. Action granularity: Statements generally perform one logical action, although chained reflection calls combine constructor lookup and instantiation. Reading flow: Natural progression from annotation lookup to preferred constructor, fallback constructor, and error reporting. Line wrapping slightly interrupts the reflection expressions but remains understandable.
Run 3
Code Structure: Well organized into annotation detection and runner construction, with a shared error-message constant. Nesting: Mostly shallow, though the nested try/catch adds complexity to constructor fallback handling. Clarity of intent: Descriptive method names and explicit constructor signatures make the purpose clear; fSuiteBuilder and generic exception names are slightly less intuitive. Code length: Concise, with no unnecessary logic or duplication. Action granularity: Statements generally perform one clear action, although reflection calls chain constructor lookup and instantiation. Reading flow: Natural progression from annotation lookup to preferred constructor, fallback constructor, and informative failure. Long lines and wrapped reflection calls slightly reduce scanning ease.