Sample
Schnappinger/aoi/artofillusion.procedural.ColorLightenModule
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 44.1Δ 26.0 |
| Scalabrino | 0.413 | 0–1; higher is more readable | 4.1Δ 14.0 |
| Dorn | 0.102 | 0–1; higher is more readable | 33.7Δ 15.5 |
| Mi | 0.253 | 0–1; higher is more readable | 16.5Δ 1.7 |
| LLOC | 27 | Logical lines; fewer is more readable | 51.5Δ 33.3 |
| DeepSeek V4 Pro | 16.33 | 0–20; mean of three runs | 53.1Δ 35.0 |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs | 38.9Δ 20.8 |
| BTTF | 0.315 | 0–1; higher is more readable | 23.1Δ 5.0 |
| Human | 2.8 | 1–4; original rating | 18.2 |
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. | 2377.724 | −78.465 |
| Source linesThe number of non-empty source lines. | 80 | +32 |
| 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.95 | −7.426 |
Intercept 8.87 + feature contributions = -45.02 (log-odds).
Score = sigmoid(-45.02) = 0.
| Score | 0.413 |
|---|
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. | 173.975 | −3.704 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 173.988 | +2.003 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 80 | −1.796 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 72 | +1.753 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 72 | −1.231 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 78.863 | +0.693 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.093 | +0.035 |
Intercept 0.07 + feature contributions = -2.177 (log-odds).
Score = sigmoid(-2.177) = 0.102.
| Score | 0.253 |
|---|
| Score | 27 |
|---|
Run 1
The code is well-structured and readable. It has a clear class hierarchy, with methods logically organized and named clearly (init, getColor). Nesting is minimal, mostly limited to a few if-else blocks. The intent is unambiguous, with descriptive comments explaining the module's purpose and the meaning of key steps. The code is concise but not overly terse; it avoids repetition where sensible, though the two nearly identical color-input blocks introduce some redundancy. Action granularity is generally good—each line does one thing, though some lines contain both method calls and assignments. Reading flow is natural: the method follows a predictable sequence, from cache check to input processing to output selection. The main weaknesses are the duplicated input handling logic, which could be refactored for even better clarity, and occasional dense lines in the constructor. Overall, it is highly readable, maintainable code.
Run 2
The code is generally readable with clear structure and logical organization. The class has a single responsibility and methods are well-separated. Variable names are descriptive and the comments help explain the module's purpose. However, there are some readability issues: the constructor has deeply nested method calls and long parameter lists that span multiple lines, making it harder to follow. The getColor method contains moderate nesting with multiple if-else branches and lacks clear separation between the two color calculation blocks - extracting helpers would improve clarity. The blur caching logic is not immediately obvious from the code itself. Action granularity is mostly good, though multiple operations occur in single lines (e.g., setting color and brightness together). The reading flow is natural overall, with comments guiding the reader through the algorithm's intent.
Run 3
The code is generally well-structured and readable. It has clear class and method organization, with logical separation of concerns (constructor, initialization, and color calculation). Nesting is minimal, with only a few shallow conditional blocks. The intent is clearly communicated through comments and meaningful method/variable names like 'getColor', 'brightness1/2', and 'linkFrom'. Code length is appropriate—not overly verbose. Action granularity is good, with one main operation per line in most cases. Reading flow is natural: the module description at the top, followed by imports, class declaration, constructor, and methods. Minor deductions: the getColor method has slightly complex control flow with multiple early returns and state flags (colorOk, lastBlur), which could be made clearer. Some magic numbers (1.0f for white) could be constants. The conditional block formatting is slightly inconsistent. Overall, it's maintainable and understandable code.
Run 1
Code Structure: Clearly separated constructor, cache reset, and color calculation methods provide logical organization. Nesting: Shallow conditionals and an early cache return keep complexity low. Clarity of intent: The module comment, method names, and brightness comparison explain the purpose, although colorOk, c, and implicit cache/output synchronization require interpretation. Code length: The implementation is reasonably concise, with minor duplication in input handling; the lengthy license is standard boilerplate. Action granularity: Most statements perform one action per line, but the constructor compresses several nested array and port constructions into long lines. Reading flow: Execution follows a natural sequence from cache check to input retrieval and brightness comparison. Unconventional brace indentation and dense constructor formatting slightly hinder scanning.
Run 2
Code Structure: Clearly separated constructor, initialization, and color calculation methods; caching and comparison logic are logically organized. Nesting: Shallow conditionals and an early return keep complexity low. Clarity of intent: Comments, method names, and brightness variables explain the purpose, though colorOk and c are vague, and using c as both a temporary input color and output requires attention. Code length: Mostly concise, with some repetitive input-handling logic and a dense constructor. Action granularity: Most lines perform one action, but constructor lines combine multiple nested object and array constructions. Reading flow: Calculation proceeds naturally from cache check to input retrieval to brightness comparison; unconventional brace indentation, long constructor lines, and implicit cache updates slightly interrupt readability.
Run 3
Code Structure: Clear separation between construction, cache invalidation, and color selection, though getColor mixes caching, input retrieval, and comparison. Nesting: Shallow conditionals and an early return keep complexity low. Clarity of intent: Comments, class naming, and brightness variables explain the purpose; colorOk, c, and implicit use of color as both temporary storage and cache require interpretation. Code length: Compact overall, with some repetitive input-handling logic. Action granularity: Most lines perform one action, but the constructor packs several nested object and array initializations into long lines. Reading flow: The progression from cache check through input evaluation to selection is natural, although unusual brace indentation and dense constructor formatting interrupt readability.