Sample

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

Human rating uses the original dataset scale.

Human4
Lines24

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
63.9Δ 26.2
Scalabrino0.7710–1; higher is more readable
54.8Δ 35.3
Dorn0.6820–1; higher is more readable
72.9Δ 17.2
Mi0.6520–1; higher is more readable
73.6Δ 16.5
LLOC9Logical lines; fewer is more readable
73.3Δ 16.8
DeepSeek V4 Pro180–20; mean of three runs
91.4Δ 1.3
GPT-6.1 Sol180–20; mean of three runs
73.8Δ 16.3
BTTF0.7850–1; higher is more readable
94.7Δ 4.6
Human41–4; original rating
90.1

Views

Source code

package org.junit.internal.builders; import org.junit.internal.runners.SuiteMethod; import org.junit.runner.Runner; import org.junit.runners.model.RunnerBuilder; public class SuiteMethodBuilder extends RunnerBuilder { @Override public Runner runnerForClass(Class<?> each) throws Throwable { if (hasSuiteMethod(each)) { return new SuiteMethod(each); } return null; } public boolean hasSuiteMethod(Class<?> testClass) { try { testClass.getMethod("suite"); } catch (NoSuchMethodException e) { return false; } return true; } }

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.640.733−21.144
Source linesThe number of non-empty source lines.24+9.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.451−6.677

Intercept 8.87 + feature contributions = -9.351 (log-odds).
Score = sigmoid(-9.351) = 0.

Score0.771

Feature contributions

FeatureValueContribution
(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.66+0.87
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.24+0.187
Indentation frequencyHow rapidly indentation changes from line to line.24+0.093
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.22.806−0.091
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.093+0.04

Intercept 0.07 + feature contributions = 0.762 (log-odds).
Score = sigmoid(0.762) = 0.682.

Score0.652
Score9
Run 1

The code is highly readable with a clear, single-purpose class structure. It maintains flat nesting with early returns, making the control flow straightforward. Method names clearly express intent, and the use of a try-catch block appropriately handles the expected exception without obscuring the logic. Overall length is concise, each line performs a single action, and the reading flow is natural. Minor potential improvement could be using a more descriptive method name than `hasSuiteMethod` to clarify the reflection-based check, but this does not significantly impact readability.

Run 2

The code is highly readable due to its clear structure and concise implementation. The class has a single responsibility, and the methods are short with clear intent. There is minimal nesting, only one level inside methods, and the reading flow is natural. The action granularity is appropriate, with one action per line. One minor ambiguity is that hasSuiteMethod returns false only for NoSuchMethodException, while other exceptions propagate, which could be slightly clearer. Overall, the code is straightforward and well-organized.

Run 3

The code is highly readable with a clear, logical structure. The class has a single responsibility and is well-organized. Nesting is minimal, with only one level of indentation from the if statement and try-catch block. The intent of both methods is immediately clear from their names. The code is concise - no unnecessary boilerplate or redundant operations. Each method performs one action per line, maintaining good granularity. The reading flow is natural: the override method first checks for a suite method, then constructs the appropriate runner. The only minor issue is that hasSuiteMethod could be simplified using reflection's method checking alternative, but the current implementation is straightforward and easy to understand.

Run 1

Code Structure: Two focused methods cleanly separate runner creation from suite-method detection. Nesting: Shallow conditional and try/catch blocks make the code easy to follow. Clarity of intent: Class and method names clearly communicate purpose, although the parameter name 'each' is vague and returning null relies on framework conventions. Code length: Compact with no unnecessary implementation detail. Action granularity: Each statement performs a single action. Reading flow: The primary operation appears first, followed by its helper, providing a natural top-down flow. Exception-based method detection is understandable but slightly less direct than an explicit predicate.

Run 2

Code Structure: Two focused methods cleanly separate runner construction from suite-method detection. Nesting: Minimal nesting keeps both methods easy to scan. Clarity of intent: Class and method names communicate their purposes, although the parameter name 'each' is vague and the null return convention is unexplained. Code length: Compact without unnecessary boilerplate or repetition. Action granularity: Each statement performs one clear action. Reading flow: The main method delegates naturally to a straightforward helper, with simple return paths. Reflection-based detection is understandable, though a brief explanation of what qualifies as a suite method could improve clarity.

Run 3

Code Structure: Two small methods cleanly separate runner creation from suite-method detection. Nesting: A single conditional and a simple try/catch keep nesting shallow. Clarity of intent: Class and method names clearly convey purpose, though 'each' is vague and returning null relies on an implicit framework convention. Code length: Concise, with no unnecessary statements or duplication. Action granularity: Each statement performs one action, making individual steps easy to follow. Reading flow: The main operation appears first, followed by its helper, providing a natural top-down flow. Exception-based detection is straightforward, although familiarity with reflection helps explain why getMethod is called without using its result.