Sample

Schnappinger/aoi/artofillusion.material.Material3D

Human rating uses the original dataset scale.

Human3.96
Lines31

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett0.8990–1; higher is more readable
87.3Δ 10.2
Scalabrino0.9050–1; higher is more readable
90.1Δ 13.0
Dorn0.5910–1; higher is more readable
67.7Δ 9.4
Mi0.5680–1; higher is more readable
50.2Δ 26.9
LLOC3Logical lines; fewer is more readable
91.1Δ 14.0
DeepSeek V4 Pro180–20; mean of three runs
91.4Δ 14.4
GPT-6.1 Sol18.330–20; mean of three runs
85.3Δ 8.3
BTTF0.6430–1; higher is more readable
65.3Δ 11.7
Human3.961–4; original rating
77.1

Views

Source code

/* Copyright (C) 2000 by Peter Eastman This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ package artofillusion.material; import artofillusion.object.*; /** Material3D represents a Material whose properties are defined in 3D. */ public abstract class Material3D extends Material { /** Get the properties at point (x, y, z) at time t. More precisely, the properties returned should represent an average over a region of width (xsize, ysize, zsize), which is centered at (x, y, z). */ public abstract void getMaterialSpec(MaterialSpec spec, double x, double y, double z, double xsize, double ysize, double zsize, double t); /** The default mapping is a LinearMaterialMapping. */ public MaterialMapping getDefaultMapping(Object3D obj) { return new LinearMaterialMapping(obj, this); } }

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(log-odds)
Source linesThe number of non-empty source lines.31+12.4
Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones.359.407−11.86
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.813−7.219

Intercept 8.87 + feature contributions = 2.19 (log-odds).
Score = sigmoid(2.19) = 0.899.

Score0.905

Feature contributions

FeatureValueContribution
(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.140−2.265
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.139.968+1.454
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.021+0.739
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.30−0.026
Indentation frequencyHow rapidly indentation changes from line to line.21−0.011
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.29.837+0.007

Intercept 0.07 + feature contributions = 0.367 (log-odds).
Score = sigmoid(0.367) = 0.591.

Score0.568
Score3
Run 1

The code is highly readable: it has a clear single responsibility (defining a 3D material interface), flat structure with no nesting, and concise but complete Javadoc comments. Class and method names are expressive ('Material3D', 'getMaterialSpec', 'getDefaultMapping'), and each statement or declaration is on its own line. The abstract method signature, though long, is documented clearly and follows a logical parameter order. The default mapping method is trivial and self-explanatory. Minor deductions: the abstract method has many parameters (potential readability burden for callers), and the class could include an example or usage note, but this does not significantly hurt clarity.

Run 2

The code is highly readable with clear structure: license header, package declaration, imports, class definition, and methods are logically organized. Nesting is minimal—only one method override exists with a single return statement. Intent is clearly conveyed through descriptive Javadoc comments explaining the abstract method's purpose and the default mapping behavior. Code length is concise and appropriate for the functionality. Action granularity is good, with one primary action per line. Reading flow is natural, following standard Java conventions. Minor deductions: the abstract method has seven parameters which could be encapsulated, and the class documentation could be slightly more descriptive, but these are negligible issues.

Run 3

The code is highly readable. It has a clear, logical structure with a single abstract class containing one abstract method and one concrete method. Nesting is minimal—only one class-level block and no conditional or loop nesting. Intent is explicit through descriptive naming and concise Javadoc comments that explain both the purpose of the class and the semantics of the method parameters. Code length is appropriate: there is no redundancy or unnecessary boilerplate. Each line performs one clear action, and the reading flow is natural, moving from package declaration to class definition, then method declarations in logical order. The only minor improvements could be formatting the parameter list of getMaterialSpec for vertical alignment, but this does not meaningfully impact readability.

Run 1

Code Structure: The small abstract class is logically organized, with documentation followed by two related methods. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: Class and method comments clearly explain the material's purpose, spatial averaging, and default mapping; descriptive names reinforce intent. Code length: Concise implementation with no unnecessary logic, though the abstract method signature is long. Action granularity: Each declaration or statement performs a single action. Reading flow: The sequence from class purpose to material specification and default mapping is natural. Wrapping the long signature and documenting the output parameter and time argument would slightly improve readability.

Run 2

Code Structure: A small, logically organized abstract class separates the material-specification contract from the default mapping implementation. Nesting: Minimal; the only implemented method contains a single return statement. Clarity of intent: Descriptive class and method names plus documentation clearly explain the purpose and spatial averaging behavior, although the output parameter spec is not explicitly documented. Code length: Concise, with no unnecessary implementation; the license header is standard boilerplate. Action granularity: Each statement performs one action, though the long abstract method declaration packs many parameters onto one line. Reading flow: Natural progression from class documentation to abstract contract to default implementation. Wildcard imports and the dense parameter list slightly reduce readability.

Run 3

Code Structure: A well-organized abstract class with two clearly separated methods. Nesting: Minimal, with no nested control flow. Clarity of intent: Class and method documentation clearly explain the material abstraction, spatial averaging, and default mapping; the many positional double parameters slightly reduce immediate clarity. Code length: Concise implementation with no unnecessary logic; the lengthy license header is standard boilerplate. Action granularity: The concrete method performs a single action per line, and the abstract declaration is straightforward. Reading flow: Natural progression from package and imports to class documentation and methods, though the long getMaterialSpec declaration and wildcard import modestly impair readability.