Sample
Schnappinger/aoi/artofillusion.TransformPointsDialog
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 29.8Δ 12.1 |
| Scalabrino | 0.674 | 0–1; higher is more readable | 32.2Δ 9.7 |
| Dorn | 0.285 | 0–1; higher is more readable | 46.9Δ 5.0 |
| Mi | 0.719 | 0–1; higher is more readable | 86.8Δ 44.9 |
| LLOC | 58 | Logical lines; fewer is more readable | 36.0Δ 5.9 |
| DeepSeek V4 Pro | 16.67 | 0–20; mean of three runs | 59.9Δ 18.0 |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs | 38.9Δ 3.0 |
| BTTF | 0.269 | 0–1; higher is more readable | 18.5Δ 23.4 |
| Human | 3.72 | 1–4; original rating | 41.9 |
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. | 4862.152 | −160.451 |
| Source linesThe number of non-empty source lines. | 116 | +46.4 |
| 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.948 | −7.422 |
Intercept 8.87 + feature contributions = -112.603 (log-odds).
Score = sigmoid(-112.603) = 0.
| Score | 0.674 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 116 | −3.071 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 105 | +2.895 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 105 | −1.989 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 114.954 | +1.197 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 106.974 | +0.922 |
| 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. | 106.94 | −0.864 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.105 | −0.08 |
Intercept 0.07 + feature contributions = -0.92 (log-odds).
Score = sigmoid(-0.92) = 0.285.
| Score | 0.719 |
|---|
| Score | 58 |
|---|
Run 1
The code is well-structured with clear separation of concerns: constructor, public API, dialog layout, event handling, and utility methods. Nesting is minimal and manageable, with only one level inside loops and conditionals. Intent is clear throughout, with descriptive method names like layoutDialog, doOk, and useSelectionCenter. Code length is appropriate—neither overly verbose nor terse. Action granularity is generally good, though some lines (e.g., content.add(fields[i] = new ValueField(...), ...)) combine multiple actions. Reading flow is natural, with layout code grouped logically and helper methods placed after their callers. Minor deductions: the ternary expression for default values in doOk is slightly dense, and the keyPressed method uses two separate if statements where else-if would be more idiomatic. Overall, this is clean, maintainable GUI code that follows good practices.
Run 2
The code is well-structured and readable. It has clear class and method names, logical organization of UI layout, and consistent indentation. The dialog layout is built in a flat, step-by-step manner with one action per line, which aids readability. The 'doOk' and 'keyPressed' methods are concise and show clear intent. Nesting is minimal, mostly limited to a single loop or conditional. The only minor drawbacks are the slightly dense layout code with hardcoded grid positions and the use of a magic number (9) for the field array size without a named constant. Overall, the code is straightforward, maintainable, and easy for another developer to follow.
Run 3
The code is generally well-structured and readable. It follows a clear logical layout with separate methods for dialog setup, event handling, and value retrieval. Nesting is minimal, with only small loops and one level of recursion in the listener registration. Intent is mostly clear from method names and comments, though the layout coordinates in layoutDialog() use magic numbers that could be clearer. Code length is reasonable, though the layout method is somewhat verbose. Action granularity is good, with one main action per line in most cases. Reading flow is natural: fields are declared at the top, constructor follows, then public API, then private helper methods. Some minor issues: the grid coordinates (0,1), (1,0), etc. are not self-documenting, and the loop in doOk() mixes value extraction with default assignment, slightly reducing clarity. Overall, this is readable code with only minor opportunities for improvement.
Run 1
Code Structure: Clear separation of initialization, layout, value extraction, keyboard handling, and listener registration. Nesting: Shallow loops and conditionals keep control flow easy to follow; recursive listener registration is straightforward. Clarity of intent: Descriptive method names and comments explain the dialog's purpose, but numeric array indices, hard-coded dimensions, and the i < 6 default rule require readers to infer the translation/rotation/scale mapping. Code length: Compact and appropriate for a small dialog, though layoutDialog contains repetitive UI setup. Action granularity: Most lines perform one action, but assignments embedded in content.add and row.add combine initialization with insertion. Reading flow: Methods follow a natural construction-to-interaction progression, with consistent formatting. Unbraced control statements, wildcard imports, and legacy array declaration syntax slightly reduce readability.
Run 2
Code Structure: Responsibilities are logically separated into construction, layout, value handling, keyboard handling, and listener registration. Nesting: Control flow is shallow, with only modest nesting in value normalization and recursive listener setup. Clarity of intent: Descriptive method names and comments explain the dialog's purpose, but numeric indices, fixed dimensions, and the implicit translation/rotation/scaling array mapping require interpretation. Code length: The implementation is reasonably concise; most layout statements are necessary rather than redundant. Action granularity: Most lines perform one action, though assignments embedded in widget-add calls combine initialization and placement. Reading flow: Methods follow a natural setup-to-interaction progression, aided by consistent formatting. Wildcard imports, raw Iterator usage, omitted braces, and compact index arithmetic slightly reduce readability.
Run 3
Code Structure: Well organized into constructor, accessors, layout setup, confirmation handling, and event helpers. Nesting: Shallow loops and conditionals keep control flow easy to follow; recursive listener registration is straightforward. Clarity of intent: Descriptive method names and class documentation explain the dialog's purpose, but numeric indices, grid coordinates, and the implicit mapping of nine fields to transformation types require inference. Code length: Compact and appropriate for a small dialog, although layoutDialog contains a dense sequence of UI setup operations. Action granularity: Most lines perform one action, but assignments embedded in content.add and row.add combine initialization with insertion. Reading flow: Methods follow a natural initialization-to-interaction progression, with consistent formatting. Missing braces on single-statement control blocks, raw iterator usage, and tightly spaced index arithmetic slightly reduce readability.