Sample
Schnappinger/jsweet/def.dom.HTMLUnknownElement
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0.768 | 0–1; higher is more readable | 84.6Δ 2.8 |
| Scalabrino | 0.83 | 0–1; higher is more readable | 70.5Δ 11.3 |
| Dorn | 0.792 | 0–1; higher is more readable | 83.5Δ 1.7 |
| Mi | 0.522 | 0–1; higher is more readable | 37.6Δ 44.2 |
| LLOC | 2 | Logical lines; fewer is more readable | 94.6Δ 12.7 |
| DeepSeek V4 Pro | 18.67 | 0–20; mean of three runs | 98.3Δ 16.5 |
| GPT-6.1 Sol | 18.67 | 0–20; mean of three runs | 86.5Δ 4.6 |
| BTTF | 0.742 | 0–1; higher is more readable | 90.1Δ 8.3 |
| Human | 3.96 | 1–4; original rating | 81.8 |
Views
Loading feature diagnosis…
Source regions
Feature contributions
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| 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.693 | −7.039 |
| Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones. | 92 | −3.036 |
| Source linesThe number of non-empty source lines. | 6 | +2.4 |
Intercept 8.87 + feature contributions = 1.195 (log-odds).
Score = sigmoid(1.195) = 0.768.
| Score | 0.83 |
|---|
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. | 53 | +1.42 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 7 | +0.788 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 5 | −0.564 |
| 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.06 | +0.359 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 5.741 | −0.33 |
Intercept 0.07 + feature contributions = 1.338 (log-odds).
Score = sigmoid(1.338) = 0.792.
| Score | 0.522 |
|---|
| Score | 2 |
|---|
Run 1
The code is highly readable. It has a clear, logical structure with a simple package declaration, class definition, and constructor. There is no nesting, and the intent is unambiguous: defining an HTMLUnknownElement type that extends HTMLElement. The code length is minimal and appropriate for its purpose. Action granularity is ideal, with each declaration on its own line. Reading flow is natural and straightforward.
Run 2
The code is concise and structurally simple. It clearly defines a class `HTMLUnknownElement` extending `HTMLElement` with a public static prototype and an empty constructor. The organization is logical: package declaration, imports, class signature, fields, constructor. Nesting is minimal—one class with no conditional or method nesting. Intent is unambiguous given the context of DOM typing. Length is appropriate; no unnecessary code exists. Each action (package, class, field, constructor) appears on its own line, enhancing clarity. Reading flow is natural from top to bottom. Minor deductions: missing documentation or access modifiers on the constructor reduce immediate clarity for unfamiliar readers.
Run 3
The code is highly readable due to its simplicity and clarity. It has a flat structure with no nesting, one clear class definition, and concise purpose: defining an HTMLUnknownElement class extending HTMLElement. Each line performs a single action, and the reading flow is natural (package, class declaration, property, constructor). Minor deductions for lack of documentation or access modifiers on the prototype field, which slightly affects intent clarity, but overall the code is straightforward and uncluttered.
Run 1
Code Structure: A straightforward class declaration with a clear inheritance relationship and neatly grouped members. Nesting: Minimal, with no nested control flow. Clarity of intent: The class name and superclass clearly identify its DOM role, though the public static prototype field's purpose relies on familiarity with DOM bindings. Code length: Very concise, with no unnecessary logic. Action granularity: Each declaration occupies its own line; the empty constructor is simple enough to remain inline. Reading flow: Natural progression from package to class, field, and constructor. Missing spacing and blank lines slightly reduce visual polish.
Run 2
Code Structure: The package declaration, class, field, and constructor are logically organized. Nesting: Only the necessary class scope is present, with no nested control flow. Clarity of intent: The class name and inheritance clearly identify an unknown HTML element, though the purpose of the public static prototype field is not explained. Code length: The code is concise, with no unnecessary statements. Action granularity: Each declaration occupies its own line. Reading flow: The order is natural and easy to follow, but blank lines between declarations and spacing in the empty constructor would improve readability.
Run 3
Code Structure: The package declaration and class definition are logically organized. Nesting: Only the necessary class and constructor scopes are present. Clarity of intent: The class name and inheritance clearly identify an unknown HTML element, though the public static prototype field's purpose is not explained. Code length: The implementation is minimal, with no unnecessary code. Action granularity: Each declaration occupies its own line. Reading flow: The code reads naturally from package to class to members, although a blank line after the package declaration and conventional spacing in the empty constructor would improve formatting.