Sample

Schnappinger/jsweet/def.dom.PointerEvent

Human rating uses the original dataset scale.

Human3.95
Lines23

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
51.8Δ 17.6
Scalabrino0.6630–1; higher is more readable
30.1Δ 39.3
Dorn00–1; higher is more readable
1.3Δ 68.2
Mi00–1; higher is more readable
0.0Δ 69.5
LLOC19Logical lines; fewer is more readable
61.6Δ 7.9
DeepSeek V4 Pro12.330–20; mean of three runs
17.2Δ 52.3
GPT-6.1 Sol150–20; mean of three runs
25.7Δ 43.7
BTTF0.140–1; higher is more readable
5.3Δ 64.2
Human3.951–4; original rating
69.5

Views

Source code

package def.dom; public class PointerEvent extends MouseEvent { public Object currentPoint; public double height; public double hwTimestamp; public Object intermediatePoints; public Boolean isPrimary; public double pointerId; public Object pointerType; public double pressure; public double rotation; public double tiltX; public double tiltY; public double width; native public void getCurrentPoint(Element element); native public void getIntermediatePoints(Element element); native public void initPointerEvent(String typeArg, Boolean canBubbleArg, Boolean cancelableArg, Window viewArg, double detailArg, double screenXArg, double screenYArg, double clientXArg, double clientYArg, Boolean ctrlKeyArg, Boolean altKeyArg, Boolean shiftKeyArg, Boolean metaKeyArg, double buttonArg, EventTarget relatedTargetArg, double offsetXArg, double offsetYArg, double widthArg, double heightArg, double pressure, double rotation, double tiltX, double tiltY, double pointerIdArg, Object pointerType, double hwTimestampArg, Boolean isPrimary); public static PointerEvent prototype; public PointerEvent(String typeArg, PointerEventInit eventInitDict){} public PointerEvent(String typeArg){} protected PointerEvent(){} }

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(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.1178.657−38.896
Source linesThe number of non-empty source lines.23+9.2
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.623−6.935

Intercept 8.87 + feature contributions = -27.761 (log-odds).
Score = sigmoid(-27.761) = 0.

Score0.663

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.556.958−19.926
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
Indentation frequencyHow rapidly indentation changes from line to line.1−0.703
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.052+0.44
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.24+0.187
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.22.839−0.091

Intercept 0.07 + feature contributions = -20.429 (log-odds).
Score = sigmoid(-20.429) = 0.

Score0
Score19
Run 1

This is a straightforward domain class definition, but readability suffers from several issues. The structure is flat and logical for a typed API wrapper, and fields are clearly named. However, the initPointerEvent method signature is extremely long, making it hard to scan and understand. Several fields like currentPoint and intermediatePoints are typed as Object, reducing clarity of intent. The class contains multiple constructors with empty bodies, which adds verbosity without explanatory comments. Native methods lack documentation, making their purpose ambiguous. The overall layout is consistent, but the lack of whitespace or grouping between related fields and methods hampers natural reading flow. Action granularity is generally acceptable, though the single multi-parameter method violates the principle of one action per line.

Run 2

The code is a straightforward Java class declaration with clear field names and method signatures. The structure is flat, with all fields at the top followed by methods, which is logical. Nesting is minimal (only class-level). The intent is clear: define a POJO-like DOM event class. However, readability suffers from long parameter lists in methods like `initPointerEvent`, which reduce clarity. The code is concise, with one field or method per line, aiding scanning. Reading flow is natural from top to bottom, but the use of `Object` and `Boolean` types instead of more specific types introduces ambiguity. Overall, it is easy to understand but could be improved with better type definitions and breaking up the long method signature.

Run 3

The code is a straightforward data class, but its readability is hampered by several factors. The structure is flat and simple, which is good, but it's essentially a wall of declarations with little logical grouping. Intent is mostly clear—it's an event class—but the sheer number of fields and long method signatures obscure it. Code length is excessive due to the verbose initPointerEvent with 20+ parameters; this is unnecessarily long and hard to scan. Action granularity is fine as each field/method is on its own line. Reading flow is poor because related fields (e.g., width/height, tiltX/tiltY) are scattered and method signatures are unwieldy. The native methods with vague names like getCurrentPoint and intermediatePoints add ambiguity. Naming is consistent, but the use of Object for pointerType and currentPoint weakens type clarity. Overall, the code is readable at a glance but painful to actually use or review due to poor grouping and monolithic method signatures.

Run 1

Code Structure: The class is logically organized into fields, native methods, and constructors, though the static prototype field interrupts that grouping. Nesting: There is no meaningful nesting, making the declaration easy to scan. Clarity of intent: The class name, inheritance, and most member names clearly describe a pointer-event API; Object-typed fields and undocumented native methods reduce precision. Code length: The class is concise, but initPointerEvent has an exceptionally long parameter list on one line. Action granularity: Each declaration occupies its own line, with no bundled operations. Reading flow: The order is mostly natural, but missing whitespace between sections, tightly formatted empty constructors, unconventional modifier ordering, and the oversized method signature make reading less comfortable.

Run 2

Code Structure: The class is logically organized into fields, native methods, a prototype field, and constructors, though spacing would better distinguish these sections. Nesting: There is no deep nesting; the declarations are flat and easy to scan. Clarity of intent: The class name, inheritance, and most member names clearly identify a pointer-event API, but Object types and undocumented native methods leave some details ambiguous. Code length: The class is concise, but initPointerEvent has an excessively long, unwrapped parameter list that is difficult to read. Action granularity: Each field, method, and constructor occupies its own line, with no bundled actions. Reading flow: The overall order is natural, but the dense formatting, empty constructor bodies without spacing, and inconsistent parameter naming interrupt readability.

Run 3

Code Structure: The class is logically organized into fields, native methods, and constructors, though the static prototype field interrupts that grouping. Nesting: There is no meaningful nesting beyond the class, making it easy to scan. Clarity of intent: The class name, inheritance, and most member names clearly indicate a pointer-event API; Object types and undocumented native methods leave some details ambiguous. Code length: The declaration is concise, but initPointerEvent has an excessively long, unwrapped parameter list. Action granularity: Each field, method, and constructor occupies its own line, with no combined actions. Reading flow: The overall order is understandable, but missing blank lines, tightly formatted empty constructors, and the lengthy method signature reduce readability.