Sample
Schnappinger/aoi/artofillusion.procedural.ColorScaleModule
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 47.5Δ 22.1 |
| Scalabrino | 0.522 | 0–1; higher is more readable | 10.6Δ 14.8 |
| Dorn | 0.235 | 0–1; higher is more readable | 43.2Δ 17.8 |
| Mi | 0.51 | 0–1; higher is more readable | 35.3Δ 9.9 |
| LLOC | 19 | Logical lines; fewer is more readable | 61.6Δ 36.1 |
| DeepSeek V4 Pro | 16 | 0–20; mean of three runs | 47.4Δ 21.9 |
| GPT-6.1 Sol | 16.67 | 0–20; mean of three runs | 48.0Δ 22.6 |
| BTTF | 0.272 | 0–1; higher is more readable | 19.1Δ 6.3 |
| Human | 3 | 1–4; original rating | 25.4 |
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. | 1907.266 | −62.94 |
| Source linesThe number of non-empty source lines. | 61 | +24.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. | 5.033 | −7.55 |
Intercept 8.87 + feature contributions = -37.22 (log-odds).
Score = sigmoid(-37.22) = 0.
| Score | 0.522 |
|---|
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. | 143.968 | −2.433 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 144 | +1.519 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 62 | −1.159 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 53 | +1.096 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 53 | −0.795 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 60.648 | +0.438 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.088 | +0.083 |
Intercept 0.07 + feature contributions = -1.181 (log-odds).
Score = sigmoid(-1.181) = 0.235.
| Score | 0.51 |
|---|
| Score | 19 |
|---|
Run 1
The code is generally well-structured with clear separation of concerns: constructor sets up ports, init resets state, getColor computes output. Purpose is evident from comments and naming. Nesting is shallow with only one level in getColor. However, there are minor readability issues: the constructor call is very long with deeply nested array initializations, making it hard to parse at a glance. The caching logic (colorOk/lastBlur) adds conditional complexity. Multiple actions occur per line in the constructor and some method calls chain operations. The mixed use of comments and self-documenting code is reasonable, though inline comments could be more descriptive. The method signature for getColor includes an unused 'which' parameter, adding slight ambiguity. Overall, readable but could benefit from extracting port configuration or simplifying constructor initialization.
Run 2
The code is generally readable with clear structure and intent. The class is well-organized, with logical fields, constructor, and methods. Nesting is reasonably flat, with only one level of conditional nesting in getColor. Purpose is clear from comments and method names (init, getColor). Code length is proportionate to functionality, and action granularity is mostly one action per line. Reading flow is natural. However, readability is slightly reduced by the very long constructor call with heavily nested array initializations for IOPort objects, making the signature difficult to parse at a glance. The mixed use of Unicode escape sequence '\u00D7' also obscures the operator symbol. Some minor inconsistencies exist, like using both explicit 0.0f values and setRGB for default color, but overall the code is maintainable and understandable.
Run 3
The code is generally clear and well-structured. The module has a single, focused purpose with concise methods (init, getColor) and flat nesting. Comments explain non-obvious behavior. However, readability is slightly reduced by the dense constructor, which packs multiple multi-line IOPort array definitions into a single long call. Also, several operations occur within the getColor method (input handling, color scaling, caching), making it somewhat busy. Naming is clear, but import statements are overly broad (artoillusion.*), which obscures dependencies. Overall, the flow is logical and the code is maintainable for experienced readers.
Run 1
Code Structure: Logically organized into construction, cache invalidation, and color calculation. Nesting: Shallow conditionals and an early return keep control flow simple. Clarity of intent: The class name, comments, and operations clearly communicate color scaling, though names such as colorOk and c, plus numeric input indices, require interpretation. Code length: Compact and mostly necessary; the license header adds reading overhead but is separate from the implementation. Action granularity: Most statements perform one action per line, but the constructor compresses several nested object and array creations into dense lines. Reading flow: Calculation proceeds naturally from cache checking to input retrieval, scaling, and output copying. Unusual brace indentation, omitted conditional braces, wildcard imports, and crowded constructor formatting slightly reduce readability.
Run 2
Code Structure: The class is logically organized into construction, cache initialization, and color calculation. Nesting: Control flow is shallow, with a straightforward early return for cached results. Clarity of intent: The class name, comments, and method calls clearly convey color scaling, although names such as colorOk and c and numeric input indices require some interpretation. Code length: The implementation is concise with little unnecessary logic; the license header adds length but not complexity. Action granularity: Most lines perform one action, but the constructor compresses several nested array and port constructions into long lines. Reading flow: Calculation proceeds naturally from cache checking to obtaining a color, applying a scale, and copying the result. Dense constructor formatting, wildcard imports, and inconsistent brace usage slightly reduce readability.
Run 3
Code Structure: The class is logically organized into construction, initialization, and color calculation, with straightforward caching. Nesting: Control flow is shallow, and an early return keeps the main calculation flat. Clarity of intent: The introductory comment and method comments explain the purpose; names generally communicate their roles, though colorOk, c, and numeric link indices require some interpretation. Code length: The implementation is concise without substantial duplication; the lengthy license header does not complicate the logic. Action granularity: Most lines perform one action, but the constructor packs several nested object and array creations into long lines. Reading flow: Methods follow a natural sequence, and getColor proceeds clearly from cache checking to input retrieval, scaling, and output copying. Dense constructor formatting, wildcard imports, and inconsistent brace placement slightly reduce readability.