Sample
Schnappinger/jsweet/def.dom.HTMLBaseElement
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0.967 | 0–1; higher is more readable | 89.6Δ 38.3 |
| Scalabrino | 0.864 | 0–1; higher is more readable | 79.5Δ 28.1 |
| Dorn | 0.812 | 0–1; higher is more readable | 86.1Δ 34.8 |
| Mi | 0.828 | 0–1; higher is more readable | 98.0Δ 46.7 |
| LLOC | 4 | Logical lines; fewer is more readable | 87.0Δ 35.6 |
| DeepSeek V4 Pro | 18 | 0–20; mean of three runs | 91.4Δ 40.1 |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs | 73.8Δ 22.4 |
| BTTF | 0.72 | 0–1; higher is more readable | 86.5Δ 35.1 |
| Human | 3.9 | 1–4; original rating | 51.3 |
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.497 | −6.746 |
| Source linesThe number of non-empty source lines. | 14 | +5.6 |
| Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones. | 131.686 | −4.346 |
Intercept 8.87 + feature contributions = 3.378 (log-odds).
Score = sigmoid(3.378) = 0.967.
| Score | 0.864 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.03 | +0.651 |
| 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. | 73 | +0.573 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 15 | +0.505 |
| 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 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 13.757 | −0.218 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 44.267 | −0.09 |
Intercept 0.07 + feature contributions = 1.464 (log-odds).
Score = sigmoid(1.464) = 0.812.
| Score | 0.828 |
|---|
| Score | 4 |
|---|
Run 1
The code is highly readable due to its logical structure and clarity. It follows standard class organization with fields grouped together, each preceded by a clear Javadoc comment explaining its purpose. Nesting is minimal—only a single class level—and the reading flow is natural: package declaration, class declaration, fields, constructor. Each field occupies one line, promoting clear action granularity. The code is concise, containing no unnecessary methods or logic. The only minor deductions are the empty constructor, which adds slight boilerplate, and the public fields without accessors, which may be intentional for a DOM binding but could reduce encapsulation clarity. Overall, the code’s intent is unambiguous and easy to follow.
Run 2
The code is highly readable. It follows a clear, flat structure with logical organization: package declaration, class definition, two documented fields, a static prototype field, and a constructor. Nesting is minimal, with only the class-level scope. Each field has a clear, concise JSDoc-style comment explaining its intent, making the purpose unambiguous. The code is concise—no unnecessary methods or boilerplate beyond the empty constructor. Action granularity is appropriate, with one declaration per line. Reading flow is natural, moving from general context (package, class) to specific members. Minor deductions: the empty constructor is somewhat redundant and could be omitted, and the static prototype field lacks a comment.
Run 3
The code is highly readable. It has a clear, logical structure with a single class definition and no nesting. The intent is explicit through meaningful field names (href, target, prototype) and Javadoc comments explaining each member. The code is concise, with each field on its own line, maintaining one action per line. The reading flow is natural: package, import-free class declaration, fields with documentation, then a simple constructor. Minor deductions are for the empty constructor (could be omitted) and the use of a single-line brace style for the constructor, which slightly reduces consistency.
Run 1
Code Structure: Logically organized as a small class with documented fields, a prototype reference, and a constructor. Nesting: Minimal, with no nested control flow. Clarity of intent: The class name, inheritance, field names, and comments clearly convey its DOM role; the prototype field and empty constructor lack explanation. Code length: Concise, with no unnecessary implementation. Action granularity: Each declaration occupies its own line, although the empty constructor is tightly formatted. Reading flow: Natural and easy to follow, but blank lines between declarations and conventional constructor spacing would improve visual separation.
Run 2
Code Structure: The class is logically organized, with related fields followed by the constructor. Nesting: Only the class body is nested, making the code easy to scan. Clarity of intent: The class and field names convey their HTML DOM roles, and comments explain href and target; prototype and the empty constructor lack explanation. Code length: The code is concise without unnecessary implementation. Action granularity: Each declaration occupies its own line, with no combined actions. Reading flow: The sequence is natural, though blank lines between members and conventional constructor spacing would improve visual readability.
Run 3
Code Structure: Logically organized as a small class with related fields and a constructor. Nesting: Minimal, with no nested control flow. Clarity of intent: Descriptive class and field names, supported by documentation for href and target; prototype is undocumented. Code length: Concise, with no unnecessary logic. Action granularity: Each declaration occupies its own line. Reading flow: Natural progression from package to class, fields, and constructor, though blank lines between declarations and conventional spacing in the empty constructor would improve readability.