Sample
Schnappinger/jsweet/def.dom.SVGElementInstance
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0.357 | 0–1; higher is more readable | 76.9Δ 0.1 |
| Scalabrino | 0.83 | 0–1; higher is more readable | 70.5Δ 6.5 |
| Dorn | 0.847 | 0–1; higher is more readable | 92.1Δ 15.0 |
| Mi | 0.53 | 0–1; higher is more readable | 38.0Δ 39.1 |
| LLOC | 10 | Logical lines; fewer is more readable | 72.4Δ 4.6 |
| DeepSeek V4 Pro | 17.67 | 0–20; mean of three runs | 83.0Δ 5.9 |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs | 73.8Δ 3.3 |
| BTTF | 0.685 | 0–1; higher is more readable | 76.9Δ 0.2 |
| Human | 3.96 | 1–4; original rating | 77.1 |
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. | 261.519 | −8.63 |
| 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.552 | −6.828 |
| Source linesThe number of non-empty source lines. | 15 | +6 |
Intercept 8.87 + feature contributions = -0.588 (log-odds).
Score = sigmoid(-0.588) = 0.357.
| 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. | 52.938 | +1.423 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.034 | +0.61 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 16 | +0.47 |
| 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. | 14 | −0.253 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 14.926 | −0.201 |
Intercept 0.07 + feature contributions = 1.712 (log-odds).
Score = sigmoid(1.712) = 0.847.
| Score | 0.53 |
|---|
| Score | 10 |
|---|
Run 1
The code is highly readable. It clearly defines a DOM class with a logical, flat structure. There is no nesting or complex logic, and each field is declared on its own line, demonstrating good action granularity. The class and field names are descriptive and follow standard Java naming conventions, making the intent clear. The constructor is minimal and empty, which is acceptable for a type definition. Overall, the code is concise and easy to understand at a glance.
Run 2
The code is highly readable due to its logical structure and clarity. It represents a simple domain class extending EventTarget with clearly named public fields that follow a consistent, conventional naming style. There is no nesting, and each field is declared on its own line, supporting action granularity and a natural reading flow. The constructor is concise and empty. Minor deductions: a few fields (e.g., prototype) could be commented to clarify their special role, and the empty constructor could be omitted, but overall this is straightforward, maintainable, and easy to understand.
Run 3
The code is a simple class definition with clear structure: package declaration, class declaration, public fields, a constructor, and a static field. There is no unnecessary nesting or complex logic. Each field is declared on its own line, improving readability. Naming is conventional and indicates intent clearly. The code is concise and minimal, with no redundant code. The reading flow is natural, grouping related fields logically. Overall, this is highly readable, minus minor points for lack of comments or modifiers like final, but these do not significantly impact clarity.
Run 1
Code Structure: A simple, logically organized class containing fields and an empty constructor. Nesting: Minimal, with no nested control flow. Clarity of intent: Descriptive names clearly convey DOM relationships, though the purpose of the public static prototype field and empty constructor is not explained. Code length: Concise, with no unnecessary implementation. Action granularity: Each field declaration occupies its own line. Reading flow: Straightforward, although grouping related relationships together and adding spacing around the constructor would improve readability.
Run 2
Code Structure: A straightforward class groups related DOM relationship fields, followed by a static prototype and constructor. Nesting: Only class-level nesting, making the code easy to scan. Clarity of intent: Descriptive names and specific types clearly convey element relationships, though the prototype field and empty constructor lack explanatory context. Code length: Compact, with no unnecessary logic. Action granularity: Each field declaration occupies its own line; the empty constructor is concise but tightly formatted. Reading flow: The package, class, fields, and constructor follow a natural order, although separating the static prototype from instance fields and spacing the constructor would improve readability.
Run 3
Code Structure: A straightforward class groups related SVG instance fields together, followed by the static prototype and constructor. Nesting: Minimal, with no nested logic. Clarity of intent: Descriptive field names and explicit types make the represented relationships clear, although the purpose of the prototype field and empty constructor is undocumented. Code length: Concise, with no unnecessary implementation. Action granularity: Each field declaration occupies its own line. Reading flow: Natural and easy to scan, though grouping parent, child, and sibling references more deliberately and adding conventional constructor spacing would improve readability.