Sample
Schnappinger/junit4/org.junit.experimental.theories.internal.BooleanSupplier
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 66.2Δ 12.4 |
| Scalabrino | 0.584 | 0–1; higher is more readable | 19.5Δ 34.3 |
| Dorn | 0.568 | 0–1; higher is more readable | 64.4Δ 10.6 |
| Mi | 0.553 | 0–1; higher is more readable | 43.2Δ 10.6 |
| LLOC | 2 | Logical lines; fewer is more readable | 94.6Δ 40.8 |
| DeepSeek V4 Pro | 18 | 0–20; mean of three runs | 91.4Δ 37.6 |
| GPT-6.1 Sol | 20 | 0–20; mean of three runs | 99.3Δ 45.5 |
| BTTF | 0.701 | 0–1; higher is more readable | 81.2Δ 27.4 |
| Human | 3.9 | 1–4; original rating | 53.8 |
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. | 531.364 | −17.535 |
| Source linesThe number of non-empty source lines. | 18 | +7.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.563 | −6.845 |
Intercept 8.87 + feature contributions = -8.31 (log-odds).
Score = sigmoid(-8.31) = 0.
| Score | 0.584 |
|---|
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 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 18 | +0.399 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| 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. | 77.947 | +0.364 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 17.873 | −0.16 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.084 | +0.122 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 18 | −0.115 |
Intercept 0.07 + feature contributions = 0.274 (log-odds).
Score = sigmoid(0.274) = 0.568.
| Score | 0.553 |
|---|
| Score | 2 |
|---|
Run 1
The code is highly readable. It has a clear, single purpose: supplying boolean parameter values. The structure is logical, with a simple class extending ParameterSupplier and overriding a single method. Nesting is minimal, with only one method and a single return statement. Intent is explicit from the class and method names. Code length is concise and appropriate. Action granularity is reasonable, with two related assignment objects created in one line, which is idiomatic Java for list creation. Reading flow is natural: package declaration, imports, class declaration, method override, and return statement. Minor deductions: the multiple imports could be considered slightly verbose for such a short class, and the line break with alignment might be slightly non-standard for some formatters, but neither significantly impacts readability.
Run 2
The code is highly readable. It follows a clear, logical structure with a single class extending ParameterSupplier. Nesting is minimal—only a method override with a single return statement. Intent is immediately clear: supply boolean true/false values as potential assignments. The code is concise without being overly terse, using Arrays.asList to cleanly construct the list. Each action (creating the two PotentialAssignment objects) occurs on its own line, improving granularity. Reading flow is natural: package declaration, imports, class definition, method override, and return value all follow expected order. Minor deductions could be argued for not using a constant for repeated strings 'true'/'false', but this is negligible for such a short, focused utility class.
Run 3
The code is highly readable. It has a clean, logical structure with a single class and one overridden method. There is no unnecessary nesting; the method body is flat. The intent is clear: supply boolean parameter values for theories. The code is concise, with no redundant lines. Each action (creating and returning the list of assignments) is expressed clearly, and the reading flow is natural: class declaration, override annotation, method signature, and a straightforward return statement. Minor deductions are for the slightly long single return line and lack of explanatory comments, but these are not significant enough to impact readability strongly.
Run 1
Code Structure: Imports, class declaration, and the single overridden method are logically organized. Nesting: Minimal nesting, with no conditional or loop complexity. Clarity of intent: BooleanSupplier and getValueSources clearly express the purpose of providing true and false assignments; the unused sig parameter is required by the overridden method signature. Code length: Concise, with no unnecessary logic. Action granularity: A single return statement constructs the result, and each assignment appears on its own line. Reading flow: Natural top-to-bottom progression and aligned formatting make the implementation immediately understandable.
Run 2
Code Structure: A single focused class with organized imports and one overridden method. Nesting: No nested control flow. Clarity of intent: BooleanSupplier and the explicit true/false assignments clearly convey the purpose; the unused sig parameter follows the superclass contract. Code length: Concise, with no unnecessary logic. Action granularity: One return operation, with each assignment on its own line. Reading flow: Natural top-to-bottom organization and consistent formatting make the code easy to follow.
Run 3
Code Structure: Cleanly organized imports, class, and overridden method. Nesting: Minimal, with no conditionals or loops. Clarity of intent: BooleanSupplier clearly supplies the two boolean values, and descriptive factory calls make their representation explicit. Code length: Concise with no unnecessary logic. Action granularity: One return statement constructs the list; each assignment is visually separated across lines. Reading flow: Natural progression from declaration to implementation, with consistent indentation and formatting.