Sample
Schnappinger/argoUML/org.argouml.uml.cognitive.critics.CrInvalidForkTriggerOrGuard
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 45.8Δ 16.8 |
| Scalabrino | 0.48 | 0–1; higher is more readable | 7.9Δ 21.2 |
| Dorn | 0.412 | 0–1; higher is more readable | 56.1Δ 27.1 |
| Mi | 0.536 | 0–1; higher is more readable | 38.6Δ 9.6 |
| LLOC | 29 | Logical lines; fewer is more readable | 50.0Δ 21.0 |
| DeepSeek V4 Pro | 12 | 0–20; mean of three runs | 15.5Δ 13.5 |
| GPT-6.1 Sol | 15 | 0–20; mean of three runs | 25.7Δ 3.3 |
| BTTF | 0.471 | 0–1; higher is more readable | 42.2Δ 13.2 |
| Human | 3 | 1–4; original rating | 29.0 |
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. | 2712.961 | −89.528 |
| Source linesThe number of non-empty source lines. | 123 | +49.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. | 5.13 | −7.695 |
Intercept 8.87 + feature contributions = -39.153 (log-odds).
Score = sigmoid(-39.153) = 0.
| Score | 0.48 |
|---|
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. | 124 | −3.354 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 71 | +1.719 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 122.952 | +1.309 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 71 | −1.208 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 80 | +0.486 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.053 | +0.428 |
| 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. | 81.935 | +0.195 |
Intercept 0.07 + feature contributions = -0.356 (log-odds).
Score = sigmoid(-0.356) = 0.412.
| Score | 0.536 |
|---|
| Score | 29 |
|---|
Run 1
The code is generally readable but has some issues. The structure is logical - constructor, predicate method, and helper method - with clear separation. Variable naming is poor (dm, tr, t, g, sv, k) which hurts clarity of intent. The predicate2 method has moderate nesting and some awkward line breaks that disrupt reading flow. Action granularity is mostly good with one operation per line, though the chained method calls in noGuard are complex. The guard condition checking is verbose and could be extracted to a helper method for better readability. Comments are helpful where present. The line breaks in method chaining (Model.getFacade().equalsPseudostateKind...) are awkward. Overall, the code is understandable but could benefit from better variable names and cleaner conditional logic.
Run 2
The code is generally well-structured and readable. It has clear separation of concerns, good method length, and mostly one action per line. The class has a clear purpose with a descriptive name and Javadoc explaining the UML rule being enforced. However, the predicate2 method contains some deeply nested boolean expressions (particularly the guard/noGuard checks) that hurt readability. The equalsPseudostateKind call is awkwardly line-broken, interrupting visual flow. Some variables have single-letter names (t, g, sv, k) which reduces clarity despite reasonable contextual usage. The boolean logic for 'noGuard' could be extracted into a helper method. The overall structure is fine, but the complex conditional expressions would benefit from refactoring into smaller well-named methods.
Run 3
The code has clear intent with a well-defined purpose and is logically organized with setup, predicate, and materials retrieval. However, readability suffers from several issues: the method 'predicate2' lacks explanatory documentation for its logic, and the multi-line method chaining for guard validation in 'noGuard' is visually complex. The code is not deeply nested, but it uses early returns effectively, which is good. Action granularity is mostly one action per line, but the 'noGuard' expression breaks this pattern with a long, multi-line boolean expression. The reading flow is somewhat natural, but the sudden switch from straightforward checks to the complex 'noGuard' expression creates a jarring transition. The class is relatively concise, but the absence of comments explaining the 'noGuard' logic and the scattered placement of the serialVersionUID field at the end detract from overall clarity.
Run 1
Code Structure: The class is logically organized into initialization, validation, and metadata methods. Nesting: Early returns keep control flow flat and easy to follow. Clarity of intent: The class name and documentation explain the rule, but abbreviated variables such as tr, t, g, sv, and k obscure meaning; noGuard also introduces a negated condition. Code length: Implementation is reasonably concise, though repeated facade calls and lengthy boilerplate add reading overhead. Action granularity: Most statements perform one action, but the guard check combines several chained calls and conditions into a dense expression. Reading flow: Validation progresses naturally from transition type to fork source to trigger and guard checks, although awkward line wrapping and repeated expression retrieval interrupt readability.
Run 2
Code Structure: Well-organized class with separate constructor, validation method, and material-selection method. Nesting: Early returns keep control flow flat and easy to follow. Clarity of intent: Class documentation and descriptive boolean names explain the validation purpose, but abbreviated variables such as tr, t, g, sv, and k obscure details; noGuard also introduces negative logic. Code length: Implementation is reasonably concise, though repeated facade calls and the extensive license header increase reading effort. Action granularity: Generally one operation per statement, but the guard check combines several chained calls and null checks into a dense expression. Reading flow: Validation progresses logically from transition type to source kind to trigger and guard checks, although awkward line wrapping and inconsistent indentation interrupt the flow.
Run 3
Code Structure: The class is logically organized into initialization, validation, and metadata methods. Nesting: Early returns keep control flow flat and easy to follow. Clarity of intent: The class name and documentation explain the UML rule, but abbreviated variables such as tr, t, g, sv, and k obscure details; the negative noGuard flag adds mental overhead. Code length: Implementation is reasonably concise, though repeated facade calls and the lengthy license header increase reading effort. Action granularity: Statements generally perform one action per line, but the guard condition combines several checks with repeated expression retrieval. Reading flow: Validation proceeds naturally from transition type to fork source to trigger and guard checks, although awkward method-chain wrapping and inconsistent indentation interrupt readability.