Sample
Schnappinger/junit4/org.junit.runners.model.RunnerBuilder
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 50.8Δ 35.8 |
| Scalabrino | 0.596 | 0–1; higher is more readable | 22.3Δ 64.4 |
| Dorn | 0.148 | 0–1; higher is more readable | 37.0Δ 49.7 |
| Mi | 0.141 | 0–1; higher is more readable | 12.5Δ 74.1 |
| LLOC | 26 | Logical lines; fewer is more readable | 52.3Δ 34.3 |
| DeepSeek V4 Pro | 17.33 | 0–20; mean of three runs | 73.9Δ 12.7 |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs | 73.8Δ 12.9 |
| BTTF | 0.536 | 0–1; higher is more readable | 47.5Δ 39.1 |
| Human | 3.98 | 1–4; original rating | 86.6 |
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. | 2240.716 | −73.944 |
| Source linesThe number of non-empty source lines. | 108 | +43.2 |
| 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.585 | −6.877 |
Intercept 8.87 + feature contributions = -28.751 (log-odds).
Score = sigmoid(-28.751) = 0.
| Score | 0.596 |
|---|
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. | 109 | −2.823 |
| 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. | 142.954 | −2.39 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 65 | +1.511 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 142.991 | +1.503 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 107.819 | +1.097 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 65 | −1.071 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.061 | +0.349 |
Intercept 0.07 + feature contributions = -1.753 (log-odds).
Score = sigmoid(-1.753) = 0.148.
| Score | 0.141 |
|---|
| Score | 26 |
|---|
Run 1
This JUnit RunnerBuilder class demonstrates strong readability. The structure is logical, with clear separation of public API methods, protected internals, and a private helper. Nesting is minimal — a try/finally and a simple loop are the only nested blocks. Method names like safeRunnerForClass, addParent, and removeParent clearly convey intent. The code is concise without sacrificing clarity, using early returns and collection methods effectively. Action granularity is generally good, with one logical step per line. The reading flow is natural: fields, abstract method, safe wrapper, parent-tracking methods, then public runners methods followed by the private implementation. Javadoc is helpful but not excessive. Minor deductions include the slightly dense error message formatting and the overloaded runners methods requiring readers to track which version is called, but overall this is very readable production code.
Run 2
The code is well-structured with clear separation of public API and private helpers. Javadoc explains intent thoroughly. Nesting is minimal (one try/finally, one loop, one conditional). Action granularity is appropriate, with one logical operation per line. The recursive parent-tracking logic is concise and the flow is natural: public methods delegate to private helpers cleanly. Minor deductions: the overloaded runners methods create slight indirection, and the private runners(Class<?>[]) method could be named more explicitly (e.g., buildRunners). Overall, highly readable with strong clarity of intent.
Run 3
The code is well-structured and highly readable. It follows a logical organization, with clear separation between public API methods, helper methods, and private implementation. Nesting is minimal; the only nested block is a try-finally in the 'runners' method, which is appropriate for resource cleanup. Intent is clear from method names and Javadoc comments, especially for 'safeRunnerForClass' and 'runners'. The code is concise—no unnecessary verbosity—and each method performs a single, focused action. Action granularity is good, with one meaningful operation per line in most cases. Reading flow is natural: the class starts with a field, then abstract method, then public methods flowing from high-level to lower-level helpers. The only minor issue is the duplicate 'runners' overloads and use of raw array types, which slightly increases complexity, but overall the code is clean, maintainable, and easy to follow.
Run 1
Code Structure: Well-organized, focused methods separate runner construction, error handling, and recursion tracking. Nesting: Shallow control flow; only the loop's null check adds nesting. Clarity of intent: Descriptive method names and useful documentation explain the strategy and cycle prevention, though names like 'each' and 'klass' are less precise. The claim that safeRunnerForClass always returns a runner conflicts with the later null check. Code length: Implementation is concise, although the introductory documentation is lengthy and the exception statement could be wrapped. Action granularity: Most lines perform one action; addParent combines set insertion and a condition, slightly increasing interpretation effort. Reading flow: Consistent formatting and straightforward delegation make execution easy to follow, with try/finally clearly expressing cleanup.
Run 2
Code Structure: Well-organized, focused methods separate runner construction, error handling, recursion prevention, and collection processing. Nesting: Shallow overall; only the loop with a null check adds modest nesting. Clarity of intent: Descriptive method names and useful Javadoc explain the strategy and recursion safeguards. However, 'parents', 'klass', and 'each' could be more specific, and the claim that safeRunnerForClass always returns a runner conflicts with the later null check. Code length: Implementation is concise, though introductory documentation is lengthy and one exception-construction line is overly long. Action granularity: Most lines perform one clear action; combining set insertion with a conditional slightly obscures the state change. Reading flow: Methods follow a natural progression, overloads delegate cleanly, and try/finally makes cleanup easy to follow.
Run 3
Code Structure: Small, focused methods logically separate runner construction, error handling, and recursion protection. Nesting: Shallow overall; only the collection loop contains a nested conditional. Clarity of intent: Descriptive method names and documentation make the strategy clear, though 'parents', 'klass', and 'each' are less precise, and the promise that safeRunnerForClass always returns a runner conflicts with the later null check. Code length: Implementation is concise; introductory documentation is lengthy but useful, while one exception-construction line is overly long. Action granularity: Most lines perform one action, although addParent combines set mutation with a conditional check. Reading flow: Consistent formatting and delegation provide a natural progression, with try/finally clearly communicating cleanup.