Sample
Schnappinger/junit4/org.junit.internal.builders.JUnit3Builder
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 64.2Δ 5.3 |
| Scalabrino | 0.557 | 0–1; higher is more readable | 15.4Δ 54.1 |
| Dorn | 0.486 | 0–1; higher is more readable | 59.4Δ 10.1 |
| Mi | 0.377 | 0–1; higher is more readable | 23.8Δ 45.7 |
| LLOC | 6 | Logical lines; fewer is more readable | 79.7Δ 10.2 |
| DeepSeek V4 Pro | 18.33 | 0–20; mean of three runs | 96.0Δ 26.6 |
| GPT-6.1 Sol | 19 | 0–20; mean of three runs | 92.6Δ 23.1 |
| BTTF | 0.661 | 0–1; higher is more readable | 70.3Δ 0.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. | 564.124 | −18.616 |
| Source linesThe number of non-empty source lines. | 19 | +7.6 |
| 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.606 | −6.91 |
Intercept 8.87 + feature contributions = -9.056 (log-odds).
Score = sigmoid(-9.056) = 0.
| Score | 0.557 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| 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. | 73.947 | +0.533 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 19 | +0.364 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 17.813 | −0.161 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 19 | −0.08 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.095 | +0.016 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 18 | +0.008 |
Intercept 0.07 + feature contributions = -0.054 (log-odds).
Score = sigmoid(-0.054) = 0.486.
| Score | 0.377 |
|---|
| Score | 6 |
|---|
Run 1
The code is highly readable. It has a clean single-purpose class with a clear structure, minimal nesting, and concise methods. Each method performs one clear action, and the flow is natural. Naming is descriptive, and the intent is obvious: build a runner for JUnit 3-style tests. Only minor nitpick: isPre4Test could be private, but this doesn't harm readability.
Run 2
The code is highly readable with a clear, focused purpose: determining if a test class is a JUnit 3 test and returning an appropriate runner. Structure is logical and minimal, containing only two methods that each perform a single responsibility. Nesting is flat with just one conditional check. Clarity of intent is strong—method names like `runnerForClass` and `isPre4Test` describe their actions well. Code length is concise and avoids unnecessary boilerplate. Each method performs one logical action per line, contributing to good action granularity. Reading flow is natural: the override method first checks compatibility, then delegates to a helper method for the actual type check. Minor deductions: the boolean method `isPre4Test` lacks a visibility modifier (package-private by default), which is slightly less explicit than `private` or `protected`, and the name `Pre4` assumes familiarity with JUnit version history.
Run 3
The code is highly readable and demonstrates clean, purposeful structure. It has a single, clear responsibility: determining whether a test class should use the JUnit 3 runner. The class is logically organized with one public method and one package-private helper method. Nesting is minimal—a single if statement with no deep indentation. Intent is explicit: the method name 'isPre4Test' and the use of 'isAssignableFrom' clearly convey the version-checking logic. Code length is concise, avoiding unnecessary boilerplate. Action granularity is appropriate, with one meaningful action per line (the return statement and the boolean check). Reading flow is natural, top-down, and easy to follow. Minor improvements could include a clarifying comment for the version check, but overall this is excellent, production-quality readability.
Run 1
Code Structure: Logically organized, separating runner selection from the compatibility check. Nesting: Minimal, with a single conditional and no nested branches. Clarity of intent: Class and method names clearly convey support for JUnit 3 tests, though returning null relies on the RunnerBuilder contract. Code length: Concise, with no unnecessary statements. Action granularity: Each statement performs one action. Reading flow: Natural top-to-bottom progression from checking compatibility to constructing the runner, followed by the small helper method.
Run 2
Code Structure: Cleanly separates runner creation from the test-class compatibility check. Nesting: Only one shallow conditional, making control flow easy to follow. Clarity of intent: Class and method names clearly indicate JUnit 3 support, though isPre4Test is slightly less precise than isJUnit3Test, and the null fallback relies on framework conventions. Code length: Concise, with no unnecessary logic. Action granularity: Each statement performs one clear action. Reading flow: Naturally progresses from the public entry point to its small helper method.
Run 3
Code Structure: Logically organized into a runner-selection method and a focused helper. Nesting: Only one shallow conditional, making control flow easy to follow. Clarity of intent: Class and method names clearly convey support for JUnit 3 tests, though the null return relies on knowledge of the builder contract. Code length: Concise without unnecessary boilerplate or repetition. Action granularity: Each statement performs one distinct action. Reading flow: Imports, class declaration, primary method, and helper appear in a natural order.