Sample
Schnappinger/junit4/org.junit.runner.notification.SynchronizedRunListener
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 55.5Δ 14.0 |
| Scalabrino | 0.795 | 0–1; higher is more readable | 61.0Δ 8.5 |
| Dorn | 0.862 | 0–1; higher is more readable | 94.4Δ 24.9 |
| Mi | 0.701 | 0–1; higher is more readable | 83.5Δ 14.0 |
| LLOC | 37 | Logical lines; fewer is more readable | 45.2Δ 24.3 |
| DeepSeek V4 Pro | 17.67 | 0–20; mean of three runs | 83.0Δ 13.5 |
| GPT-6.1 Sol | 19 | 0–20; mean of three runs | 92.6Δ 23.1 |
| BTTF | 0.699 | 0–1; higher is more readable | 80.9Δ 11.4 |
| Human | 3.95 | 1–4; original rating | 69.5 |
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. | 1930.661 | −63.712 |
| Source linesThe number of non-empty source lines. | 103 | +41.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.479 | −6.718 |
Intercept 8.87 + feature contributions = -20.36 (log-odds).
Score = sigmoid(-20.36) = 0.
| Score | 0.795 |
|---|
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. | 104 | −2.646 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 88 | +2.307 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 102.742 | +1.026 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 94.096 | +0.714 |
| 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. | 95.981 | −0.4 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.06 | +0.363 |
Intercept 0.07 + feature contributions = 1.831 (log-odds).
Score = sigmoid(1.831) = 0.862.
| Score | 0.701 |
|---|
| Score | 37 |
|---|
Run 1
The code exhibits excellent readability. Its structure is logical: a single class with a clear purpose, documented well. Nesting is minimal, with one level of synchronized blocks and straightforward conditionals. Intent is clear from the class name, Javadoc, and method names. The code is concise, avoiding unnecessary verbosity while maintaining readability. Each method performs a single action, and the synchronized blocks have a single delegate call per line. Reading flow is natural, following a consistent pattern across lifecycle methods. Minor deductions for the legacy 'f' prefix on fields and the slightly verbose Javadoc, but overall it is highly readable.
Run 2
The code is highly readable. It follows a clear, consistent structure: each overridden method simply synchronizes on a monitor and delegates to the wrapped listener. Nesting is minimal—only one level of synchronized blocks. The class and method purposes are evident from the Javadoc and naming. Code length is concise; each method is only a few lines, with one action per line. Reading flow is natural, with methods logically grouped. Minor deductions: a typo in the Javadoc ('sychronized') and slightly verbose equals method, but overall this is exemplary for a decorator pattern.
Run 3
The code is highly readable. Structure is logical, with a clear decorator pattern and consistent organization of overridden methods. Nesting is flat: each method contains only a single synchronized block. Intent is explicit through class name, Javadoc, and method naming. Code length is appropriate—each delegation is concise and avoids unnecessary abstraction. Action granularity respects one action per line: delegation happens inside a clearly scoped synchronized block. Reading flow is natural, grouping listener callbacks, then standard Object method overrides. Minor deductions: repeated synchronized/delegate boilerplate could be reduced with a helper, and the Javadoc has a minor typo ('sychronized'), but these do not materially affect comprehension.
Run 1
Code Structure: Fields, constructor, listener callbacks, and object overrides are logically grouped. Nesting: Each callback has only one synchronization block, and equals uses clear early returns. Clarity of intent: The class name, annotation, and documentation clearly explain the decorator and shared-monitor rationale; the f-prefixed field names are slightly less natural. Code length: Repeated callback wrappers add length but are straightforward and justified by the interface. Action granularity: Each statement performs a single action, making delegation and synchronization easy to follow. Reading flow: Consistent formatting and predictable method patterns support smooth reading. Minor drawbacks are repetitive boilerplate and a documentation typo.
Run 2
Code Structure: Fields, constructor, listener callbacks, and utility overrides are logically grouped. Nesting: Each callback has only one synchronization block, and equals uses straightforward early returns. Clarity of intent: The class name, method names, and documentation clearly explain the synchronization decorator and its rationale; the f-prefixed fields are slightly dated but understandable. Code length: Repeated callback wrappers add length, but the repetition is necessary and makes behavior explicit. Action granularity: Each statement performs a single clear action, with no compressed logic. Reading flow: Consistent formatting and predictable delegation make the class easy to scan from initialization through callbacks to equality and string representation. Minor documentation imperfections, including a typo and describing the generic monitor as a RunNotifier instance, slightly reduce polish.
Run 3
Code Structure: Logically organized into fields, constructor, listener callbacks, and object-method overrides. Nesting: Shallow, with only a single synchronization block per callback and simple guard clauses in equals. Clarity of intent: The class name, descriptive method names, and documentation clearly explain the synchronized decorator and its shared-monitor rationale; the legacy f-prefix field names are slightly less natural. Code length: Concise overall; repeated callback wrappers add length but make synchronization explicit and consistent. Action granularity: Each statement performs one clear action, with delegation and synchronization visibly separated. Reading flow: Consistent formatting and predictable method patterns make the code easy to scan from initialization through event handling to equality and representation.