Sample
Schnappinger/aoi/artofillusion.RotateObjectTool
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 14.0Δ 8.1 |
| Scalabrino | 0.505 | 0–1; higher is more readable | 9.9Δ 4.0 |
| Dorn | 0.01 | 0–1; higher is more readable | 20.1Δ 14.2 |
| Mi | 0.727 | 0–1; higher is more readable | 87.1Δ 81.2 |
| LLOC | 191 | Logical lines; fewer is more readable | 13.7Δ 7.8 |
| DeepSeek V4 Pro | 13.67 | 0–20; mean of three runs | 26.9Δ 21.0 |
| GPT-6.1 Sol | 14 | 0–20; mean of three runs | 16.2Δ 10.2 |
| BTTF | 0.111 | 0–1; higher is more readable | 3.3Δ 2.6 |
| Human | 2.01 | 1–4; original rating | 5.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. | 15419.12 | −508.831 |
| Source linesThe number of non-empty source lines. | 313 | +125.2 |
| 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.867 | −7.3 |
Intercept 8.87 + feature contributions = -382.061 (log-odds).
Score = sigmoid(-382.061) = 0.
| Score | 0.505 |
|---|
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. | 313 | −10.046 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 302 | +9.709 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 302 | −6.509 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 311.753 | +3.948 |
| 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. | 168.968 | −3.492 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 168.997 | +1.922 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.116 | −0.187 |
Intercept 0.07 + feature contributions = -4.585 (log-odds).
Score = sigmoid(-4.585) = 0.01.
| Score | 0.727 |
|---|
| Score | 191 |
|---|
Run 1
The code has clear structure with logical method organization and good naming, but suffers from several readability issues. Deep nesting appears in mouseDragged and keyPressed methods with multiple nested if-else blocks and loops. The intent is generally clear from method names and comments, though complex rotation logic could benefit from more explanation. Code length is moderate but some methods like mouseDragged and keyPressed are overly long. Action granularity is inconsistent - some lines combine multiple operations while others are well-separated. Reading flow is disrupted by long nested blocks and complex mathematical operations that could be extracted into helper methods. The rotation center calculation logic is duplicated in mousePressedOnObject and keyPressed, indicating opportunities for refactoring. Variable declarations at method tops are old-style and don't aid readability. The code is functional but would benefit from extracting helper methods and reducing nesting depth.
Run 2
The code is moderately readable but has several issues. The class structure is logical with clear method separation, and constants are well-named. However, there are significant problems: deeply nested conditional blocks in mouseDragged and keyPressed methods make the logic hard to follow. Multiple actions are crammed into single lines (especially in loops and method calls), reducing clarity. Variable declarations are scattered (e.g., 'c' and 'undo' declared at top but used much later). The mouseDragged method has complex rotation logic buried in nested if-else chains. Some methods like mousePressedOnObject and keyPressed duplicate the same rotation-center calculation code, indicating poor abstraction. Comments are sparse and the action granularity is inconsistent. The code would benefit from extracting smaller helper methods and breaking up compound statements.
Run 3
The code is generally clear but has several readability issues. The class structure and method organization are logical, and the intent is mostly clear. However, methods like mousePressedOnObject and mouseDragged are long with multiple mixed responsibilities, reducing clarity. There is duplicated logic between mousePressedOnObject and keyPressed for computing rotation centers, which could be extracted into a helper. Some lines are dense, combining variable declarations with assignments and side effects (e.g., 'ObjectInfo info = (ObjectInfo) toMove.elementAt(i), parent = info;'). Nesting is moderate but repeated within loops. Action granularity is inconsistent; some lines perform multiple operations. The reading flow is natural in some parts but disrupted by verbose matrix calculations and inlined logic. Comments are minimal and could better explain complex transformations. Overall, the code is understandable for an experienced developer but would benefit from refactoring to reduce duplication and improve modularity.
Run 1
Code Structure: Event-handler methods organize responsibilities logically, but rotation-center calculation is duplicated and longer handlers mix selection, undo, and transformation logic. Nesting: Generally moderate, with deeper conditional and loop combinations in center calculation requiring extra attention. Clarity of intent: Descriptive method names, named constants, and section comments communicate purpose; abbreviated variables, numeric handle mappings, and shared mutable state obscure details. Code length: Reasonable for the functionality, but duplicated setup and transformation logic could be extracted into helpers. Action granularity: Most statements perform one action, though assignment inside method calls, combined declarations, and long matrix-expression chains reduce clarity. Reading flow: Lifecycle ordering is natural and formatting mostly consistent, but long lines, occasional indentation inconsistencies, and subtle shared-center references interrupt comprehension.
Run 2
Code Structure: Event handlers provide logical organization, but selection and rotation-center calculations are duplicated rather than extracted into helpers. Nesting: Generally moderate, with deeper conditional and parent-traversal nesting making some sections harder to follow. Clarity of intent: Descriptive handler names, axis constants, and section comments communicate the purpose well; abbreviated variables, numeric handle mappings, and shared mutable state require extra interpretation. Code length: Reasonable for the functionality, but duplicated logic and long matrix expressions add avoidable bulk. Action granularity: Most lines perform one action, although combined declarations, assignment within method calls, and chained matrix operations reduce clarity. Reading flow: Interaction proceeds naturally from press through drag and release, and keyboard handling has useful section comments. However, inconsistent indentation, omitted braces, and dense expressions interrupt otherwise coherent flow.
Run 3
Code Structure: Event-handler methods organize responsibilities logically, but rotation-center calculation is duplicated and larger handlers mix selection, geometry, undo, and UI updates. Nesting: Mostly moderate, with deeper loop/conditional combinations in center calculation and parent traversal. Clarity of intent: Descriptive method names, axis constants, and section comments explain the tool well; terse variables, numeric handle mappings, shared mutable state, and dense matrix expressions require extra interpretation. Code length: Reasonable for the functionality, though duplicated logic and repetitive axis branches could be extracted into helpers. Action granularity: Most statements perform one action per line, but combined declarations, assignment within method calls, and chained transformations reduce clarity. Reading flow: The press-drag-release lifecycle and keyboard sections are natural to follow; inconsistent indentation, omitted braces, and long expressions interrupt otherwise coherent flow.