Sample

Schnappinger/junit4/org.junit.internal.builders.JUnit4Builder

Human rating uses the original dataset scale.

Human3.87
Lines12

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett0.0110–1; higher is more readable
71.6Δ 24.5
Scalabrino0.5710–1; higher is more readable
17.5Δ 29.6
Dorn0.6150–1; higher is more readable
68.6Δ 21.6
Mi0.6060–1; higher is more readable
64.0Δ 17.0
LLOC2Logical lines; fewer is more readable
94.6Δ 47.5
DeepSeek V4 Pro18.670–20; mean of three runs
98.3Δ 51.3
GPT-6.1 Sol200–20; mean of three runs
99.3Δ 52.3
BTTF0.6710–1; higher is more readable
72.3Δ 25.2
Human3.871–4; original rating
47.0

Views

Source code

package org.junit.internal.builders; import org.junit.runner.Runner; import org.junit.runners.BlockJUnit4ClassRunner; import org.junit.runners.model.RunnerBuilder; public class JUnit4Builder extends RunnerBuilder { @Override public Runner runnerForClass(Class<?> testClass) throws Throwable { return new BlockJUnit4ClassRunner(testClass); } }

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(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.337.974−11.153
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.668−7.002
Source linesThe number of non-empty source lines.12+4.8

Intercept 8.87 + feature contributions = -4.485 (log-odds).
Score = sigmoid(-4.485) = 0.011.

Score0.571

Feature contributions

FeatureValueContribution
(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.71+0.658
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.12+0.611
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
Indentation frequencyHow rapidly indentation changes from line to line.12−0.322
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.10.917−0.257
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.085+0.116

Intercept 0.07 + feature contributions = 0.47 (log-odds).
Score = sigmoid(0.47) = 0.615.

Score0.606
Score2
Run 1

The code demonstrates excellent readability through its minimal, single-purpose design. Structure is logical with a clear package hierarchy and a class extending the expected base type. Nesting is essentially nonexistent — just one method with no conditional braces. Intent is obvious: build a JUnit 4 runner for a given test class. The code is concise without unnecessary boilerplate. Action granularity is ideal, with the single meaningful operation on its own line. Reading flow is natural, moving from package declaration through imports to the single method. Minor deductions only for the lack of a class-level Javadoc and the unused `throws Throwable` clause, which slightly obscures the contract.

Run 2

The code is highly readable. It has a clear, logical structure: a single class extending RunnerBuilder, with one overridden method. Nesting is minimal—just one method and one return statement. Intent is explicit: this builder creates a BlockJUnit4ClassRunner for a given test class. The code is concise, with no unnecessary boilerplate or comments. Action granularity is perfect: one action per line. Reading flow follows natural top-to-bottom order. Only minor deductions for lack of Javadoc or error handling, but not required for readability.

Run 3

This code is highly readable. The structure is clean and logical, with a clear package declaration and a single, focused class that extends RunnerBuilder. Nesting is minimal, with only one method and no control flow. The intent is obvious: provide a JUnit4 runner for a given test class. The code is concise, with no unnecessary lines or comments. Action granularity is optimal: the single action of creating a runner is expressed on one line. Reading flow is natural, as imports and class structure follow Java conventions, making the purpose immediately clear. One minor deduction is that a Javadoc comment could further clarify the method's purpose, but this is negligible.

Run 1

Code Structure: Clean organization with a package declaration, focused imports, and a single overridden method. Nesting: Minimal, with no conditional or loop nesting. Clarity of intent: Descriptive class, method, and parameter names make its purpose—constructing a JUnit 4 runner for a test class—clear. Code length: Concise with no unnecessary logic. Action granularity: The method performs one straightforward construction-and-return action. Reading flow: Conventional Java formatting and the @Override annotation make the code easy to follow.

Run 2

Code Structure: Standard package, imports, and a focused class with one overridden method provide clear organization. Nesting: Only necessary class and method scopes, with no nested control flow. Clarity of intent: Descriptive names and direct construction of BlockJUnit4ClassRunner clearly communicate the purpose. Code length: Minimal implementation without redundant logic. Action granularity: The method performs a single return action on one line. Reading flow: Conventional Java formatting and declaration order make the code easy to follow.

Run 3

Code Structure: Standard package, imports, and a focused class are logically organized. Nesting: Minimal, with only class and method scopes. Clarity of intent: JUnit4Builder, runnerForClass, and testClass clearly convey that the method creates a JUnit 4 runner for a test class; @Override makes its role explicit. Code length: Concise, with no unnecessary logic or boilerplate. Action granularity: The method performs one clear construction-and-return operation on a single line. Reading flow: Conventional Java formatting and straightforward delegation make the code easy to follow.