Sample
Schnappinger/jsweet/def.dom.AudioParam
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 62.2Δ 14.9 |
| Scalabrino | 0.872 | 0–1; higher is more readable | 81.2Δ 4.1 |
| Dorn | 0.314 | 0–1; higher is more readable | 48.2Δ 28.9 |
| Mi | 0.174 | 0–1; higher is more readable | 13.9Δ 63.2 |
| LLOC | 10 | Logical lines; fewer is more readable | 72.4Δ 4.6 |
| DeepSeek V4 Pro | 16 | 0–20; mean of three runs | 47.4Δ 29.7 |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs | 73.8Δ 3.3 |
| BTTF | 0.583 | 0–1; higher is more readable | 54.8Δ 22.3 |
| Human | 3.96 | 1–4; original rating | 77.1 |
Views
Loading feature diagnosis…
Source regions
Feature contributions
Feature contributions
| Feature | Value | Contribution (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. | 609.506 | −20.114 |
| 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.585 | −6.877 |
| Source linesThe number of non-empty source lines. | 15 | +6 |
Intercept 8.87 + feature contributions = -12.121 (log-odds).
Score = sigmoid(-12.121) = 0.
| Score | 0.872 |
|---|
Feature contributions
| Feature | Value | Contribution (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. | 99 | −0.528 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 16 | +0.47 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.059 | +0.368 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 14 | −0.253 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 14.84 | −0.202 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 14 | +0.1 |
Intercept 0.07 + feature contributions = -0.78 (log-odds).
Score = sigmoid(-0.78) = 0.314.
| Score | 0.174 |
|---|
| Score | 10 |
|---|
Run 1
The code is fairly readable due to its flat structure, clear naming, and concise method signatures. Each method performs one action (wrapping a native call), which improves clarity. However, the class combines native implementations with a Java-style constructor and static prototype field, which may confuse intent in a TypeScript/JavaScript context. Field ordering places defaults before methods, which is acceptable, but the constructor at the end slightly disrupts flow. Overall, it is straightforward but lacks comments or grouping to clarify API purpose.
Run 2
The code is highly readable. Structure is logical, with clear separation of fields, methods, and constructor. Nesting is flat — all members are at class level. Intent is clear: an AudioParam interface with default and current values, and scheduling methods. The code is concise with no unnecessary verbosity. Each action is on its own line, improving scanability. Reading flow is natural, grouping related methods.
Run 3
The code is a Java class definition for AudioParam that is generally clear and well-structured. It has a logical organization with fields and methods grouped together, flat nesting, and one action per line, contributing to good readability. The use of JSDoc-like 'native' annotations clarifies intent for WebIDL bindings. However, readability is reduced by the unexplained 'def.js' and 'def.dom' packages, the inconsistent placement of the 'prototype' static field within methods, and a redundant empty constructor. The import and package declarations add minimal noise, and some method names are long but descriptive. Overall, it is readable but could be improved with consistent ordering and removal of unnecessary elements.
Run 1
Code Structure: A straightforward class groups fields and native method declarations logically, though placing the static prototype beside other fields would improve organization. Nesting: Essentially flat, with only the class scope and an empty constructor. Clarity of intent: Descriptive method and parameter names clearly convey audio automation operations, although the binding role is not documented. Code length: Concise, with no unnecessary implementation or repetition beyond required API declarations. Action granularity: Each field or method declaration occupies its own line. Reading flow: Natural and easy to scan, but blank lines between package, import, fields, methods, and constructor would improve readability. The unconventional 'native public' modifier order and tightly formatted constructor slightly reduce consistency.
Run 2
Code Structure: A straightforward class groups fields, native method declarations, a prototype, and a constructor logically. Nesting: There is no meaningful nesting beyond the class body. Clarity of intent: Descriptive method and parameter names clearly communicate audio parameter scheduling operations, though the native binding role and prototype field are undocumented. Code length: Concise, with no unnecessary implementation or repetition beyond required declarations. Action granularity: Each field, method, and constructor occupies its own line. Reading flow: Consistent indentation and related methods make scanning easy, but blank lines between the package, import, fields, methods, and constructor would improve visual organization. The compact constructor and unconventional modifier ordering slightly reduce polish.
Run 3
Code Structure: A straightforward class declaration groups fields and native API methods logically, though the static prototype field could be grouped with other fields. Nesting: Minimal nesting makes scanning easy. Clarity of intent: Descriptive method and parameter names clearly communicate audio parameter scheduling operations; native declarations appropriately omit implementations. Code length: Concise, with no unnecessary logic or repetition beyond the API declarations. Action granularity: Each declaration occupies its own line. Reading flow: The package, import, and class follow a natural order, but blank lines between sections and conventional modifier ordering ('public native') would improve readability.