Sample

Schnappinger/jsweet/def.dom.WindowSessionStorage

Human rating uses the original dataset scale.

Human3.96
Lines6

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett0.6850–1; higher is more readable
82.6Δ 5.5
Dorn0.6620–1; higher is more readable
71.3Δ 5.8
Mi0.6370–1; higher is more readable
70.6Δ 6.4
LLOC1Logical lines; fewer is more readable
98.3Δ 21.3
DeepSeek V4 Pro15.670–20; mean of three runs
43.9Δ 33.2
GPT-6.1 Sol190–20; mean of three runs
92.6Δ 15.5
BTTF0.7050–1; higher is more readable
82.5Δ 5.4
Human3.961–4; original rating
77.1

Views

Source code

package def.dom; @jsweet.lang.Interface public abstract class WindowSessionStorage extends def.js.Object { public Storage sessionStorage; }

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.565−6.848
Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones.110.446−3.645
Source linesThe number of non-empty source lines.6+2.4

Intercept 8.87 + feature contributions = 0.778 (log-odds).
Score = sigmoid(0.778) = 0.685.

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.66+0.87
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.7+0.788
Indentation frequencyHow rapidly indentation changes from line to line.5−0.564
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.5.761−0.329
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.072+0.243

Intercept 0.07 + feature contributions = 0.671 (log-odds).
Score = sigmoid(0.671) = 0.662.

Score0.637
Score1
Run 1

The code is highly readable. It clearly defines an interface (WindowSessionStorage) extending a base Object. The class structure is straightforward and logical. Nesting is nonexistent; the flat structure keeps it simple. The intent is clear: to declare a session storage property for a DOM Window interface. The code length is minimal and appropriate. Action granularity is trivial with a single property declaration. The reading flow is natural, following standard TypeScript/Java declaration order. Slight deduction only because the `@jsweet.lang.Interface` annotation is a bit domain-specific and the package name `def.dom` is generic, but overall it is very clean.

Run 2

The code is a simple Java interface declaration with a single field, but it has some readability issues. The structure is logical but minimal: it declares a package, an annotation, an abstract class extending another class, and one public field. Nesting is flat, which is good. Clarity of intent is moderately clear — the class name indicates it represents window session storage, but the presence of both an abstract class and an interface-like annotation could confuse readers unfamiliar with the jsweet transpiler context. Code length is concise and appropriate for its purpose. Action granularity is fine, with one meaningful declaration per line. Reading flow is natural and straightforward. The main deductions come from the lack of documentation or comments explaining the unusual combination of @Interface annotation with an abstract class and the missing access modifier on the package, which slightly reduces clarity for readers not versed in jsweet conventions.

Run 3

The code is a small, clean Java interface definition with a single field, making it inherently readable. It follows standard package and import conventions, uses a clear annotation (@jsweet.lang.Interface), and has a straightforward class name (WindowSessionStorage) that reflects its purpose. The single field (sessionStorage) is typed explicitly, and the class extends a base Object, which is typical for such definitions. Nesting is non-existent, and each element is on its own line, aiding readability. However, the abstract class with no methods and a public field might be slightly ambiguous to readers unfamiliar with JSweet or DOM type definitions, and the lack of comments or documentation slightly reduces clarity of intent. Overall, it is concise and logically organized, though not very informative without context.

Run 1

Code Structure: Logically organized as a package declaration, annotation, class, and field. Nesting: Minimal, with only one class scope. Clarity of intent: The class and field names clearly indicate a window session-storage interface; understanding the annotation requires familiarity with JSweet. Code length: Concise, with no unnecessary implementation. Action granularity: Each declaration occupies its own line. Reading flow: Natural and easy to follow, though a blank line after the package declaration would slightly improve visual separation.

Run 2

Code Structure: A clearly organized package, annotated class, and single field. Nesting: Minimal, with only the class body. Clarity of intent: WindowSessionStorage and sessionStorage clearly identify the exposed browser storage property, though the abstract-class/interface annotation combination requires JSweet knowledge. Code length: Concise with no unnecessary implementation. Action granularity: Each declaration occupies its own line. Reading flow: Natural top-to-bottom progression from package to annotation, class, and field; a blank line after the package declaration would slightly improve separation.

Run 3

Code Structure: A straightforward class declaration with one field, logically organized. Nesting: No nested control flow or complex blocks. Clarity of intent: WindowSessionStorage and sessionStorage clearly communicate the purpose; the annotation identifies its interface role. Code length: Minimal, with no unnecessary implementation. Action granularity: Each declaration occupies its own line. Reading flow: Natural progression from package to annotation, class, and field. A blank line after the package declaration would slightly improve visual separation.