Sample
Schnappinger/jsweet/def.dom.SVGFEMergeElement
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 63.5Δ 60.9 |
| Scalabrino | 0.687 | 0–1; higher is more readable | 35.6Δ 33.0 |
| Dorn | 0.357 | 0–1; higher is more readable | 52.1Δ 49.5 |
| Mi | 0.078 | 0–1; higher is more readable | 8.9Δ 6.3 |
| LLOC | 11 | Logical lines; fewer is more readable | 70.6Δ 68.0 |
| DeepSeek V4 Pro | 13.33 | 0–20; mean of three runs | 24.1Δ 21.5 |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs | 38.9Δ 36.3 |
| BTTF | 0.603 | 0–1; higher is more readable | 57.8Δ 55.1 |
| Human | 1.93 | 1–4; original rating | 2.6 |
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. | 572.024 | −18.877 |
| 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.709 | −7.064 |
| Source linesThe number of non-empty source lines. | 16 | +6.4 |
Intercept 8.87 + feature contributions = -10.671 (log-odds).
Score = sigmoid(-10.671) = 0.
| Score | 0.687 |
|---|
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 |
| 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. | 103 | −0.697 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 17 | +0.434 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.054 | +0.417 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 15 | −0.218 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 15.798 | −0.189 |
Intercept 0.07 + feature contributions = -0.589 (log-odds).
Score = sigmoid(-0.589) = 0.357.
| Score | 0.078 |
|---|
| Score | 11 |
|---|
Run 1
The code is a concise Java class definition, but readability is moderate. Structure is simple and flat, which is positive, but the intent is unclear without context—this appears to be an auto-generated DOM binding. Nested code is absent, and each member is on its own line, aiding granularity. However, the purpose of methods like addEventListener overloads and the prototype field is opaque without domain knowledge. The class is short, but lacks internal logic; the overloads are repetitive and could be compressed with varargs or interfaces. Reading flow is consistent but stilted due to the repetitive method signatures. The annotation is meaningful for library developers but may confuse general readers.
Run 2
The code is a simple Java class definition for an SVG DOM element, making it relatively easy to understand at a glance. The structure is straightforward: fields are declared, followed by constructors and method overloads. Nesting is minimal, and each field is on its own line, improving readability. However, the repetitive overloaded methods add unnecessary length, and the use of the @jsweet.lang.Extends annotation with a class literal is slightly cryptic without context. The intent is clear—defining an SVG element with event listener methods and properties—but the ambiguity of the native keyword and the lack of comments or documentation reduce clarity. Action granularity is good, as each field is declared per line, but the constructor and method declarations are compact. Reading flow is acceptable but disrupted by the disjointed order of fields and methods. Overall, the code is readable for a developer familiar with Java and SVG DOM APIs, but could be improved with comments or a more logical grouping of methods.
Run 3
The code is highly readable due to its flat structure, minimal nesting, and clear, predictable organization. Fields and methods are grouped logically, and each declaration occupies its own line, reflecting good action granularity. The repeated method overloads are concise and follow a consistent pattern, but some redundancy could be reduced with default parameters or comments. Minor ambiguity exists around the 'prototype' field and the unconventional constructor, which may confuse readers unfamiliar with the library's conventions.
Run 1
Code Structure: The class is simple, but event-listener overloads are split around the constructor and fields rather than grouped logically. Nesting: Minimal nesting makes the declaration easy to scan. Clarity of intent: The class name, inheritance, annotation, and typed fields clearly identify an SVG DOM binding, though native declarations may require familiarity with JSweet. Code length: Concise, with no unnecessary implementation or boilerplate. Action granularity: Each declaration occupies its own line, avoiding bundled actions. Reading flow: Generally straightforward, but inconsistent member ordering and the absence of blank lines between logical groups interrupt the flow slightly.
Run 2
Code Structure: The class is straightforward, but related addEventListener overloads are split around fields and the constructor rather than grouped together. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: Descriptive SVG types and member names indicate a DOM binding, though native declarations and the annotation require framework knowledge. Code length: Concise, with little unnecessary content. Action granularity: Each declaration occupies its own line, avoiding combined operations. Reading flow: Generally clear, but the lack of blank lines, compact empty constructor, and scattered overloads interrupt the natural progression.
Run 3
Code Structure: The class is straightforward, but event-listener overloads are split around fields and the constructor rather than grouped logically. Nesting: Minimal nesting makes the declaration easy to scan. Clarity of intent: The class name, inheritance, annotation, and typed members clearly identify an SVG DOM binding, although native declarations provide no behavioral explanation. Code length: Concise, with little unnecessary content; overload repetition is appropriate for the API. Action granularity: Each declaration occupies its own line, avoiding bundled operations. Reading flow: Mostly natural, but absent spacing between sections, the tightly formatted constructor, and inconsistent member ordering slightly reduce readability.