Sample

Schnappinger/jsweet/def.dom.NavigatorOnLine

Human rating uses the original dataset scale.

Human3.91
Lines9

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett0.5330–1; higher is more readable
79.9Δ 23.2
Dorn0.6670–1; higher is more readable
71.9Δ 15.2
Mi0.6560–1; higher is more readable
74.9Δ 18.2
LLOC1Logical lines; fewer is more readable
98.3Δ 41.6
DeepSeek V4 Pro18.330–20; mean of three runs
96.0Δ 39.3
GPT-6.1 Sol190–20; mean of three runs
92.6Δ 35.8
BTTF0.750–1; higher is more readable
90.8Δ 34.0
Human3.911–4; original rating
56.8

Views

Source code

package def.dom; import def.js.Object; @jsweet.lang.Interface public abstract class NavigatorOnLine extends def.js.Object { public java.lang.Boolean onLine; }

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.649−6.973
Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones.162.516−5.363
Source linesThe number of non-empty source lines.9+3.6

Intercept 8.87 + feature contributions = 0.134 (log-odds).
Score = sigmoid(0.134) = 0.533.

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.61+1.082
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.10+0.682
Indentation frequencyHow rapidly indentation changes from line to line.8−0.46
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.8.742−0.288
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.096+0.014

Intercept 0.07 + feature contributions = 0.693 (log-odds).
Score = sigmoid(0.693) = 0.667.

Score0.656
Score1
Run 1

The code is highly readable. It is concise, has a clear structure with a single class definition, and uses appropriate annotations. The purpose is evident: defining an interface with an `onLine` property. Nesting is minimal and the reading flow is natural. The only minor issue is the fully qualified name for Boolean, which is slightly verbose but acceptable in Java/JSweet interop.

Run 2

The code is highly readable due to its minimalism and clarity. It has a flat structure with no nesting, clearly declares an abstract class extending a base Object, and defines a single public field with an obvious purpose. The package and imports are logically organized. Each declaration is on its own line, maintaining one action per line, and the reading flow follows a natural top-to-bottom order. The use of a concise @Interface annotation and simple naming conventions enhances clarity. There is no unnecessary code or ambiguity.

Run 3

The code is highly readable due to its short length and clear structure. It is a straightforward interface definition with a single property, avoiding nesting and keeping actions to one per line. The package and import statements are standard and clearly placed. The use of the @Interface annotation indicates intent. The only minor drawbacks are the fully qualified type name `java.lang.Boolean` which could be simplified for brevity, and the lack of a Javadoc comment explaining the interface's purpose. Overall, the code is easy to understand at a glance.

Run 1

Code Structure: The package, import, annotation, class, and field follow a logical organization, though the unused Object import adds minor clutter. Nesting: Only a single class scope, with no deep nesting. Clarity of intent: NavigatorOnLine and its Boolean onLine field clearly describe an online-status interface binding; the annotation helps explain the abstract class representation. Code length: Very concise, with no unnecessary logic. Action granularity: Each declaration occupies its own line. Reading flow: Natural top-to-bottom flow and consistent formatting make the code easy to scan.

Run 2

Code Structure: The package, import, annotation, and class are logically organized. Nesting: Only a class body is present, with no nested control flow. Clarity of intent: NavigatorOnLine and onLine clearly represent browser connectivity status, though the annotation's binding role requires familiarity with JSweet. Code length: Very concise; the unused Object import is unnecessary because the superclass is fully qualified. Action granularity: Each declaration occupies its own line. Reading flow: Natural top-to-bottom order with appropriate spacing; fully qualified types introduce minor visual noise.

Run 3

Code Structure: The package, import, annotation, class, and field are logically organized. Nesting: Only a single class level, with no complex nesting. Clarity of intent: NavigatorOnLine and onLine clearly represent browser connectivity status, though the interface annotation on an abstract class may require familiarity with JSweet. Code length: Very concise; the unused Object import is unnecessary. Action granularity: Each declaration occupies its own line. Reading flow: Natural top-to-bottom ordering makes the code easy to scan.