Sample
Schnappinger/jsweet/def.dom.MSBaseReader
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 28.1Δ 61.7 |
| Scalabrino | 0.205 | 0–1; higher is more readable | 1.0Δ 88.7 |
| Dorn | 0.02 | 0–1; higher is more readable | 23.4Δ 66.3 |
| Mi | 0.011 | 0–1; higher is more readable | 3.0Δ 86.8 |
| LLOC | 28 | Logical lines; fewer is more readable | 50.7Δ 39.1 |
| DeepSeek V4 Pro | 12.33 | 0–20; mean of three runs | 17.2Δ 72.6 |
| GPT-6.1 Sol | 14.67 | 0–20; mean of three runs | 21.1Δ 68.6 |
| BTTF | 0.237 | 0–1; higher is more readable | 14.9Δ 74.9 |
| Human | 4 | 1–4; original rating | 89.8 |
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. | 4436.075 | −146.39 |
| Source linesThe number of non-empty source lines. | 43 | +17.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.72 | −7.08 |
Intercept 8.87 + feature contributions = -127.4 (log-odds).
Score = sigmoid(-127.4) = 0.
| Score | 0.205 |
|---|
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. | 178.955 | −3.915 |
| 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. | 42 | +0.716 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 44 | −0.522 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 42.867 | +0.189 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.1 | −0.028 |
Intercept 0.07 + feature contributions = -3.896 (log-odds).
Score = sigmoid(-3.896) = 0.02.
| Score | 0.011 |
|---|
| Score | 28 |
|---|
Run 1
This code is a machine-generated interface definition, likely from a TypeScript-to-Java transpiler (JSweet). It is structurally logical and flat, with one declaration per line, which aids scanning. However, readability suffers from extreme verbosity and redundancy: the many overloaded addEventListener signatures create repetitive blocks that obscure intent. The fully-qualified type names (e.g., java.util.function.Function<Event,java.lang.Object>) add noise. Action granularity is fine, but the reading flow is monotonous and ceremonial. The class lacks documentation, making it hard to understand the intended usage without external context. While the structure is predictable, the sheer length and repetitiveness reduce clarity and make the code feel mechanical rather than crafted for human readers. Overall, it is legible but not pleasant to read.
Run 2
The code is generated API bindings (likely from TypeScript definitions via jsweet), so it is structurally repetitive by design. Organization is generally logical: fields, constants, then method overloads. The class is flat, with no deep nesting. However, readability is hampered by extremely long lines with multiple fully-qualified types (e.g., java.util.function.Function<Event,java.lang.Object>), which reduce scanning ease and create dense signatures. Intent is clear for each overload, but the overload count is excessive and makes the class feel cluttered. Action granularity is one method per line but tokens are packed tightly. Reading flow is mechanical, not narrative; a human reader gets lost in repeated verbose signatures. Overall, while the code is predictable and lacks logic complexity, its verbosity and repetition lower its readability score.
Run 3
The code is structurally consistent but exhibits readability issues. It relies heavily on verbose, fully-qualified type names, resulting in long, repetitive signatures that hamper scanning. The overloading of addEventListener is extensive and tiring to read; combining or documenting these overloads would improve comprehension. While methods are flat and one action per line, repetitive patterns across near-identical overloads create noise. The interface’s purpose—mapping a DOM type—is fairly clear, but external readers unfamiliar with generated or ported Java APIs may find it daunting. Some nested generics (e.g., Function<Event,java.lang.Object>) add complexity, yet the lack of comments or organization by category reduces clarity. Overall, the code is serviceable but not highly readable.
Run 1
Code Structure: Fields and listener overloads are consistently organized, but abort() interrupts the field declarations, and logical groups lack spacing. Nesting: Completely flat apart from the class scope, making scanning easy. Clarity of intent: Familiar event names and descriptive parameters communicate the API's purpose, although undocumented state fields and native signatures provide limited context. Code length: Reasonable for an API binding, but repetitive overloads, unused imports, and fully qualified types add visual bulk. Action granularity: Each line contains one declaration, keeping responsibilities distinct. Reading flow: Predictable declaration patterns help navigation, but long signatures, dense formatting, and inconsistent overload grouping reduce readability.
Run 2
Code Structure: Fields and listener overloads are mostly grouped logically, although abort() interrupts the fields and state constants. Nesting: Completely flat, making navigation straightforward. Clarity of intent: Familiar event names and descriptive parameter names convey the API's purpose, but result and readyState lack documentation. Code length: Reasonable for an API binding, though repetitive overloads and fully qualified types add verbosity despite existing imports. Action granularity: Each declaration occupies its own line, with no combined actions. Reading flow: Consistent declaration patterns help scanning, but long signatures, minimal whitespace between sections, and repeated type qualifications make the class visually dense.
Run 3
Code Structure: Fields and listener overloads are broadly organized, but state constants are separated from readyState by abort(), and unused imports add clutter. Nesting: Completely flat apart from the class scope, making declarations easy to follow. Clarity of intent: Event-handler names and method signatures clearly describe a reader API, although no documentation explains state values or overload differences. Code length: Reasonable for an API binding, but repetitive overloads and fully qualified types make it visually verbose. Action granularity: Each line contains a single declaration, with no bundled operations. Reading flow: Consistent formatting and predictable overload ordering help scanning, but long signatures, missing whitespace between generic arguments, and no blank-line grouping reduce readability.