Sample

Schnappinger/jsweet/def.dom.HTMLAllCollection

Human rating uses the original dataset scale.

Human3.95
Lines8

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett0.4130–1; higher is more readable
77.3Δ 7.8
Scalabrino0.810–1; higher is more readable
64.4Δ 5.1
Dorn0.740–1; higher is more readable
78.2Δ 8.7
Mi0.4830–1; higher is more readable
31.7Δ 37.8
LLOC3Logical lines; fewer is more readable
91.1Δ 21.6
DeepSeek V4 Pro16.330–20; mean of three runs
53.1Δ 16.3
GPT-6.1 Sol180–20; mean of three runs
73.8Δ 4.3
BTTF0.6610–1; higher is more readable
70.0Δ 0.5
Human3.951–4; original rating
69.5

Views

Source code

package def.dom; public class HTMLAllCollection extends HTMLCollection { native public Element namedItem(java.lang.String name); public static HTMLAllCollection prototype; public HTMLAllCollection(){} }

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.698−7.046
Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones.162.848−5.374
Source linesThe number of non-empty source lines.8+3.2

Intercept 8.87 + feature contributions = -0.35 (log-odds).
Score = sigmoid(-0.35) = 0.413.

Score0.81

Feature contributions

FeatureValueContribution
(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.58.889+1.171
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.9+0.718
Indentation frequencyHow rapidly indentation changes from line to line.7−0.495
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.7.85−0.3
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.067+0.291

Intercept 0.07 + feature contributions = 1.048 (log-odds).
Score = sigmoid(1.048) = 0.74.

Score0.483
Score3
Run 1

The code is concise and clearly structured. It defines a single class with a purposeful hierarchy (extends HTMLCollection), one native method declaration, a public static prototype field, and an empty constructor. Intent is straightforward. Nesting and length are minimal, and granularity is appropriate. Minor clarity gaps include the unexplained 'native' method and empty constructor, but overall it is highly readable.

Run 2

This code is highly readable. It is a short, well-structured Java class extending HTMLCollection. The package and imports are implied to be handled elsewhere, keeping this snippet minimal. Nesting is effectively flat—only a single class with two members. The intent is clear: it defines an HTMLAllCollection type with a namedItem method and a static prototype field. Code length is minimal and appropriate for the functionality, with no unnecessary code. Each line represents a single action or declaration, aligning with one-action-per-line granularity. Reading flow follows a logical order: package declaration, class signature, method, static field, and constructor. The native method declaration is concise, and the public modifiers are explicit. Overall, the code is simple, unambiguous, and follows common conventions.

Run 3

The code is simple and concise, representing a DOM type definition. Structure is logical: class declaration, method, field, and constructor are clearly separated. Nesting is flat with no conditional or loop complexity. Intent is mostly clear—it defines an HTMLAllCollection extending HTMLCollection with a namedItem method and a prototype field. Action granularity is good, with one declaration per line. However, readability is reduced by the lack of comments explaining the unusual 'native' modifier, the empty constructor, and why 'prototype' is a static field. The method signature lacks JavaBeans-style naming clarity, and the empty constructor feels unnecessary. Overall, it is readable for someone familiar with browser API bindings, but slightly less so for general Java developers.

Run 1

Code Structure: A simple, logically organized class with a method, static field, and constructor. Nesting: Minimal nesting makes it easy to scan. Clarity of intent: The class and method names communicate their DOM-related purpose, though the native method and prototype field depend on external context. Code length: Concise, with no unnecessary implementation. Action granularity: Each declaration occupies its own line. Reading flow: Straightforward, but placing fields before methods, using conventional 'public native' modifier order, and adding whitespace around the empty constructor body would improve consistency.

Run 2

Code Structure: A simple, logically organized class with a method, static field, and constructor, although conventional field-first ordering would improve consistency. Nesting: Minimal, with only class and constructor scopes. Clarity of intent: The class name, inheritance, and namedItem signature communicate its DOM role; the native implementation and prototype field require some domain knowledge. Code length: Concise, with no unnecessary logic. Action granularity: Each declaration occupies its own line. Reading flow: Easy to scan, though conventional modifier ordering (public native), importing String implicitly rather than fully qualifying it, and spacing the empty constructor would make the style more natural.

Run 3

Code Structure: A straightforward class with a method, static field, and constructor, though conventional member ordering would improve organization. Nesting: Minimal, with no nested control flow. Clarity of intent: Class inheritance and namedItem are understandable, but the native method and public prototype field lack explanatory context. Code length: Concise, with no unnecessary logic. Action granularity: Each declaration occupies its own line. Reading flow: Easy to scan, though 'public native' would be more conventional than 'native public', and spacing in the empty constructor plus blank lines between members would improve presentation.