Sample
Schnappinger/aoi/artofillusion.procedural.AbsModule
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 48.8Δ 13.2 |
| Scalabrino | 0.577 | 0–1; higher is more readable | 18.2Δ 43.9 |
| Dorn | 0.233 | 0–1; higher is more readable | 42.9Δ 19.1 |
| Mi | 0.46 | 0–1; higher is more readable | 28.7Δ 33.3 |
| LLOC | 19 | Logical lines; fewer is more readable | 61.6Δ 0.5 |
| DeepSeek V4 Pro | 17 | 0–20; mean of three runs | 66.8Δ 4.8 |
| GPT-6.1 Sol | 16.67 | 0–20; mean of three runs | 48.0Δ 14.0 |
| BTTF | 0.341 | 0–1; higher is more readable | 25.7Δ 36.3 |
| Human | 3.93 | 1–4; original rating | 62.0 |
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. | 1897.438 | −62.615 |
| Source linesThe number of non-empty source lines. | 66 | +26.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.028 | −7.543 |
Intercept 8.87 + feature contributions = -34.888 (log-odds).
Score = sigmoid(-34.888) = 0.
| Score | 0.577 |
|---|
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. | 145 | −2.476 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 144.985 | +1.535 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 67 | −1.336 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 58 | +1.269 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 58 | −0.91 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 65.678 | +0.508 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.081 | +0.151 |
Intercept 0.07 + feature contributions = -1.19 (log-odds).
Score = sigmoid(-1.19) = 0.233.
| Score | 0.46 |
|---|
| Score | 19 |
|---|
Run 1
The code is well-structured with clear separation of methods, minimal nesting, and concise implementation. Each method has a single responsibility and the logic is straightforward. Comments explain the intent of each method effectively. The constructor signature is long but remains readable due to consistent formatting. Variable names like signOk, positive, and lastBlur clearly convey their purpose. Action granularity is appropriate—most lines perform one logical operation. The reading flow is natural: initialization, value calculation, error handling, and gradient computation follow a logical sequence. Minor deductions could apply to the slightly verbose constructor and the reliance on a cached state (signOk/lastBlur) which requires careful tracking, but overall readability is high.
Run 2
The code is well-structured and readable. It clearly separates concerns with distinct methods for initialization, average value calculation, error propagation, and gradient computation. Nesting is minimal, with only straightforward conditional checks. Intent is clear: the module computes absolute values, and comments explain each method's purpose. Code length is appropriate, neither overly verbose nor too terse. Action granularity is good, with one logical operation per line. Reading flow is natural, following the expected lifecycle of a procedural module (init → calculate → error → gradient). Minor issues: the constructor has a long line with a typo in the input label and no newline between a method and the following comment, slightly affecting formatting consistency. Overall, the code is highly maintainable and easy to understand.
Run 3
The code is generally well-structured and readable. It follows a clear logical organization with methods separated by purpose: initialization, value calculation, error propagation, and gradient computation. Nesting is minimal, with a single ternary expression and one conditional in getValueGradient. Intent is mostly clear, though the caching behavior (signOk, lastBlur) could benefit from a brief comment explaining the invalidation strategy. Code length is appropriate—each method is concise and focused. Action granularity is good: one logical action per line, with no dense multi-statement lines. Reading flow is natural, progressing from constructor to core computation to error handling. Minor deductions: the constructor call is quite long with deeply nested array initialization, which slightly hurts scanability. The field declarations lack explanatory comments, and the magic string "(0" appears unexplained. Overall, this is maintainable and readable procedural code.
Run 1
Code Structure: The class is logically organized into construction, initialization, value calculation, error propagation, and gradient calculation. Nesting: Control flow is flat, with simple conditionals and no nested blocks. Clarity of intent: The class name, method names, and comments clearly communicate absolute-value behavior, though signOk and positive require some interpretation of cached state. Code length: The implementation is concise; the lengthy license header is conventional rather than unnecessary implementation detail. Action granularity: Most lines perform one action, but the constructor packs several nested object and array constructions into long lines. Reading flow: Methods follow a natural sequence, with consistent indentation and useful comments. Wildcard imports, omitted conditional braces, and dense constructor formatting slightly hinder scanning. The gradient method's unconditional input dereference also makes disconnected-input behavior less clear than in the other methods.
Run 2
Code Structure: The class is logically organized into construction, initialization, value calculation, error propagation, and gradient calculation. Nesting: Methods remain flat, with only simple conditionals and ternary expressions. Clarity of intent: The class name and brief comments clearly communicate absolute-value behavior, though signOk and positive require some interpretation of cached state. Code length: The implementation is concise; the lengthy license header is conventional rather than unnecessary logic. Action granularity: Statements generally perform one action per line, although the constructor packs several nested object and array creations into long lines. Reading flow: Method ordering and straightforward calculations support natural reading. Dense constructor formatting, wildcard imports, omitted braces around conditionals, and the gradient method's implicit assumption that an input exists slightly reduce readability.
Run 3
Code Structure: Small, logically organized class with separate methods for initialization, value, error, and gradient calculation. Nesting: Very shallow, with simple conditionals and no nested control flow. Clarity of intent: The class name and method comments clearly describe absolute-value behavior, but signOk and positive require interpreting shared caching state. The gradient method's lack of a null check, unlike the other methods, makes input assumptions less clear. Code length: Implementation is concise; the lengthy constructor expressions are the main readability burden. Action granularity: Most statements perform one action per line, although combined field declarations and inline port construction compress details. Reading flow: Methods follow a natural progression, but long lines, wildcard imports, omitted conditional braces, and slightly inconsistent spacing reduce scanability.