Sample

Schnappinger/jsweet/def.dom.SVGStringList

Human rating uses the original dataset scale.

Human3.95
Lines14

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
65.6Δ 2.5
Scalabrino0.8970–1; higher is more readable
88.7Δ 25.7
Dorn0.6440–1; higher is more readable
70.3Δ 7.3
Mi0.2630–1; higher is more readable
17.5Δ 45.5
LLOC10Logical lines; fewer is more readable
72.4Δ 9.4
DeepSeek V4 Pro17.670–20; mean of three runs
83.0Δ 20.0
GPT-6.1 Sol180–20; mean of three runs
73.8Δ 10.7
BTTF0.6090–1; higher is more readable
59.1Δ 4.0
Human3.951–4; original rating
63.0

Views

Source code

package def.dom; public class SVGStringList extends def.js.Object { public double numberOfItems; native public String appendItem(String newItem); native public void clear(); native public String getItem(double index); native public String initialize(String newItem); native public String insertItemBefore(String newItem, double index); native public String removeItem(double index); native public String replaceItem(String newItem, double index); public static SVGStringList prototype; public SVGStringList(){} }

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.490−16.17
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.578−6.867
Source linesThe number of non-empty source lines.14+5.6

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

Score0.897

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.72+0.616
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.15+0.505
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.065+0.312
Indentation frequencyHow rapidly indentation changes from line to line.13−0.287
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.13.877−0.216

Intercept 0.07 + feature contributions = 0.593 (log-odds).
Score = sigmoid(0.593) = 0.644.

Score0.263
Score10
Run 1

The code is highly readable due to its clear, flat structure and consistent organization. It defines an SVGStringList class with a logical grouping of fields, native methods, and a constructor. There is minimal nesting, and each method is declared on its own line, following a natural reading flow. Intent is evident: the class models a string list with standard CRUD-like operations. While the methods lack comments or implementation details (as they are native), the naming is descriptive and unambiguous. The code is concise and avoids unnecessary complexity, adhering to one action per line. Overall, this is well-structured, easy-to-scan code suitable for a type definition or API declaration context.

Run 2

The code is highly readable. It follows a clear and consistent structure: package declaration, class declaration, fields, and methods, all logically organized. Nesting is minimal—only the class-level indentation. Each method is a single line with a clear name indicating its purpose (appendItem, clear, getItem, etc.), and the action granularity is appropriate. The reading flow is natural and predictable. The use of native methods suggests a language binding, and the intent is clear. While the code is concise, the lack of documentation or parameter descriptions slightly reduces clarity. Overall, it is a clean, straightforward class definition.

Run 3

The code is highly readable due to its simple, flat structure and clear purpose as a DOM interface definition. Each method is declared on a single line, maintaining a natural reading flow and one-action-per-line granularity. The class has a logical organization, grouping related string-list manipulation methods together. There is no unnecessary nesting or overly long code. Minor deductions include a lack of documentation or comments that could clarify the intended behavior of methods like 'initialize' or 'replaceItem', and the presence of a native JavaScript artifact ('prototype') without explanation. Overall, the code is concise and unambiguous for a developer familiar with TypeScript-like definitions or JavaScript interop patterns.

Run 1

Code Structure: A straightforward class groups a field, related native methods, a prototype field, and a constructor, though separating static and instance members would improve organization. Nesting: Only the class body is nested; there is no complex control flow. Clarity of intent: The class and method names clearly describe SVG string-list operations, although the native binding context and use of double for indices are not explained. Code length: Concise, with no unnecessary implementation or repetition. Action granularity: Each declaration occupies its own line. Reading flow: The API is easy to scan, but blank lines between member groups and conventional modifier ordering would improve readability.

Run 2

Code Structure: A straightforward class groups a field, related native methods, a prototype field, and a constructor logically. Nesting: Only the class scope is present, making scanning easy. Clarity of intent: The class and method names clearly describe an SVG string-list API, though the native binding context and double-valued indices may be unfamiliar. Code length: Compact, with no unnecessary implementation or boilerplate. Action granularity: Each declaration occupies its own line. Reading flow: Consistent method signatures support natural reading, but blank lines separating instance members, static members, and the constructor would improve organization. The tightly formatted empty constructor slightly reduces visual clarity.

Run 3

Code Structure: A straightforward class groups its field, native methods, prototype, and constructor logically. Nesting: Only class-level nesting, making it easy to scan. Clarity of intent: Descriptive class, method, and parameter names clearly convey string-list operations, though the native binding role and prototype field are undocumented. Code length: Concise, with no unnecessary implementation or repetition. Action granularity: Each declaration occupies its own line. Reading flow: Consistent indentation and method formatting support natural reading; blank lines between member groups and spacing in the empty constructor would improve visual separation.