Sample
Schnappinger/jsweet/def.js.PropertyDescriptorMap
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0.259 | 0–1; higher is more readable | 75.9Δ 16.0 |
| Scalabrino | 0.767 | 0–1; higher is more readable | 53.1Δ 38.8 |
| Dorn | 0.626 | 0–1; higher is more readable | 69.3Δ 22.6 |
| Mi | 0.497 | 0–1; higher is more readable | 33.0Δ 58.9 |
| LLOC | 1 | Logical lines; fewer is more readable | 98.3Δ 6.4 |
| DeepSeek V4 Pro | 17 | 0–20; mean of three runs | 66.8Δ 25.1 |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs | 73.8Δ 18.2 |
| BTTF | 0.617 | 0–1; higher is more readable | 61.1Δ 30.9 |
| Human | 4 | 1–4; original rating | 91.9 |
Views
Loading feature diagnosis…
Source regions
Feature contributions
Feature contributions
| Feature | Value | Contribution (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.683 | −7.024 |
| Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones. | 160.474 | −5.296 |
| Source linesThe number of non-empty source lines. | 6 | +2.4 |
Intercept 8.87 + feature contributions = -1.05 (log-odds).
Score = sigmoid(-1.05) = 0.259.
| Score | 0.767 |
|---|
Feature contributions
| Feature | Value | Contribution (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. | 67 | +0.827 |
| 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.765 | −0.329 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.084 | +0.127 |
Intercept 0.07 + feature contributions = 0.513 (log-odds).
Score = sigmoid(0.513) = 0.626.
| Score | 0.497 |
|---|
| Score | 1 |
|---|
Run 1
The code is concise and clearly structured. It defines a single interface extending an Object, with one native method. The lack of unnecessary complexity, minimal nesting, and explicit purpose make it highly readable. Only the annotation and short method body slightly reduce clarity without additional context.
Run 2
The code is highly readable due to its minimal and straightforward structure. It clearly defines a class extending `Object` with a single abstract method, making intent obvious. There is no unnecessary nesting, and each line performs a distinct action, aligning with good action granularity. The use of annotations and naming conventions enhances clarity, though some implicit external dependencies (e.g., `@jsweet.lang.Interface`) may require context for full comprehension.
Run 3
The code is concise and easy to read. It defines a single class with a clear purpose: mapping string keys to PropertyDescriptor objects. The structure is logical, with package, annotations, class declaration, and method each on separate lines. There is minimal nesting, and the intent is unambiguous. The use of native and abstract keywords is appropriate for the context (interfacing with JavaScript). The only minor drawbacks are the lack of documentation and the somewhat cryptic naming of the method $get, which may not be immediately obvious to all readers, but these are minor in an otherwise clean and readable snippet.
Run 1
Code Structure: The package, annotation, class, and method are logically organized. Nesting: Only one class level, with no nested logic. Clarity of intent: PropertyDescriptorMap and the typed getter suggest a string-keyed descriptor map, though the interop-specific $get name and parameter s are less immediately clear. Code length: Concise, with no unnecessary implementation. Action granularity: Each declaration occupies its own line. Reading flow: Natural top-to-bottom progression; spacing between declarations and conventional modifier ordering would slightly improve readability.
Run 2
Code Structure: A simple, logically organized class with a single accessor. Nesting: Minimal, with only the class body. Clarity of intent: PropertyDescriptorMap and the PropertyDescriptor return type convey a property-descriptor lookup, though the parameter name s and generated-style $get naming reduce clarity. Code length: Concise, with no unnecessary implementation. Action granularity: Each declaration occupies its own line. Reading flow: Natural package-to-annotation-to-class-to-method progression, although spacing between sections and conventional public native modifier ordering would improve readability.
Run 3
Code Structure: A simple, logically organized declaration with one member. Nesting: Minimal nesting makes it easy to scan. Clarity of intent: PropertyDescriptorMap and the return type clearly suggest a property-name-to-descriptor mapping, though the generated-style $get method, parameter name s, and interface annotation on an abstract class require framework familiarity. Code length: Concise, with no unnecessary implementation. Action granularity: Each declaration occupies its own line. Reading flow: Natural progression from package to annotation, class, and method; spacing between these elements would slightly improve readability.