Sample
Schnappinger/argoUML/org.argouml.util.PredicateType
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 50.2Δ 26.9 |
| Scalabrino | 0.776 | 0–1; higher is more readable | 57.2Δ 19.9 |
| Dorn | 0.489 | 0–1; higher is more readable | 59.7Δ 17.3 |
| Mi | 0.575 | 0–1; higher is more readable | 52.5Δ 24.6 |
| LLOC | 48 | Logical lines; fewer is more readable | 39.9Δ 37.1 |
| DeepSeek V4 Pro | 15 | 0–20; mean of three runs | 38.0Δ 39.1 |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs | 55.3Δ 21.8 |
| BTTF | 0.631 | 0–1; higher is more readable | 63.4Δ 13.7 |
| Human | 3.96 | 1–4; original rating | 77.1 |
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. | 2395.462 | −79.05 |
| Source linesThe number of non-empty source lines. | 119 | +47.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.965 | −7.448 |
Intercept 8.87 + feature contributions = -30.028 (log-odds).
Score = sigmoid(-30.028) = 0.
| Score | 0.776 |
|---|
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. | 120 | −3.212 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 82 | +2.099 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 82 | −1.461 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 118.937 | +1.253 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.049 | +0.461 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 73.542 | +0.382 |
| 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.967 | +0.363 |
Intercept 0.07 + feature contributions = -0.045 (log-odds).
Score = sigmoid(-0.045) = 0.489.
| Score | 0.575 |
|---|
| Score | 48 |
|---|
Run 1
The code is generally readable with clear structure, flat methods, and one action per line. Class purpose is well-documented and method names clearly convey intent. The constructors and factory methods are logically organized. However, there are minor readability issues: the generic `Class patterns[]` uses raw types instead of `Class<?>[]`, and naming is slightly inconsistent (`pats` in constructors vs `classes` in factory methods). The `toString()` method caches its result but modifies `printString` through side effects, which slightly obscures the flow. Overloaded `create()` methods with 0-3 parameters are repetitive but acceptable for the era and degree of simplicity. Overall, the structure is clean, nesting is minimal, and the logic is easy to follow.
Run 2
The code is generally well-structured, with clear separation of constructors, factory methods, and the evaluate/toString logic. It uses minimal nesting—only a couple of one-level loops and conditionals—so it is fairly flat and easy to follow. Intent is clear: the class models a type predicate that can match multiple classes. The factory method overloads (create with 0 to 3 Class arguments) are repetitive but straightforward. Action granularity is mostly good, though array filling in the factory methods could be compressed. Reading flow is natural, but the long license header adds unnecessary noise before the actual code and slightly hurts readability. Additionally, the toString method builds a string with concatenation instead of using a StringBuilder, which is not a readability issue per se but could be improved. Overall, the code is concise, with no deep nesting or ambiguous logic, though minor repetition and the verbose header keep it from being exemplary.
Run 3
The code is reasonably readable but has several issues. The class structure is logical, with clear static factory methods and a single evaluate method. Nesting is minimal and the flow is natural. However, the code uses raw Class types instead of generics (Class<?>[]), which reduces type safety and clarity. The toString() method is unnecessarily long and does multiple actions per line: string manipulation, substring, concatenation, and caching. The repeated factory methods create(), create(c0), create(c1), create(c2) are verbose and could be replaced with varargs, reducing code length significantly. The printString caching works but makes the toString flow harder to follow. The copyright header is excessively long relative to the actual code, though this is not fault of the class itself. Action granularity in toString is poor, with multiple operations crammed into single lines. Overall, the intent is clear and structure is flat, but verbosity and lack of modern Java features reduce readability.
Run 1
Code Structure: Fields, constructors, factory methods, evaluation, and string formatting are logically organized into focused methods. Nesting: Shallow loops and conditionals, supported by early returns, keep control flow easy to follow. Clarity of intent: The class documentation and isInstance check explain its purpose, but abbreviated names such as pats, c0, o, and res reduce clarity; the match-any behavior for zero patterns is not documented. Code length: Methods are short, though repeated factory overloads and explicit array assignments add avoidable verbosity. Action granularity: Statements generally perform one action per line, making operations easy to track. Reading flow: Consistent formatting and straightforward method ordering support natural reading, while the lengthy license header, older array declaration syntax, and string-building details introduce minor friction.
Run 2
Code Structure: Fields, constructors, factory methods, evaluation, and string formatting are logically grouped. Nesting: Shallow loops and conditionals, with early returns, keep complexity low. Clarity of intent: The class documentation and isInstance check clearly convey type matching, though abbreviated names such as pats, c0, o, and res reduce clarity; the match-any behavior for zero patterns is not explicitly documented. Code length: Methods are short, but repeated factory implementations and verbose array initialization add unnecessary length. Action granularity: Statements generally perform one action per line, making operations easy to follow. Reading flow: Consistent formatting and straightforward control flow support natural reading, although the lengthy license header delays reaching the implementation and legacy array declaration syntax is less conventional.
Run 3
Code Structure: Fields, constructors, factory methods, evaluation, and string formatting are logically grouped. Nesting: Shallow loops and conditionals, with early returns keeping control flow simple. Clarity of intent: The class documentation and method names explain the predicate's purpose, although abbreviated names such as pats, c0, and res reduce clarity; the match-any behavior for zero patterns is not documented. Code length: Methods are short, but repeated factory overloads and array assignments add avoidable verbosity. The extensive license header delays reaching the implementation. Action granularity: Statements generally perform one action per line, making operations easy to follow. Reading flow: Consistent formatting and straightforward method ordering support natural reading, though legacy array syntax and raw Class types make the code feel dated.