Sample
Schnappinger/jsweet/def.dom.HTMLOListElement
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0.549 | 0–1; higher is more readable | 80.6Δ 46.9 |
| Scalabrino | 0.853 | 0–1; higher is more readable | 76.7Δ 43.0 |
| Dorn | 0.908 | 0–1; higher is more readable | 97.0Δ 63.4 |
| Mi | 0.709 | 0–1; higher is more readable | 84.8Δ 51.2 |
| LLOC | 5 | Logical lines; fewer is more readable | 83.0Δ 49.3 |
| DeepSeek V4 Pro | 15 | 0–20; mean of three runs | 38.0Δ 4.3 |
| GPT-6.1 Sol | 17.33 | 0–20; mean of three runs | 61.4Δ 27.7 |
| BTTF | 0.684 | 0–1; higher is more readable | 76.2Δ 42.6 |
| Human | 3.23 | 1–4; original rating | 33.7 |
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.645 | −6.968 |
| Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones. | 197.153 | −6.506 |
| Source linesThe number of non-empty source lines. | 12 | +4.8 |
Intercept 8.87 + feature contributions = 0.196 (log-odds).
Score = sigmoid(0.196) = 0.549.
| Score | 0.853 |
|---|
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. | 51 | +1.505 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 13 | +0.576 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 9 | −0.426 |
| 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.057 | +0.393 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 11.692 | −0.246 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 51 | +0.018 |
Intercept 0.07 + feature contributions = 2.288 (log-odds).
Score = sigmoid(2.288) = 0.908.
| Score | 0.709 |
|---|
| Score | 5 |
|---|
Run 1
The code is structurally simple and concise, but readability suffers from a lack of context and organization relative to real-world usage. Structure is bare-minimum—just fields and a constructor—but this is typical for DOM definitions. Nesting is flat and action granularity is fine, with one field per line. However, intent is unclear without surrounding documentation; fields like 'compact', 'start', and 'type' lack meaningful descriptions, and the 'prototype' field with no instantiation is confusing. Reading flow is adequate but abrupt. The method's empty constructor and the unused 'prototype' static field could raise questions. Overall, it's understandable but not exemplary for clarity or maintainability.
Run 2
The code is highly readable. It has a clear, flat structure with no nesting. The intent is evident: it defines a domain object representing an HTML ordered list element. Each field is declared on its own line, maintaining clear action granularity. The JSDoc comment on 'start' adds useful context. The only minor deduction is the use of fully qualified names (java.lang.Boolean, java.lang.String) which adds slight verbosity, and the presence of a static 'prototype' field that could confuse readers unfamiliar with TypeScript-style DOM bindings. Overall, the reading flow is natural and concise.
Run 3
The code is highly readable. Structure is clean: a single class with a standard constructor and three clearly named public fields, preceded by a concise JSDoc comment for the only non-obvious field. Nesting is minimal — one class, no complex control flow. Intent is transparent: it defines an HTML ordered list element with specific attributes. Length is appropriate and not verbose. Each field declaration occupies its own line, maintaining one-action-per-line granularity. Reading flow is natural: fields are grouped logically, and the descriptive comment enhances understanding without clutter. Overall, this is a textbook example of a simple, well-organized DOM class definition.
Run 1
Code Structure: The package declaration and simple class definition are logically organized, though instance fields and the static prototype could be separated visually. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: The class name and inheritance communicate its role as an HTML ordered-list element, and the start field is documented; compact, type, and prototype lack explanations. Code length: Concise, with no unnecessary logic, although fully qualified java.lang types add visual noise. Action granularity: Each declaration occupies its own line, keeping individual elements distinct. Reading flow: The declarations follow a straightforward sequence, but inconsistent spacing, sparse documentation, and the tightly formatted empty constructor slightly reduce readability.
Run 2
Code Structure: A straightforward class declaration logically groups fields and a constructor, though the static prototype could be separated from instance fields. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: Class and field names suggest an HTML ordered-list element; the start comment helps, but compact, type, and prototype lack explanation. Code length: Concise, with no unnecessary logic; fully qualified java.lang types add minor visual noise. Action granularity: Each declaration occupies its own line. Reading flow: Natural top-to-bottom organization, slightly weakened by the absence of spacing between sections and the tightly formatted empty constructor.
Run 3
Code Structure: Simple, logically organized class with related fields and a constructor. Nesting: Flat, with no nested control flow. Clarity of intent: The class name and inheritance identify an HTML ordered-list element, but compact, type, and prototype lack explanations; only start is documented. Code length: Concise, with no unnecessary implementation. Action granularity: Each declaration occupies its own line, making individual members easy to scan. Reading flow: Natural top-to-bottom organization, though missing blank lines, fully qualified common types, and the tightly formatted empty constructor slightly reduce visual readability.