Sample
Schnappinger/aoi/artofillusion.material.MaterialMapping
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 1 | 0–1; higher is more readable | 92.0Δ 10.1 |
| Scalabrino | 0.936 | 0–1; higher is more readable | 95.9Δ 14.0 |
| Dorn | 0.743 | 0–1; higher is more readable | 78.9Δ 3.0 |
| Mi | 0.599 | 0–1; higher is more readable | 62.4Δ 19.5 |
| LLOC | 24 | Logical lines; fewer is more readable | 54.3Δ 27.6 |
| DeepSeek V4 Pro | 17.67 | 0–20; mean of three runs | 83.0Δ 1.2 |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs | 73.8Δ 8.1 |
| BTTF | 0.684 | 0–1; higher is more readable | 75.9Δ 5.9 |
| Human | 3.96 | 1–4; original rating | 81.8 |
Views
Loading feature diagnosis…
Source regions
Feature contributions
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Source linesThe number of non-empty source lines. | 121 | +48.4 |
| Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones. | 1292.901 | −42.666 |
| 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.669 | −7.004 |
Intercept 8.87 + feature contributions = 7.601 (log-odds).
Score = sigmoid(7.601) = 1.
| Score | 0.936 |
|---|
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. | 120 | −3.212 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 93 | +2.48 |
| 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. | 132.975 | −1.967 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 132.992 | +1.341 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 119.903 | +1.266 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.026 | +0.687 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
Intercept 0.07 + feature contributions = 1.063 (log-odds).
Score = sigmoid(1.063) = 0.743.
| Score | 0.599 |
|---|
| Score | 24 |
|---|
Run 1
The code is highly readable due to its clear, logical structure and excellent documentation. The class is well-organized with related methods grouped together, and the abstract methods are clearly separated from concrete implementations. Nesting is essentially flat, with no complex conditional logic or deep indentation. Each method has a clear Javadoc comment explaining its purpose, and method names are descriptive, making intent immediately apparent. The code is concise without being overly terse, using appropriate abstraction and delegation to the material and object classes. Action granularity is excellent - each line performs a single, clear operation. Reading flow is natural, following a logical progression from constructors to file I/O, property getters, and abstract methods. The only minor deductions are for the empty default getName() method and abstract methods that could benefit from even more specific documentation about edge cases. Overall, this is exemplary Java code that prioritizes clarity and maintainability.
Run 2
The code is highly readable. The structure follows a clear, logical class definition with well-defined abstract methods and concise accessors. Nesting is minimal, with only one small if-like conditional (the Javadoc note), and the body of the class is flat. Clarity of intent is strong, as method names like indexOfRefraction, castsShadows, and getMaterialSpec clearly describe their purpose and are supported by descriptive Javadoc comments. Code length is appropriate, avoiding redundancy and unnecessary verbosity. Action granularity is mostly one action per line, especially in the accessor methods that simply return a field. Reading flow is natural: fields, constructor, then abstract and concrete methods grouped by purpose (file IO, naming, material properties, mapping behavior). Minor deductions: some lengthy Javadoc paragraphs and the static getName method with no obvious use slightly disrupt flow, but overall the code is exemplary for an abstract framework class.
Run 3
The code is highly readable. It starts with a clear license and package/import statements. The class declaration and Javadoc comments clearly state the purpose. Structure is logical, using blank lines and concise method declarations. Nesting is minimal, with no deeply nested logic. Each abstract method is documented with a clear purpose and the class maintains one action per line. The overall length is appropriate, avoiding unnecessary verbosity, and reading flow follows a natural order from initialization to utility methods.
Run 1
Code Structure: A well-organized abstract class separates initialization, material queries, mapping operations, and editing support. Nesting: Minimal nesting; concrete methods contain only simple assignments or returns. Clarity of intent: Descriptive method names and documentation clearly explain responsibilities, although the static getName() documentation misleadingly suggests overriding, and parameters such as t lack explanation. Code length: Implementation is concise, though extensive comments and blank lines add some reading overhead. Action granularity: Each statement performs a single action on its own line. Reading flow: Consistent formatting and method-level documentation make the class easy to scan; wildcard imports slightly obscure dependencies.
Run 2
Code Structure: The abstract class is logically organized around mapping state, material queries, duplication, serialization, and editing. Nesting: Methods are flat, with no nested control flow. Clarity of intent: Descriptive method names and extensive documentation make the API easy to understand; however, the comment about overriding static getName() is misleading, and parameters such as t are unexplained. Code length: Implementations are concise, though generous spacing and some lengthy comments slightly slow scanning. Action granularity: Each statement performs one clear action, and simple delegation methods are straightforward. Reading flow: Consistent formatting and method-level documentation support natural reading, although related methods could be grouped more explicitly and wildcard imports obscure dependencies.
Run 3
Code Structure: The abstract class cleanly groups mapping state, material accessors, and subclass contracts, though method ordering could be more cohesive. Nesting: Methods are flat and trivial, with no complex control flow. Clarity of intent: Descriptive names and documentation make the purpose clear; however, the instruction to override static getName() is misleading because static methods are hidden rather than overridden, and parameter t is undocumented. Code length: Implementation is concise, although extensive comments and blank lines add some bulk. Action granularity: Each statement occupies its own line, and concrete methods perform a single clear action. Reading flow: Consistent formatting and method-level documentation support easy scanning, with minor interruptions from lengthy constructor documentation and wildcard imports.