Sample

JetBrains/e20

Human rating uses the original dataset scale.

DatasetJetBrains
Human0.48
Lines27

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
20.3Δ 5.1
Scalabrino0.2010–1; higher is more readable
5.1Δ 10.2
Dorn0.4540–1; higher is more readable
35.6Δ 20.3
Mi0.6060–1; higher is more readable
74.6Δ 59.3
LLOC24Logical lines; fewer is more readable
11.4Δ 3.8
DeepSeek V4 Pro11.670–20; mean of three runs
13.6Δ 1.7
GPT-6.1 Sol160–20; mean of three runs
26.7Δ 11.4
BTTF0.3850–1; higher is more readable
26.3Δ 11.0
Human0.480–1; original rating
15.3

Views

Source code

public class DiamondRange { public static void main(String[] args) { int range = 9; int space = range - 1; for (int i = 1; i <= range; i++) { for (int j = 1; j <= space; j++) { System.out.print(" "); } space--; for (int j = 1; j <= 2 * i - 1; j++) { System.out.print(j); } System.out.println(); } space = 1; for (int i = 1; i <= range - 1; i++) { for (int j = 1; j <= space; j++) { System.out.print(" "); } space++; for (int j = 1; j <= 2 * (range - i) - 1; j++) { System.out.print(j); } System.out.println(); } } }

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.1039.155−34.292
Source linesThe number of non-empty source lines.27+10.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.3.553−5.329

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

Score0.201

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.61+1.082
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.1+1.001
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
Indentation frequencyHow rapidly indentation changes from line to line.1−0.703
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.156−0.574
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.27−0.199
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.25.113−0.059

Intercept 0.07 + feature contributions = -0.186 (log-odds).
Score = sigmoid(-0.186) = 0.454.

Score0.606
Score24
Run 1

The code has a clear overall structure, with two separate loops for the top and bottom halves of the diamond. Nesting is only two levels deep, which is acceptable. However, clarity of intent is weak: the variables 'range' and 'space' are vague, and the absence of comments or helper methods makes the diamond-building logic somewhat opaque. Code length is moderate, but much of it is repetitive—the top and bottom loops are nearly identical. Action granularity is good, with one action per line. Reading flow is mostly linear and natural, though the abrupt switch from decrementing to incrementing 'space' between loops is a minor disorientation. Overall, it is readable but could be significantly improved with named constants, a helper method to print each row, or a comment explaining the loop control formulas.

Run 2

The code has a clear overall structure, with two main loops for the top and bottom halves of the diamond, and it avoids deep nesting. Each loop body is simple and each action is mostly on its own line. However, clarity of intent suffers: there are no comments or helper methods explaining the mathematical relationships (spaces, character counts), and the variable name 'range' is not descriptive. The logic for printing sequential numbers is embedded in loop conditions, making it harder to grasp at a glance. The second loop duplicates the first with slight variations, which is less readable than a single parameterized method. Overall, the code is functional and not tangled, but it lacks self-explanatory naming and modularization, so it is moderately readable but not highly so.

Run 3

The code is relatively flat with simple loops, and the intent to print a diamond shape is somewhat recognizable. However, it lacks meaningful variable names (range, space, i, j), uses magic numbers (2 * i - 1, 2 * (range - i) - 1), and mixes row/column logic with print statements directly in the main method. The two halves of the diamond are duplicated with slightly different formulas, increasing cognitive load. Action granularity is acceptable, but clarity suffers from unexplained arithmetic and inconsistent spacing logic. Overall, it is understandable to a Java beginner but not highly readable or maintainable.

Run 1

Code Structure: Clearly separates the expanding and contracting halves of the diamond, though their similar logic is duplicated. Nesting: Two levels of loops within main are modest and easy to follow. Clarity of intent: The class name and printing operations suggest a diamond pattern, but range and space could have more descriptive names, and the width formulas require interpretation. Code length: Short and mostly concise; a helper method could reduce repetition but is not essential. Action granularity: Each statement performs one action, with clear separation between spacing, number printing, and line breaks. Reading flow: Consistent indentation and sequential execution support natural reading, although blank lines between the two halves would improve visual organization.

Run 2

Code Structure: Clearly separates the expanding and contracting halves of the diamond, though their similar logic is duplicated. Nesting: Inner loops sit within outer loops, keeping nesting moderate and easy to follow. Clarity of intent: The class name and printing operations suggest a diamond pattern, but names such as range and space could be more descriptive, and row-width formulas require interpretation. Code length: Short and mostly concise, with some repetitive printing logic. Action granularity: Each statement performs one straightforward action, with no compressed multi-action lines. Reading flow: Execution proceeds naturally from the upper half to the lower half, with consistent indentation; blank lines or brief comments separating the phases would improve scanning.

Run 3

Code Structure: The upper and lower halves of the diamond are logically separated, though their similar logic is duplicated. Nesting: Two levels of loops are manageable and appropriate for row-based output. Clarity of intent: The class name and printing operations suggest a diamond pattern, but generic loop variables and unexplained width formulas require some interpretation. Code length: The implementation is reasonably concise, although a helper method could reduce repetition. Action granularity: Each statement performs one clear action, with no crowded lines. Reading flow: Consistent indentation and sequential row construction make execution easy to follow; brief comments distinguishing the two halves would improve scanning.