Sample
Schnappinger/aoi/artofillusion.math.Cells
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 17.4Δ 4.5 |
| Scalabrino | 0.814 | 0–1; higher is more readable | 66.4Δ 53.6 |
| Dorn | 0.051 | 0–1; higher is more readable | 28.7Δ 15.8 |
| Mi | 0.598 | 0–1; higher is more readable | 62.0Δ 49.2 |
| LLOC | 144 | Logical lines; fewer is more readable | 18.2Δ 5.3 |
| DeepSeek V4 Pro | 14 | 0–20; mean of three runs | 29.9Δ 17.0 |
| GPT-6.1 Sol | 13 | 0–20; mean of three runs | 9.4Δ 3.5 |
| BTTF | 0.143 | 0–1; higher is more readable | 5.9Δ 6.9 |
| Human | 2.42 | 1–4; original rating | 12.9 |
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. | 12120.465 | −399.975 |
| Source linesThe number of non-empty source lines. | 267 | +106.8 |
| 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.631 | −6.947 |
Intercept 8.87 + feature contributions = -291.252 (log-odds).
Score = sigmoid(-291.252) = 0.
| Score | 0.814 |
|---|
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. | 268 | −8.453 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 236 | +7.426 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 236 | −4.995 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 266.855 | +3.32 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 108.966 | +0.954 |
| 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. | 108.974 | −0.951 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.128 | −0.304 |
Intercept 0.07 + feature contributions = -2.932 (log-odds).
Score = sigmoid(-2.932) = 0.051.
| Score | 0.598 |
|---|
| Score | 144 |
|---|
Run 1
The code demonstrates good overall structure with logical organization into methods, clear class-level constants, and descriptive naming. The main algorithm flows naturally from local to surrounding cell processing. However, several areas reduce readability: the calcFunctions method is long and contains multiple responsibilities; the sortIntoList method has deeply nested conditionals (especially for gradient calculation); and some complex expressions like the CHESS_BOARD metric logic are dense. While variable names are generally clear, the cellIndex array initialization is visually cluttered. The code benefits from good comments explaining the algorithm and static probability initialization, but the core distance/sorting logic could use further decomposition. Nesting depth in the gradient calculation reaches four levels, making intent harder to follow. Overall, readable but with room for refactoring the most complex sections.
Run 2
The code demonstrates good structure with clear method separation and documentation. The main algorithm is relatively flat but suffers from deep nesting in methods like sortIntoList. Variable names are generally clear (e.g., 'dist2', 'feature', 'diff'), and the mathematical intent is documented with references. However, some sections are verbose—particularly the repeated cell-index checking and metric-specific gradient calculations. Action granularity is mostly one action per line, though multiple array operations occur in single lines. The reading flow is logical but occasionally interrupted by long, dense blocks (e.g., the nested ternary expressions). The cellIndex initialization is hard to parse. Overall, it is readable for domain experts but could benefit from extracting some complex conditionals into helper methods or constants.
Run 3
The code has some positive aspects: clear class-level documentation, logical separation of methods, and mostly descriptive variable names. However, several issues reduce readability. The calcFunctions method is quite long and contains deeply nested loops and conditionals (up to 4 levels in some places), violating flat nesting preferences. Intent is somewhat clear from comments, but the core algorithm's flow is complex and hard to follow without domain knowledge. Multiple actions appear on single lines (e.g., 'i--; j--; k--;' on one line, or multiple assignments in one expression). The sortIntoList method contains deeply nested ternary-like logic and multi-branch gradient calculations that are hard to parse quickly. Magic numbers (e.g., 9 in loops, 10 for prob array) appear without named constants. The overall structure is functional, but the dense implementation, mixed granularity, and mathematical complexity push it toward the less readable end of the scale.
Run 1
Code Structure: The class separates initialization, evaluation, distance calculation, and insertion into helper methods, but calcFunctions handles several responsibilities and helpers rely on shared mutable state. Nesting: Most evaluation logic is moderately nested, while sortIntoList has deeply nested gradient-selection branches. Clarity of intent: Strong class documentation and phase comments explain the algorithm, but abbreviated variables, unexplained seed constants, and empty-body loops impede understanding. The dist2 name is misleading for non-Euclidean metrics. Code length: Reasonable for the algorithm, though duplicated feature-generation logic and gradient branches could be extracted or simplified. Action granularity: Most statements perform one action per line; grouped declarations and dense ternary expressions reduce clarity slightly. Reading flow: Methods and comments provide a logical progression, but inconsistent indentation, omitted braces, implicit dependence on diff, and repeated index manipulation require careful tracking.
Run 2
Code Structure: The class is logically organized into initialization, public methods, and focused helpers, but calcFunctions combines several responsibilities and relies on mutable shared state. Nesting: Most traversal is moderate, but sortIntoList has deeply nested loops and metric-dependent conditionals. Clarity of intent: Class documentation and phase comments explain the algorithm well; terse variable names, unexplained constants, empty-body loops, and implicit use of diff obscure implementation details. Code length: Reasonable for the algorithm, though repeated feature-generation logic and verbose gradient selection could be extracted into helpers. Action granularity: Statements generally perform one action per line, but grouped declarations and dense ternary expressions reduce scanability. Reading flow: Processing follows a natural sequence from cell setup through neighbor search to gradient normalization, but inconsistent indentation, omitted braces, and tightly spaced arithmetic interrupt the flow.
Run 3
Code Structure: A cohesive class with useful helper methods, but feature generation is duplicated and gradient calculation is embedded in list insertion. Nesting: Most methods are manageable, while sortIntoList contains deeply nested loops and metric-dependent branches. Clarity of intent: Class documentation, method comments, and named metric constants explain the algorithm well; terse variables, magic numbers, implicit shared state, and empty-body loops obscure details. Code length: Reasonable for the algorithm, but repeated cell-processing logic and verbose gradient branching could be extracted or simplified. Action granularity: Statements generally perform one action per line, although grouped declarations and dense ternary expressions reduce clarity. Reading flow: Processing proceeds logically from initialization through local and neighboring cells to normalization, supported by section comments; inconsistent spacing, omitted braces, and dense numeric tables interrupt readability.