Sample

Schnappinger/aoi/artofillusion.object.MeshVertex

Human rating uses the original dataset scale.

Human3.02
Lines60

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
57.5Δ 26.5
Scalabrino0.7720–1; higher is more readable
55.8Δ 24.8
Dorn0.5730–1; higher is more readable
65.0Δ 34.0
Mi0.7380–1; higher is more readable
89.4Δ 58.4
LLOC22Logical lines; fewer is more readable
57.1Δ 26.1
DeepSeek V4 Pro16.670–20; mean of three runs
59.9Δ 28.9
GPT-6.1 Sol170–20; mean of three runs
55.3Δ 24.3
BTTF0.410–1; higher is more readable
35.3Δ 4.3
Human3.021–4; original rating
31.0

Views

Source code

/* Copyright (C) 1999-2004 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.object; import artofillusion.math.*; /** MeshVertex represents a vertex in a mesh object. */ public class MeshVertex { public Vec3 r; public int ikJoint; public double ikWeight; public MeshVertex(Vec3 p) { r = p; ikJoint = -1; ikWeight = 1.0; } public MeshVertex(MeshVertex v) { r = new Vec3(v.r); ikJoint = v.ikJoint; ikWeight = v.ikWeight; } /** Create a new MeshVertex which is a weighted average of two other ones. */ public static MeshVertex blend(MeshVertex v1, MeshVertex v2, double w1, double w2) { MeshVertex v = new MeshVertex (new Vec3(w1*v1.r.x + w2*v2.r.x, w1*v1.r.y + w2*v2.r.y, w1*v1.r.z + w2*v2.r.z)); if (v1.ikJoint == v2.ikJoint) { v.ikJoint = v1.ikJoint; v.ikWeight = (w1*v1.ikWeight + w2*v2.ikWeight); } else if (v2.ikWeight > v1.ikWeight) { v.ikJoint = v2.ikJoint; v.ikWeight = v2.ikWeight; } else { v.ikJoint = v1.ikJoint; v.ikWeight = v1.ikWeight; } return v; } }

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(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.1348.48−44.5
Source linesThe number of non-empty source lines.60+24
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.859−7.288

Intercept 8.87 + feature contributions = -18.918 (log-odds).
Score = sigmoid(-18.918) = 0.

Score0.772

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.60−1.088
Indentation frequencyHow rapidly indentation changes from line to line.52+1.061
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.52−0.772
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.58.897+0.413
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.74.633+0.4
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.078+0.185
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.86+0.023

Intercept 0.07 + feature contributions = 0.292 (log-odds).
Score = sigmoid(0.292) = 0.573.

Score0.738
Score22
Run 1

The code is highly readable with a clear class structure, minimal nesting, and well-defined methods. It follows a logical flow: fields, constructors, then a static utility method. The Javadoc comment explains the 'blend' method's purpose, and method names are intuitive. Field names like 'r' and 'ikJoint' are short but acceptable for mesh math and IK contexts. The 'blend' method uses a slightly unusual brace style but maintains consistent indentation. One line in the 'blend' method combines multiple vector operations, slightly reducing action granularity, but overall concision is good. The copyright header adds some length but is not part of the core logic.

Run 2

The code is highly readable. It has a clear, simple structure with a logical class layout: fields, constructors, then a static utility method. Nesting is minimal — the blend method uses three flat conditional branches rather than deep nesting. Intent is evident from the class and method descriptions, and Javadoc comments add minimal but useful context. Variable names like 'r', 'ikJoint', and 'ikWeight' are concise, though 'r' could be more descriptive. Code length is appropriate for a small data class. Action granularity is good, with most lines performing one operation, aside from a slightly long vector construction expression in blend. Reading flow is natural and straightforward. Minor deductions for less explicit variable naming and the slightly compressed vector averaging line, but overall the code is clean and easy to follow.

Run 3

The code is generally clean and well-structured. It uses clear field names and constructor overloading, and the intent of the blend method is documented. However, readability is slightly reduced by inconsistent formatting: the blend method uses an unusual brace style (opening brace on its own line, indented), and the constructor call inside blend splits arguments awkwardly across lines with a tab, making the expression harder to scan. The if-else chain uses a nested block style that increases vertical length but is not deeply nested. The method is concise and mostly one action per line, but the blend weight calculation contains multiple operations on one line. Overall, the code is understandable but would benefit from formatting cleanup and slightly cleaner argument layout.

Run 1

Code Structure: The small class is logically organized into fields, constructors, and a blending method. Nesting: A single, shallow if/else chain is easy to follow. Clarity of intent: The class and method comments explain their purpose, but abbreviated names such as r, p, and v and undocumented inverse-kinematics fields reduce clarity. Code length: The implementation is concise, with little unnecessary code. Action granularity: Assignments generally perform one action per line, although the vector construction packs several coordinate calculations together. Reading flow: Initialization, blending, joint selection, and return follow a natural sequence. Inconsistent indentation, sparse operator spacing, and unusual brace alignment slightly disrupt readability.

Run 2

Code Structure: A small, logically organized class separates initialization, copying, and blending. Nesting: The blend method uses a shallow, straightforward conditional chain. Clarity of intent: Class and method comments establish purpose, though abbreviated names such as r, v, and ikJoint require domain knowledge, and the joint-selection rule is unexplained. Code length: Concise, with little unnecessary code; the license header adds length without complicating implementation. Action granularity: Assignments generally perform one action per line, although vector construction combines several arithmetic expressions. Reading flow: Constructors followed by blending create a natural progression, but inconsistent indentation, brace placement, and dense arithmetic slightly interrupt readability.

Run 3

Code Structure: The class is logically organized into fields, constructors, and a blending method. Nesting: A single if/else chain keeps nesting shallow and easy to follow. Clarity of intent: The class and method comments explain their purposes, but abbreviated names such as r, p, and v and undocumented inverse-kinematics fields reduce clarity. The joint-selection rule is understandable but lacks an explanation. Code length: The implementation is concise without unnecessary abstraction or repetition. Action granularity: Each statement performs one clear action, although the inline vector calculation is somewhat dense. Reading flow: Constructors establish defaults and copying behavior before the blend operation; inconsistent indentation and spacing slightly interrupt otherwise natural flow.