Sample

JetBrains/b20

Human rating uses the original dataset scale.

DatasetJetBrains
Human0.44
Lines28

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
13.6Δ 0.8
Scalabrino0.3540–1; higher is more readable
16.9Δ 4.2
Dorn0.5730–1; higher is more readable
63.6Δ 50.8
Mi0.6540–1; higher is more readable
89.0Δ 76.3
LLOC25Logical lines; fewer is more readable
8.9Δ 3.8
DeepSeek V4 Pro11.330–20; mean of three runs
11.9Δ 0.8
GPT-6.1 Sol160–20; mean of three runs
26.7Δ 14.0
BTTF0.3260–1; higher is more readable
15.3Δ 2.5
Human0.440–1; original rating
12.7

Views

Source code

public class Diamond { public static void main(String[] args) { for (int i = 1; i <= 9; i++) { for (int j = i; j < 9; j++) { System.out.print(" "); } for (int j = 1; j <= i; j++) { System.out.print(j); } for (int j = i-1; j >= 1; j--) { System.out.print(j); } System.out.println(); } for (int i = 8; i >= 1; i--) { for (int j = 9-i; j > 0; j--) { System.out.print(" "); } for (int j = 1; j <= i; j++) { System.out.print(j); } for (int j = i-1; j >= 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.1151.289−37.993
Source linesThe number of non-empty source lines.28+11.2
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.444−5.167

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

Score0.354

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.46.821+1.682
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.167−0.678
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.28−0.222
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.25.5−0.053

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

Score0.654
Score25
Run 1

The code is relatively concise and follows a clear pattern for printing a diamond shape. However, it suffers from moderate nesting and magic numbers (9 and 8), which obscure intent. The two main loops duplicate logic, increasing length and risk of inconsistency. Variable names like i and j are poor for readability. While action granularity is mostly one action per line, the reading flow is disrupted by nested loops and unclear bounds. Rewriting with a helper method to print each line would improve structure and clarity. Overall, it achieves a straightforward task but lacks clarity of intent and reusable structure, keeping it in the lower-middle range for readability.

Run 2

The code uses logical loops to print a diamond pattern, but lacks explanatory comments, meaningful variable names, or helper methods. Nesting is moderate but repeated loops make the intent harder to grasp. Each line performs one action, but the overall reading flow is disrupted by duplicated logic (two nearly identical halves) and magic numbers. Concise for what it does, but not self-documenting.

Run 3

The code is logically structured into two main loops: one for the top half of the diamond and one for the bottom. Nesting depth is moderate (2–3 levels), which is acceptable but slightly repetitive. Intent is relatively clear—printing a numeric diamond—but the code lacks comments or helper methods to explain the pattern. The variable names (i, j) are conventional for loop counters, but not descriptive. Code length is concise, though the two halves duplicate logic, which could be refactored for clarity. Action granularity is mostly one statement per line, which is good. Reading flow follows the visual shape of the diamond, but the arithmetic in the second loop (9-i) requires mental effort to follow. Overall, readable for an experienced Java programmer, but could be improved with a single loop over row numbers, a helper method, or more descriptive naming.

Run 1

Code Structure: Logically separates the expanding and contracting halves of the diamond, but duplicates row-printing logic. Nesting: Moderate and easy to follow, with inner loops inside each outer loop and no complex branching. Clarity of intent: The class name and symmetric loops suggest a numeric diamond, though hard-coded dimensions and terse loop variables require some interpretation. Code length: Reasonably concise, but a shared row-printing method could reduce repetition. Action granularity: Each print operation occupies its own line; loop headers use conventional syntax. Reading flow: Consistent indentation and sequential spacing, ascending-number, and descending-number loops create a natural flow, although missing spaces around subtraction operators slightly reduce consistency.

Run 2

Code Structure: Two logically ordered sections generate the upper and lower halves, though their repeated logic could be extracted into a helper. Nesting: Only two loop levels, making control flow easy to follow. Clarity of intent: The class name and printing operations suggest a numeric diamond, but single-letter variables and hard-coded bounds require some interpretation. Code length: Compact overall, with moderate duplication between halves. Action granularity: Each print operation occupies its own line, and each loop has a distinct responsibility. Reading flow: Consistent indentation and sequential spacing, ascending digits, descending digits, and newline operations support natural reading; missing spaces around arithmetic operators slightly reduce consistency.

Run 3

Code Structure: The upper and lower halves are logically separated, but duplicate row-printing logic could be extracted into a helper. Nesting: Two levels of loops are manageable and appropriate for the pattern. Clarity of intent: The Diamond class name and symmetric loops suggest the purpose, though generic variable names, unexplained constants, and absent comments require readers to infer details. Code length: Fairly concise, but repeated logic adds avoidable length. Action granularity: Each statement performs a single action, with printing and iteration clearly separated. Reading flow: Consistent indentation and sequential spacing, ascending-number, and descending-number loops make execution easy to follow; minor operator-spacing inconsistencies slightly reduce polish.