Sample
Schnappinger/jsweet/def.dom.intl.ResolvedNumberFormatOptions
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0.01 | 0–1; higher is more readable | 70.6Δ 14.1 |
| Dorn | 0.673 | 0–1; higher is more readable | 72.3Δ 12.4 |
| Mi | 0.704 | 0–1; higher is more readable | 84.5Δ 0.2 |
| LLOC | 11 | Logical lines; fewer is more readable | 70.6Δ 14.0 |
| DeepSeek V4 Pro | 13.33 | 0–20; mean of three runs | 24.1Δ 60.6 |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs | 73.8Δ 10.9 |
| BTTF | 0.667 | 0–1; higher is more readable | 71.6Δ 13.0 |
| Human | 3.97 | 1–4; original rating | 84.7 |
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. | 443.907 | −14.649 |
| Source linesThe number of non-empty source lines. | 20 | +8 |
| 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.553 | −6.83 |
Intercept 8.87 + feature contributions = -4.608 (log-odds).
Score = sigmoid(-4.608) = 0.01.
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. | 72.952 | +0.575 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.055 | +0.405 |
| 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. | 21 | +0.293 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 19.622 | −0.136 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 19 | −0.08 |
Intercept 0.07 + feature contributions = 0.721 (log-odds).
Score = sigmoid(0.721) = 0.673.
| Score | 0.704 |
|---|
| Score | 11 |
|---|
Run 1
The code is a simple data class with clear field declarations and logical ordering. Each field is on its own line, keeping action granularity clean and reading flow straightforward. Nesting is minimal, and the class purpose is evident as a container for number formatting options. The one issue is the typo in 'minimumintegerDigits', which should be 'minimumIntegerDigits' to match naming conventions and improve clarity. Overall, the structure is flat, concise, and easy to follow.
Run 2
The code is a simple data class, so it is not deeply nested or overly long. However, readability is significantly reduced by poor naming conventions (e.g., 'minimumintegerDigits' lacks camelCase consistency), inconsistent annotations, and a lack of documentation explaining the purpose of each field. The flat structure makes it easy to scan, but the class is largely a list of magic strings and numbers with no context. It reads like an auto-generated stub, which is likely its origin. While the intent is partially clear (representing resolved number formatting options), the lack of grouping or comments between related fields (like currency vs digits) disrupts the reading flow. Action granularity is mostly one field per line, which is good, but the overall clarity suffers from verbosity without explanation.
Run 3
The code is highly readable due to its clear structure and flat organization. It defines a Java class representing resolved number format options, with each field clearly declared on its own line, adhering to one-action-per-line granularity. The use of Jsweet annotations like @Interface and @Optional clearly communicates intent. The field names are descriptive and self-explanatory. One minor issue is the typo in 'minimumintegerDigits' (should be 'minimumIntegerDigits'), which could cause confusion. Additionally, fields like 'currency' and 'currencyDisplay' are semantically optional but only some are annotated, which may slightly obscure intent. Overall, the code is concise, well-organized, and easy to follow.
Run 1
Code Structure: A straightforward class containing related number-format options, with optional fields clearly annotated. Nesting: Flat declarations with no nested logic. Clarity of intent: The class and field names communicate their purpose, though minimumintegerDigits has inconsistent capitalization, and the abstract-class/interface annotation combination requires framework familiarity. Code length: Concise, with no unnecessary implementation. Action granularity: Each field declaration and annotation occupies its own line. Reading flow: Fields follow a sensible progression from locale and style to currency, digit limits, and grouping. Blank lines between these groups would improve scanning.
Run 2
Code Structure: A simple class cleanly groups related number-format options, with optional annotations placed directly above their fields. Nesting: Only one class level, with no nested control flow. Clarity of intent: The class and field names clearly convey their purpose, though minimumintegerDigits has inconsistent capitalization. Code length: Concise, with no unnecessary logic or declarations. Action granularity: Each field declaration and annotation occupies its own line. Reading flow: Fields follow a natural progression from locale and style to currency, digit settings, and grouping. Blank lines between conceptual groups and after the package declaration would improve visual scanning.
Run 3
Code Structure: A simple, logically organized data declaration with related number-format options grouped together. Nesting: No nested control flow; only a single class scope. Clarity of intent: The class and field names clearly describe resolved formatting options, although minimumintegerDigits has inconsistent capitalization. Code length: Concise, with no unnecessary implementation or boilerplate. Action granularity: Each field and annotation occupies its own line, making individual declarations easy to scan. Reading flow: Fields follow a natural progression from locale and style to currency, digit limits, and grouping. Blank lines between conceptual groups would improve scanning slightly.