Sample
Schnappinger/jsweet/def.dom.PointerEvent
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 51.8Δ 17.6 |
| Scalabrino | 0.663 | 0–1; higher is more readable | 30.1Δ 39.3 |
| Dorn | 0 | 0–1; higher is more readable | 1.3Δ 68.2 |
| Mi | 0 | 0–1; higher is more readable | 0.0Δ 69.5 |
| LLOC | 19 | Logical lines; fewer is more readable | 61.6Δ 7.9 |
| DeepSeek V4 Pro | 12.33 | 0–20; mean of three runs | 17.2Δ 52.3 |
| GPT-6.1 Sol | 15 | 0–20; mean of three runs | 25.7Δ 43.7 |
| BTTF | 0.14 | 0–1; higher is more readable | 5.3Δ 64.2 |
| 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. | 1178.657 | −38.896 |
| Source linesThe number of non-empty source lines. | 23 | +9.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.623 | −6.935 |
Intercept 8.87 + feature contributions = -27.761 (log-odds).
Score = sigmoid(-27.761) = 0.
| Score | 0.663 |
|---|
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. | 556.958 | −19.926 |
| 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 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.052 | +0.44 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 24 | +0.187 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 22.839 | −0.091 |
Intercept 0.07 + feature contributions = -20.429 (log-odds).
Score = sigmoid(-20.429) = 0.
| Score | 0 |
|---|
| Score | 19 |
|---|
Run 1
This is a straightforward domain class definition, but readability suffers from several issues. The structure is flat and logical for a typed API wrapper, and fields are clearly named. However, the initPointerEvent method signature is extremely long, making it hard to scan and understand. Several fields like currentPoint and intermediatePoints are typed as Object, reducing clarity of intent. The class contains multiple constructors with empty bodies, which adds verbosity without explanatory comments. Native methods lack documentation, making their purpose ambiguous. The overall layout is consistent, but the lack of whitespace or grouping between related fields and methods hampers natural reading flow. Action granularity is generally acceptable, though the single multi-parameter method violates the principle of one action per line.
Run 2
The code is a straightforward Java class declaration with clear field names and method signatures. The structure is flat, with all fields at the top followed by methods, which is logical. Nesting is minimal (only class-level). The intent is clear: define a POJO-like DOM event class. However, readability suffers from long parameter lists in methods like `initPointerEvent`, which reduce clarity. The code is concise, with one field or method per line, aiding scanning. Reading flow is natural from top to bottom, but the use of `Object` and `Boolean` types instead of more specific types introduces ambiguity. Overall, it is easy to understand but could be improved with better type definitions and breaking up the long method signature.
Run 3
The code is a straightforward data class, but its readability is hampered by several factors. The structure is flat and simple, which is good, but it's essentially a wall of declarations with little logical grouping. Intent is mostly clear—it's an event class—but the sheer number of fields and long method signatures obscure it. Code length is excessive due to the verbose initPointerEvent with 20+ parameters; this is unnecessarily long and hard to scan. Action granularity is fine as each field/method is on its own line. Reading flow is poor because related fields (e.g., width/height, tiltX/tiltY) are scattered and method signatures are unwieldy. The native methods with vague names like getCurrentPoint and intermediatePoints add ambiguity. Naming is consistent, but the use of Object for pointerType and currentPoint weakens type clarity. Overall, the code is readable at a glance but painful to actually use or review due to poor grouping and monolithic method signatures.
Run 1
Code Structure: The class is logically organized into fields, native methods, and constructors, though the static prototype field interrupts that grouping. Nesting: There is no meaningful nesting, making the declaration easy to scan. Clarity of intent: The class name, inheritance, and most member names clearly describe a pointer-event API; Object-typed fields and undocumented native methods reduce precision. Code length: The class is concise, but initPointerEvent has an exceptionally long parameter list on one line. Action granularity: Each declaration occupies its own line, with no bundled operations. Reading flow: The order is mostly natural, but missing whitespace between sections, tightly formatted empty constructors, unconventional modifier ordering, and the oversized method signature make reading less comfortable.
Run 2
Code Structure: The class is logically organized into fields, native methods, a prototype field, and constructors, though spacing would better distinguish these sections. Nesting: There is no deep nesting; the declarations are flat and easy to scan. Clarity of intent: The class name, inheritance, and most member names clearly identify a pointer-event API, but Object types and undocumented native methods leave some details ambiguous. Code length: The class is concise, but initPointerEvent has an excessively long, unwrapped parameter list that is difficult to read. Action granularity: Each field, method, and constructor occupies its own line, with no bundled actions. Reading flow: The overall order is natural, but the dense formatting, empty constructor bodies without spacing, and inconsistent parameter naming interrupt readability.
Run 3
Code Structure: The class is logically organized into fields, native methods, and constructors, though the static prototype field interrupts that grouping. Nesting: There is no meaningful nesting beyond the class, making it easy to scan. Clarity of intent: The class name, inheritance, and most member names clearly indicate a pointer-event API; Object types and undocumented native methods leave some details ambiguous. Code length: The declaration is concise, but initPointerEvent has an excessively long, unwrapped parameter list. Action granularity: Each field, method, and constructor occupies its own line, with no combined actions. Reading flow: The overall order is understandable, but missing blank lines, tightly formatted empty constructors, and the lengthy method signature reduce readability.