Sample
Schnappinger/junit4/org.junit.runner.manipulation.Filter
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 60.5Δ 9.2 |
| Scalabrino | 0.89 | 0–1; higher is more readable | 86.3Δ 35.0 |
| Dorn | 0.829 | 0–1; higher is more readable | 90.4Δ 39.1 |
| Mi | 0.664 | 0–1; higher is more readable | 76.9Δ 25.6 |
| LLOC | 35 | Logical lines; fewer is more readable | 47.0Δ 4.3 |
| DeepSeek V4 Pro | 16.67 | 0–20; mean of three runs | 59.9Δ 8.6 |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs | 73.8Δ 22.4 |
| BTTF | 0.62 | 0–1; higher is more readable | 61.4Δ 10.1 |
| Human | 3.9 | 1–4; original rating | 51.3 |
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. | 2018.828 | −66.621 |
| Source linesThe number of non-empty source lines. | 122 | +48.8 |
| 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.274 | −6.41 |
Intercept 8.87 + feature contributions = -15.362 (log-odds).
Score = sigmoid(-15.362) = 0.
| Score | 0.89 |
|---|
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. | 122 | −3.283 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 89 | +2.341 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 121.747 | +1.292 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 95.593 | +0.738 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.045 | +0.506 |
| 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. | 97.951 | −0.484 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
Intercept 0.07 + feature contributions = 1.578 (log-odds).
Score = sigmoid(1.578) = 0.829.
| Score | 0.664 |
|---|
| Score | 35 |
|---|
Run 1
The code is well-structured and readable. It has a clear package and imports, comprehensive Javadocs explaining intent, and logical separation of methods. Nesting is minimal, with at most one level in `shouldRun` and `intersect`. The `ALL` constant and `matchMethodDescription` factory are concise and self-explanatory. Action granularity is good—each line performs one logical step. Reading flow is natural, with abstract methods grouped first, followed by concrete implementations. The only minor issues are a slight inconsistency in Javadoc formatting (the first paragraph of class Javadoc is a single block) and the `apply` method's parameter name `child` could be more descriptive, but these do not significantly affect readability.
Run 2
The code is well-structured with clear separation of concerns: the abstract Filter class defines a clean interface, and the static ALL and matchMethodDescription filters are concise. Javadoc comments are thorough and explain the purpose of each method and field. The nested anonymous classes are appropriate for the pattern and not overly deep. The main readability issue is the intersect method's anonymous class, which introduces some complexity with two filter references (first and second). The apply method does type checking and casting, which is slightly awkward but standard for this design. Overall, the code is readable with good naming, flat structure, and clear intent, but the anonymous inner classes and type cast add minor friction.
Run 3
The code is well-structured with clear separation of methods and logical organization. Nesting is minimal, with only one level inside matchMethodDescription's shouldRun method. Each method has a clear purpose: shouldRun, describe, apply, and intersect. The Javadoc comments enhance clarity of intent. The code is concise without being excessively brief. Each line performs a single action consistently. The reading flow is natural, with the class constants first, followed by static factory methods, then core abstract methods, and finally concrete helper methods. Minor deductions: some methods like apply() could be slightly more explicit in explaining object casting, and the overall length is moderate but appropriate for a filter abstraction.
Run 1
Code Structure: Logically organized around a clear filtering abstraction, with related factory methods and operations grouped coherently. Nesting: Generally shallow; anonymous classes and the recursive child traversal add moderate nesting without becoming tangled. Clarity of intent: Descriptive method names, straightforward conditions, and useful Javadoc make behavior clear, though calling ALL a 'null Filter' is potentially confusing. Code length: Implementation is concise; anonymous-class boilerplate and some repetitive documentation slightly increase length. Action granularity: Statements generally perform one action per line, and compound boolean expressions remain easy to understand. Reading flow: Consistent formatting, early returns, and small methods support natural reading, with minor interruptions from verbose documentation and anonymous implementations.
Run 2
Code Structure: Logically organized into a default filter, a factory method, abstract contracts, and application/composition methods. Nesting: Generally shallow; anonymous classes and the recursive child traversal introduce moderate nesting without becoming tangled. Clarity of intent: Descriptive method names and Javadoc clearly explain filtering behavior, although calling ALL a 'null Filter' and naming a runner parameter 'child' are slightly confusing. Code length: Implementations are concise; documentation adds useful context, with minor redundancy. Action granularity: Statements generally perform one action per line, and the split conjunction remains easy to follow. Reading flow: Consistent formatting, early returns, and straightforward control flow support natural reading. Anonymous implementations add some visual overhead, and minor Javadoc punctuation issues slightly reduce polish.
Run 3
Code Structure: Well-organized abstraction with distinct methods for matching, applying, and intersecting filters. Nesting: Mostly shallow; anonymous classes and the recursive child traversal introduce moderate nesting but remain manageable. Clarity of intent: Descriptive method names, straightforward conditions, and useful Javadoc make the filtering behavior clear. Minor drawbacks include generic names such as 'each' and 'child', and describing ALL as a 'null Filter'. Code length: Appropriately concise implementation, although some documentation is repetitive and anonymous-class boilerplate adds length. Action granularity: Statements generally perform one action per line; compound boolean expressions remain easy to understand. Reading flow: Consistent formatting, early returns, and logical method grouping support natural reading. Minor Javadoc punctuation issues and extra blank lines slightly reduce polish.