Sample
Schnappinger/jsweet/def.dom.MouseEventInit
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0.077 | 0–1; higher is more readable | 73.9Δ 26.9 |
| Dorn | 0.584 | 0–1; higher is more readable | 65.7Δ 18.6 |
| Mi | 0.77 | 0–1; higher is more readable | 93.7Δ 46.7 |
| LLOC | 7 | Logical lines; fewer is more readable | 75.9Δ 28.9 |
| DeepSeek V4 Pro | 18.33 | 0–20; mean of three runs | 96.0Δ 49.0 |
| GPT-6.1 Sol | 19 | 0–20; mean of three runs | 92.6Δ 45.5 |
| BTTF | 0.671 | 0–1; higher is more readable | 72.6Δ 25.6 |
| Human | 3.87 | 1–4; original rating | 47.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. | 380.736 | −12.564 |
| Source linesThe number of non-empty source lines. | 20 | +8 |
| 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.522 | −6.784 |
Intercept 8.87 + feature contributions = -2.478 (log-odds).
Score = sigmoid(-2.478) = 0.077.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| 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.952 | +0.363 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 21 | +0.293 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.072 | +0.239 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 19.316 | −0.14 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 19 | −0.08 |
Intercept 0.07 + feature contributions = 0.339 (log-odds).
Score = sigmoid(0.339) = 0.584.
| Score | 0.77 |
|---|
| Score | 7 |
|---|
Run 1
The code is highly readable. The structure is logical: a single class declaration with a clear purpose (configuring mouse event initialization). It uses flat nesting with no conditional logic, only field declarations. Each field is on its own line, maintaining one action per line. The annotations (@jsweet.lang.Interface, @jsweet.lang.Optional) make intent explicit, indicating optional properties and interface semantics. The naming is descriptive (screenX, clientY, button, etc.) and follows consistent conventions. The code is concise—no unnecessary methods or overhead. The reading flow is natural: package, import, annotation, class declaration, then fields in a logical grouping. The only minor deduction is the repetitive @Optional annotation, which could arguably be handled at the class level, but this is a minor style preference rather than a readability issue. Overall, it is straightforward and easy to understand at a glance.
Run 2
The code is highly readable due to its clear, flat structure and logical organization. It defines a MouseEventInit class with optional fields, each declared on a single line, which maintains concise action granularity and avoids nesting. The inheritance from SharedKeyboardAndMouseEventInit is explicit, and the use of @jsweet.lang.Optional annotations clearly indicates intent. The only minor drawback is slight verbosity from repeated annotations, but this is necessary for framework semantics and does not hinder readability.
Run 3
The code is highly readable. It has a clear, logical structure as a single class extending a parent, with flat, non-nested fields. Purpose is explicit through meaningful class and property names (e.g., `MouseEventInit`, `screenX`, `clientY`). Length is concise and avoids redundancy. Action granularity is clean, with one field declaration per line. Reading flow is natural, following standard Java-style conventions. Slight deduction for reliance on external annotations like `@jsweet.lang.Interface` and `@jsweet.lang.Optional` which could obscure intent for those unfamiliar with jsweet, but overall the code is almost entirely self-explanatory.
Run 1
Code Structure: A logically organized class groups related mouse-event initialization fields and clearly declares its inheritance. Nesting: Entirely flat, with no nested control flow. Clarity of intent: The class name, standard field names, and Optional annotations communicate purpose clearly, although button versus buttons may require domain knowledge. Code length: Concise; repeated annotations are necessary rather than excessive. Action granularity: Each annotation and field declaration occupies its own line. Reading flow: Consistent formatting and a natural progression from coordinates to button information and the related target make the code easy to scan.
Run 2
Code Structure: A straightforward declaration groups mouse-event initialization fields within an appropriately named class. Nesting: No nested logic; all fields are at the same level. Clarity of intent: The class name, superclass, descriptive field names, and optional annotations clearly communicate purpose, although button versus buttons requires domain knowledge. Code length: Concise, with only necessary declarations and annotations. Action granularity: Each field and annotation occupies its own line, making individual properties easy to identify. Reading flow: Consistent formatting and a natural progression from screen coordinates to client coordinates, button information, and the related target support effortless scanning.
Run 3
Code Structure: A straightforward class groups related mouse-event initialization fields and clearly expresses inheritance. Nesting: No nested control flow or unnecessary structural depth. Clarity of intent: Descriptive class and field names, types, and Optional annotations make the purpose clear, though button versus buttons requires domain knowledge. Code length: Compact, with annotation repetition serving a necessary purpose. Action granularity: Each field declaration and annotation occupies its own line. Reading flow: Consistent formatting and logical ordering—from screen coordinates to client coordinates, button state, and related target—make the code easy to scan.