Sample
Schnappinger/jsweet/def.dom.MouseEvent
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 47.8Δ 43.3 |
| Scalabrino | 0.557 | 0–1; higher is more readable | 15.1Δ 76.0 |
| Dorn | 0 | 0–1; higher is more readable | 3.0Δ 88.1 |
| Mi | 0 | 0–1; higher is more readable | 0.3Δ 90.8 |
| LLOC | 30 | Logical lines; fewer is more readable | 49.2Δ 41.9 |
| DeepSeek V4 Pro | 14.67 | 0–20; mean of three runs | 34.8Δ 56.3 |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs | 38.9Δ 52.1 |
| BTTF | 0.312 | 0–1; higher is more readable | 22.1Δ 69.0 |
| Human | 4 | 1–4; original rating | 91.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. | 1596.975 | −52.7 |
| Source linesThe number of non-empty source lines. | 35 | +14 |
| 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.647 | −6.97 |
Intercept 8.87 + feature contributions = -36.8 (log-odds).
Score = sigmoid(-36.8) = 0.
| Score | 0.557 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| 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. | 406.972 | −13.573 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 1 | −0.703 |
| 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.066 | +0.303 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 36 | −0.238 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 34.821 | +0.077 |
Intercept 0.07 + feature contributions = -14.47 (log-odds).
Score = sigmoid(-14.47) = 0.
| Score | 0 |
|---|
| Score | 30 |
|---|
Run 1
The code has a clear, logical structure as a domain model class, listing many related properties and methods. However, readability is significantly harmed by extremely long method signatures—especially the initMouseEvent method—that cram multiple parameters onto a single line, making it difficult to visually parse. Action granularity suffers because multiple parameters share one line rather than one per line, and the reading flow is disrupted by the long parameter list. Nesting is flat and clarity of intent is decent, but the use of fully qualified java.lang.Boolean and java.lang.String types adds unnecessary verbosity. Overall, the organization is predictable and straightforward, but formatting and verbosity prevent it from being highly readable.
Run 2
The code has a clear, logical structure: all fields grouped together, followed by methods and constructors, making it easy to scan. It is flat with no nesting, which aids readability. Naming is explicit and follows typical DOM API conventions, so intent is clear for developers familiar with the domain. However, readability is reduced by very long method signatures (e.g., initMouseEvent) that contain many parameters, making them hard to parse quickly. Action granularity is generally one field or method per line, which is good. The reading flow is natural from fields to methods, but the excessively verbose fully qualified names like java.lang.Boolean add noise. Some redundancy (e.g., multiple constructors with empty bodies) could be simplified, but overall the code is fairly readable but suffers from dense parameter lists.
Run 3
The code is a straightforward DOM type declaration with excellent structure: fields are grouped logically and ordered by type, with a single field per line. Nesting is minimal (class-level only), and clarity of intent is high—each field and method maps clearly to the MouseEvent specification. The two long method signatures (getModifierState and initMouseEvent) slightly reduce readability due to their horizontal length, but this is common in API bindings. Action granularity is appropriate, and reading flow is natural, though the constructor overloads at the bottom could be grouped more explicitly with comments. Overall, highly readable for a generated or boilerplate DOM class.
Run 1
Code Structure: A straightforward event-binding class, with fields followed by methods and constructors; the prototype field slightly interrupts this organization. Nesting: Flat, with no nested logic. Clarity of intent: Familiar mouse-event property names and inheritance make the purpose clear, though overlapping coordinates and legacy fields lack explanations. Code length: Concise overall, but fully qualified types add visual noise, and initMouseEvent has an excessively long signature. Action granularity: Each declaration occupies its own line, making individual members easy to identify. Reading flow: Consistent declarations support scanning, but missing blank lines between member groups, unconventional modifier ordering, and tightly formatted empty constructors reduce readability.
Run 2
Code Structure: A straightforward class declaration separates fields, methods, and constructors, although the static prototype field interrupts this grouping. Nesting: Flat, with no nested control flow. Clarity of intent: The class name, inheritance, and conventional event-property names make its purpose clear; native declarations and empty constructors suggest an API binding, but this is not documented. Code length: Concise overall, though fully qualified java.lang types add visual noise and initMouseEvent has an excessively long signature. Action granularity: Each field, method, and constructor occupies its own line, making declarations easy to scan. Reading flow: Generally predictable, but minimal spacing, limited semantic grouping of related properties, and the unwrapped parameter list reduce readability.
Run 3
Code Structure: A straightforward class declaration separates fields, methods, and constructors, though spacing and semantic field grouping would improve organization. Nesting: Essentially flat, with no nested control flow. Clarity of intent: The class name, inheritance, and familiar mouse-event properties clearly identify its purpose; native methods and empty constructors lack explanatory context. Code length: Concise overall, but initMouseEvent has an excessively long signature that would benefit from wrapping. Action granularity: Each field, method, and constructor occupies its own line, making individual declarations easy to scan. Reading flow: Generally natural from properties to methods to constructors, but the prototype field interrupts that progression, and fully qualified types add visual noise.