Sample

Schnappinger/jsweet/def.dom.HTMLLegendElement

Human rating uses the original dataset scale.

Human3.93
Lines14

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett0.9670–1; higher is more readable
89.3Δ 29.6
Scalabrino0.8410–1; higher is more readable
72.3Δ 12.5
Dorn0.7880–1; higher is more readable
82.8Δ 23.1
Mi0.8460–1; higher is more readable
98.7Δ 38.9
LLOC4Logical lines; fewer is more readable
87.0Δ 27.2
DeepSeek V4 Pro16.330–20; mean of three runs
53.1Δ 6.6
GPT-6.1 Sol16.330–20; mean of three runs
45.9Δ 13.9
BTTF0.6750–1; higher is more readable
73.9Δ 14.2
Human3.931–4; original rating
59.7

Views

Source code

package def.dom; public class HTMLLegendElement extends HTMLElement { /** * Retrieves a reference to the form that the object is embedded in. */ public String align; /** * Retrieves a reference to the form that the object is embedded in. */ public HTMLFormElement form; public static HTMLLegendElement prototype; public HTMLLegendElement(){} }

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(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.454−6.681
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.133.98−4.421

Intercept 8.87 + feature contributions = 3.368 (log-odds).
Score = sigmoid(3.368) = 0.967.

Score0.841

Feature contributions

FeatureValueContribution
(log-odds)
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.029+0.663
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
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.34.067−0.255
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.13.77−0.217

Intercept 0.07 + feature contributions = 1.311 (log-odds).
Score = sigmoid(1.311) = 0.788.

Score0.846
Score4
Run 1

The code is highly readable. It has a clear, logical structure with straightforward class inheritance. Nesting is minimal and appropriate. Intent is mostly clear, though the duplicated comment on 'align' and 'form' is misleading — the 'align' comment incorrectly describes the 'form' property. Code length is concise and free of unnecessary boilerplate. Action granularity is fine, with one field declaration per line. Reading flow is natural, following a consistent order. Deductions are mainly due to the inaccurate duplicate comment, which introduces ambiguity about the purpose of 'align'.

Run 2

The code is highly readable and follows clear object-oriented structure. It defines a single class with a logical, flat organization. There is minimal nesting (only class-level fields and a constructor), and the intent of each member is reasonably inferable from names like 'align' and 'form'. The code is concise, with one field or method per line, promoting a natural reading flow. The only notable issue is misleading Javadoc: the comment 'Retrieves a reference to the form that the object is embedded in' is duplicated for 'align', which does not match its likely purpose. Additionally, fields are public, which may be a style concern but not a readability flaw in this context. Overall, the structure is clean and easy to scan, but the inaccurate documentation slightly reduces clarity of intent.

Run 3

The code is well-structured with clear class definition and field declarations. Nesting is minimal, and intent is straightforward—though the JSDoc comments are inaccurate for 'align' and 'form'. Code length is appropriate for a simple DOM class. Action granularity is one field per line, aiding readability. Reading flow is natural: package, class, fields, constructor. Minor issues: redundant prototype field and missing type safety for 'align'.

Run 1

Code Structure: A straightforward class with logically grouped fields and a constructor. Nesting: Minimal, making the code easy to scan. Clarity of intent: Class and field names convey their roles, but the comment on align incorrectly describes a form reference, and prototype lacks explanation. Code length: Concise, with no unnecessary implementation, though the duplicated comment adds noise. Action granularity: Each declaration occupies its own line. Reading flow: Generally natural, but missing blank lines between the package, class, and members, plus the tightly formatted empty constructor, reduce visual clarity.

Run 2

Code Structure: The class is logically organized, with fields followed by a constructor. Nesting: Minimal nesting makes it easy to scan. Clarity of intent: Names and inheritance indicate a DOM element representation, but the comment on align incorrectly describes a form reference; prototype and the empty constructor lack context. Code length: Concise, with no unnecessary implementation. Action granularity: Each declaration occupies its own line. Reading flow: Generally natural, though missing blank lines between members and the tightly formatted constructor reduce visual clarity.

Run 3

Code Structure: The class is logically organized, with fields followed by a constructor. Nesting: It is flat, with no nested control flow. Clarity of intent: The class and field names convey a DOM element model, but the duplicated documentation incorrectly describes align as a form reference, reducing clarity. Code length: The implementation is concise without unnecessary logic. Action granularity: Each declaration occupies its own line. Reading flow: The order is natural, although missing spacing around the empty constructor and the lack of separation between the package declaration and class slightly reduce readability.