Sample
Schnappinger/jsweet/def.dom.SVGFEColorMatrixElement
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 60.9Δ 8.6 |
| Scalabrino | 0.674 | 0–1; higher is more readable | 32.5Δ 36.9 |
| Dorn | 0.243 | 0–1; higher is more readable | 43.9Δ 25.6 |
| Mi | 0.042 | 0–1; higher is more readable | 5.6Δ 63.9 |
| LLOC | 19 | Logical lines; fewer is more readable | 61.6Δ 7.9 |
| DeepSeek V4 Pro | 10 | 0–20; mean of three runs | 9.6Δ 59.9 |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs | 38.9Δ 30.5 |
| BTTF | 0.63 | 0–1; higher is more readable | 63.0Δ 6.4 |
| Human | 3.95 | 1–4; original rating | 69.5 |
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. | 787.48 | −25.987 |
| Source linesThe number of non-empty source lines. | 24 | +9.6 |
| Byte entropyHow varied the bytes in the source text are. Repeated bytes give a lower value; a more even mixture gives a higher value. | 5.069 | −7.604 |
Intercept 8.87 + feature contributions = -15.121 (log-odds).
Score = sigmoid(-15.121) = 0.
| Score | 0.674 |
|---|
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 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 1 | −0.703 |
| 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. | 103 | −0.697 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.043 | +0.528 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 25 | +0.151 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 23.837 | −0.077 |
Intercept 0.07 + feature contributions = -1.134 (log-odds).
Score = sigmoid(-1.134) = 0.243.
| Score | 0.042 |
|---|
| Score | 19 |
|---|
Run 1
This code snippet has significant readability issues. The class lacks any organizing comments or logical grouping, mixing core SVG filter primitives with unrelated event listener overloads. Public fields are scattered in a non-intuitive order: constructor and prototype appear midway, while related fields like x, y, width, and height are placed after them. The naming of 'in1' is unclear. Multiple addEventListener overloads are redundant and create unnecessary length; default parameters or a single flexible method would be cleaner. The code uses magic numbers (e.g., double constants) without context. The flat structure actually reduces readability here because related members are not grouped, and the abrupt insertion of the prototype and constructor disrupts the natural reading flow. While each line is simple, the overall organization makes it difficult to understand the class's purpose or API at a glance.
Run 2
The code is moderately readable, typical of auto-generated or library binding code. Structure is linear and predictable, with fields grouped logically (SVG-specific attributes, constants, event methods). Nesting is flat, which is good. Intent is mostly clear — defining an SVG filter element interface — though the presence of both SVGFilterPrimitiveStandardAttributes via the @Extends annotation and duplicate field declarations (height, width, x, y, result) creates ambiguity about the class's actual inheritance and structure. Code length is acceptable for a bindings file, but multiple addEventListener overloads are repetitive and could be condensed. Action granularity is one declaration per line, aiding scanning. Reading flow is natural: fields, constants, methods, though public fields break encapsulation conventions. Overall, it is understandable but not exemplary due to redundancy and lack of encapsulation.
Run 3
The code follows a predictable class structure with fields grouped by type, which aids scanning. However, the organization of fields is inconsistent: numeric constants, method declarations, and nested element references are interleaved without clear grouping. Nesting is flat and readable. Intent is somewhat ambiguous due to the use of raw doubles for constants and lack of comments explaining the SVG filter semantics. Code length is acceptable but includes redundant overloaded methods. Each line generally contains one action, but the mixing of primitive and object constants reduces clarity. Reading flow is disrupted by the placement of methods between fields. Overall, it is functional but not optimized for readability.
Run 1
Code Structure: The class is straightforward, but fields, the constructor, and event-listener overloads are interleaved rather than grouped logically. Nesting: There is no nested logic, making the code easy to scan. Clarity of intent: SVG-specific types and descriptive constant names communicate the binding's purpose, though names such as in1 rely on domain knowledge. Code length: The declaration is concise, with little unnecessary content. Action granularity: Each declaration occupies its own line, clearly separating members. Reading flow: Consistent indentation helps, but the lack of blank lines and separation of related overloads disrupt the flow. Grouping fields, the constructor, and methods would improve readability.
Run 2
Code Structure: The class is straightforward, but fields, the constructor, and event-listener overloads are interspersed rather than grouped logically. Nesting: There is no deep nesting, making the code easy to scan. Clarity of intent: The class name, inheritance, and SVG-specific types clearly indicate a DOM binding, though abbreviated names and unexplained numeric type fields require API familiarity. Code length: The declaration is concise, with little unnecessary content. Action granularity: Each field or method declaration occupies its own line. Reading flow: Mostly natural, but separating fields from methods, grouping overloads, and adding blank lines between sections would improve readability.
Run 3
Code Structure: The class is straightforward, but fields, constructor, prototype, and event-listener overloads are interleaved rather than grouped consistently. Nesting: Essentially flat, with no complex control flow. Clarity of intent: Descriptive SVG types and constant names communicate a DOM binding, though in1 and the absence of documentation offer limited context. Code length: Concise for a declaration-only class; overload repetition is reasonable. Action granularity: Each declaration occupies its own line, making individual members easy to scan. Reading flow: Mostly natural, but the scattered addEventListener overloads and lack of blank lines between logical sections interrupt the flow.