Sample

Schnappinger/jsweet/def.dom.MimeTypeArray

Human rating uses the original dataset scale.

Human3.9
Lines17

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett0.0010–1; higher is more readable
67.9Δ 16.6
Scalabrino0.8880–1; higher is more readable
85.3Δ 34.0
Dorn0.6470–1; higher is more readable
71.0Δ 19.6
Mi0.4520–1; higher is more readable
28.1Δ 23.3
LLOC7Logical lines; fewer is more readable
75.9Δ 24.6
DeepSeek V4 Pro14.670–20; mean of three runs
34.8Δ 16.5
GPT-6.1 Sol170–20; mean of three runs
55.3Δ 4.0
BTTF0.5870–1; higher is more readable
55.8Δ 4.5
Human3.91–4; original rating
51.3

Views

Source code

package def.dom; import def.js.Iterable; @jsweet.lang.SyntacticIterable public class MimeTypeArray extends Iterable<Plugin> { public double length; native public Plugin item(double index); native public Plugin namedItem(java.lang.String type); native public Plugin $get(double index); public static MimeTypeArray prototype; public MimeTypeArray(){} /** From Iterable, to allow foreach loop (do not use directly). */ @jsweet.lang.Erased native public java.util.Iterator<Plugin> iterator(); }

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.482.809−15.933
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.763−7.145
Source linesThe number of non-empty source lines.17+6.8

Intercept 8.87 + feature contributions = -7.407 (log-odds).
Score = sigmoid(-7.407) = 0.001.

Score0.888

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
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.70+0.7
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.18+0.399
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.076+0.203
Indentation frequencyHow rapidly indentation changes from line to line.16−0.184
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.16.775−0.175

Intercept 0.07 + feature contributions = 0.607 (log-odds).
Score = sigmoid(0.607) = 0.647.

Score0.452
Score7
Run 1

The code is highly readable. It has a clear structure as a simple domain class representing a MimeTypeArray, with logical grouping of related methods. Nesting is flat and minimal. The intent of each member is clear, especially with the comment explaining the iterator method. The code is concise, with no unnecessary boilerplate. Action granularity is mostly one action per line, though the class declaration line combines the annotation and inheritance, which slightly affects granularity. Reading flow is natural: fields, methods, and a constructor are presented in a conventional order. Minor deductions stem from the terse use of native declarations and the slightly dense method signatures, which assume familiarity with JSweet and Java-to-JS interop patterns.

Run 2

The code is generally readable but has some clarity issues. The class structure is logical and flat, with no nesting problems. However, the intent of the class is unclear without external context - it appears to be a Java-to-JavaScript bridge (via jsweet) but this isn't obvious from the code alone. The method names like '$get' and 'namedItem' follow DOM API conventions but lack explanatory comments. The length field being public double is unusual for what appears to be an array-like object. The iterator method has a helpful comment explaining it shouldn't be used directly, but the '@Erased' annotation isn't explained. The anonymous constructor is unnecessary. Overall, the code is concise and actions are well-separated per line, but the purpose and usage context could be clearer.

Run 3

The code structure is straightforward, with a clear class definition and logical organization of methods and fields. Nesting is minimal, with only one class and no deep control flow. The intent is mostly clear—this appears to be a typed wrapper for a browser MIME type array—but the use of annotations and native methods may obscure purpose for readers unfamiliar with JSweet or similar tools. Code length is appropriate and concise. Action granularity is good, with one declaration per line. Reading flow is natural: fields, constructors, then methods. However, some elements reduce readability: the generic `Iterable<Plugin>` seems mismatched with the class name, and annotations like `@jsweet.lang.SyntacticIterable` or `@Erased` require external knowledge. The `$get` method name is not self-explanatory without context. Overall, it is readable for domain experts but less approachable for general readers.

Run 1

Code Structure: A small, logically organized class, though grouping fields before methods would improve consistency. Nesting: Flat declarations with no nested logic. Clarity of intent: Names and annotations communicate a DOM interoperability wrapper, and the iterator comment clarifies special usage. However, MimeTypeArray exposing Plugin elements is potentially confusing, and $get relies on framework knowledge. Code length: Concise, with no unnecessary implementation. Action granularity: Each declaration occupies its own line. Reading flow: Generally natural, but the prototype field interrupts the method sequence, and minimal spacing makes the declarations slightly cramped.

Run 2

Code Structure: A small, logically organized class groups fields and native method declarations clearly. Nesting: There is no meaningful nesting, making the code easy to scan. Clarity of intent: Familiar names such as length, item, and namedItem communicate array-like access, and the iterator comment explains its special role. However, MimeTypeArray returning and iterating over Plugin objects is potentially confusing, and $get is framework-specific. Code length: The code is concise with no unnecessary implementation. Action granularity: Each field or method declaration occupies its own line. Reading flow: The sequence is straightforward, though placing the prototype field alongside length and adding spacing between declaration groups would improve readability. Fully qualified types and the compact empty constructor add minor visual friction.

Run 3

Code Structure: A small, logically organized class with fields, access methods, a constructor, and an iterator declaration. Nesting: Minimal, with no nested control flow. Clarity of intent: Method names and annotations communicate a native collection binding, and the iterator comment clarifies its purpose; however, Plugin elements in a MimeTypeArray are potentially confusing, and $get is less intuitive. Code length: Concise, with no unnecessary implementation detail. Action granularity: Each declaration occupies its own line, making individual members easy to identify. Reading flow: Generally natural, though grouping fields together, adding spacing between member categories, and using conventional modifier ordering would improve scanning.