Sample
Schnappinger/aoi/artofillusion.CreateCubeTool
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 27.4Δ 6.9 |
| Scalabrino | 0.687 | 0–1; higher is more readable | 36.0Δ 1.6 |
| Dorn | 0.244 | 0–1; higher is more readable | 44.2Δ 9.9 |
| Mi | 0.731 | 0–1; higher is more readable | 87.8Δ 53.5 |
| LLOC | 65 | Logical lines; fewer is more readable | 33.2Δ 1.2 |
| DeepSeek V4 Pro | 15.33 | 0–20; mean of three runs | 41.3Δ 6.9 |
| GPT-6.1 Sol | 15.33 | 0–20; mean of three runs | 30.7Δ 3.6 |
| BTTF | 0.302 | 0–1; higher is more readable | 20.5Δ 13.9 |
| Human | 3.24 | 1–4; original rating | 34.3 |
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. | 5620.358 | −185.472 |
| Source linesThe number of non-empty source lines. | 134 | +53.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.014 | −7.522 |
Intercept 8.87 + feature contributions = -130.524 (log-odds).
Score = sigmoid(-130.524) = 0.
| Score | 0.687 |
|---|
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. | 134 | −3.708 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 123 | +3.517 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 123 | −2.402 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 132.907 | +1.448 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 106.97 | +0.921 |
| 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.948 | −0.865 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.109 | −0.115 |
Intercept 0.07 + feature contributions = -1.133 (log-odds).
Score = sigmoid(-1.133) = 0.244.
| Score | 0.731 |
|---|
| Score | 65 |
|---|
Run 1
The code is generally readable but has some issues. Structure is logical, with clear class and method separation. Nesting is mostly flat, though the shiftDown logic has nested conditionals that could be simplified. Intent is clear - creating cubic objects in a 3D scene. Length is reasonable but the mouseDragged method does too much: creating objects, calculating geometry, and updating display. Action granularity is mostly good with one action per line, though some lines are dense with calculations. Reading flow is natural: setup, creation, geometric calculation, update. Main issues are the monolithic mouseDragged method and some mathematical operations that could use better variable naming or helper methods. The shiftDown logic for maintaining aspect ratio is particularly complex and could be extracted. The class has clear responsibility but the drag handling mixes too many concerns.
Run 2
The code is well-structured and readable. It has a clear class purpose, logical method separation, and consistent formatting. Nesting is generally flat, though the shiftDown block contains multiple nested if/else conditions that slightly increase complexity. Intent is clear: each method handles a distinct interaction, and variable names are descriptive (e.g., clickPoint, dragPoint, xsize). Code length is reasonable but the mouseDragged method is dense, mixing object creation, coordinate math, and UI updates. Action granularity is mostly one action per line, improving clarity. Reading flow is natural, with helpful inline comments delineating major steps. Minor deductions for the long mouseDragged method and some repetitive casting (e.g., repeated `(LayoutWindow) theWindow`), which could be refactored for brevity. Overall, the code is maintainable and easy to follow.
Run 3
The code has a clear class structure with well-named methods that map to mouse events, and the imports are organized. However, the mouseDragged method is overly long and handles too many responsibilities: object creation, size/position calculation, and UI updates. The shift-constraint logic has deeply nested conditionals that disrupt reading flow. Action granularity is inconsistent—some lines perform multiple operations (e.g., object instantiation with multiple constructor arguments). Variable declarations are grouped at the top of the method rather than near their usage, reducing locality. The intent is generally clear due to descriptive naming and comments marking logical sections, but the density of mathematical operations without explanation makes the coordinate transformation logic harder to follow. The code is readable overall but would benefit from extracting the size calculation and creation logic into helper methods.
Run 1
Code Structure: Lifecycle methods are logically organized, and comments divide dragging into creation, geometry calculation, and display updates; however, mouseDragged combines several responsibilities. Nesting: Most code is flat, but the shift-constrained sizing logic reaches three conditional levels. Clarity of intent: The class purpose and event handlers are clear, while abbreviated geometry names such as v1, v2, v3, and orig require interpretation. Code length: Overall length is reasonable, though repeated LayoutWindow casts and similar sizing branches add verbosity. Action granularity: Statements generally perform one action per line, with minor exceptions such as the counter increment embedded in object creation and grouped variable declarations. Reading flow: Consistent formatting and sequential processing make the code easy to follow, but dense mathematical expressions, missing braces on some conditionals, and an unused scene variable interrupt readability.
Run 2
Code Structure: Event-handler methods organize the tool logically, but mouseDragged combines object creation, geometry calculations, undo setup, and display updates. Nesting: Mostly shallow, with moderately nested conditionals for shift-constrained dragging. Clarity of intent: The class documentation, method names, and section comments explain the purpose well; abbreviated geometry variables such as v1, v2, v3, and orig require interpretation. Code length: Reasonably compact overall, though extracting geometry and creation helpers would make the long drag handler easier to scan. Action granularity: Most lines perform one clear action, but the object-construction expression also increments the naming counter, and grouped declarations reduce clarity slightly. Reading flow: Execution follows a natural create-calculate-update sequence. Repeated casts, dense arithmetic spacing, and brace-free conditional branches introduce minor reading friction.
Run 3
Code Structure: Event handlers organize the tool logically, and comments separate creation, geometry calculation, and display updates, though mouseDragged handles too many responsibilities. Nesting: Mostly shallow, but the shift-constrained dragging logic reaches three conditional levels. Clarity of intent: The class purpose and lifecycle are clear; terse names such as v1, v2, v3, and orig obscure the geometry calculations. Code length: Reasonably concise overall, but repeated casts, coordinate-difference expressions, and an unused scene variable add clutter. Action granularity: Most lines perform one action, although object construction combined with counter increment and chained calls slightly increases cognitive load. Reading flow: Processing follows a natural create-calculate-update sequence, supported by whitespace and comments. Grouped declarations, inconsistent spacing, and unbraced conditionals make portions harder to scan.