Sample

JetBrains/e35

Human rating uses the original dataset scale.

DatasetJetBrains
Human0.74
Lines24

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
19.5Δ 33.1
Scalabrino0.4710–1; higher is more readable
30.5Δ 22.0
Dorn0.1690–1; higher is more readable
11.9Δ 40.7
Mi0.3430–1; higher is more readable
29.7Δ 22.9
LLOC17Logical lines; fewer is more readable
34.3Δ 18.2
DeepSeek V4 Pro170–20; mean of three runs
69.9Δ 17.4
GPT-6.1 Sol180–20; mean of three runs
77.5Δ 25.0
BTTF0.4920–1; higher is more readable
65.3Δ 12.7
Human0.740–1; original rating
52.5

Views

Source code

public class PascalTriangle { public static void main(String[] args) { int numRows = 20; int[][] triangle = new int[numRows][]; for (int i = 0; i < numRows; i++) { triangle[i] = new int[i + 1]; triangle[i][0] = 1; for (int j = 1; j < i; j++) { triangle[i][j] = triangle[i-1][j-1] + triangle[i-1][j]; } triangle[i][i] = 1; } for (int i = 0; i < numRows; i++) { for (int j = 0; j < triangle[i].length; j++) { System.out.print(triangle[i][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.1010.634−33.351
Source linesThe number of non-empty source lines.24+9.6
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.571−5.357

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

Score0.471

Feature contributions

FeatureValueContribution
(log-odds)
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.16−0.608
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.75+0.489
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.24+0.187
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.24−0.13
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.22.618−0.094

Intercept 0.07 + feature contributions = -1.593 (log-odds).
Score = sigmoid(-1.593) = 0.169.

Score0.343
Score17
Run 1

The code has a clear, logical structure: generation and printing are separated. Nesting is limited to two levels in the main loops, which is reasonable for a 2D problem. Variable names like numRows, triangle, i, and j clearly convey intent. The code is concise without sacrificing clarity. Each loop body performs a single logical action, though the boundary assignments (triangle[i][0] and triangle[i][i]) are slightly implicit. Reading flow is natural — top-to-bottom, from initialization to output. Minor deductions: lack of comments explaining the Pascal recurrence and no handling for numRows = 0.

Run 2

The code is well-structured, with clear separation between triangle construction and printing. Nesting is minimal—only two levels deep—and each loop has a single, obvious purpose. Intent is straightforward: generate and display Pascal's triangle. The code is concise, avoiding unnecessary variables or comments while remaining self-explanatory. Each line performs one action, enhancing readability. The reading flow is natural, progressing from initialization to generation to output. Minor deductions: the hardcoded number of rows (20) slightly reduces flexibility, and the absence of a brief explanatory comment on the algorithm may require a moment of thought for unfamiliar readers. Overall, highly readable.

Run 3

The code is clean and logical, with good structure separating generation and printing. Nesting is minimal (two loops, one nested). The intent is clear: build Pascal's triangle using summation of previous row elements and print it. Code length is reasonable and not verbose. Each line performs a single action, improving readability. The main possible improvement is the absence of explanatory comments, though the algorithm is simple enough to infer. Naming is clear and consistent.

Run 1

Code Structure: Logically separates triangle construction from output, though helper methods could make that separation clearer. Nesting: Two straightforward nested-loop sections; depth is modest and appropriate. Clarity of intent: The class name, numRows, and triangle clearly communicate the purpose; conventional i and j indices are easy to follow. Code length: Concise, with no unnecessary logic; setting both endpoints repeats an assignment in the first row but keeps the general pattern simple. Action granularity: Each statement performs one clear action. Reading flow: Initialization, construction, and printing follow a natural sequence, supported by whitespace. Minor readability improvements include consistent spacing around subtraction operators and extracting construction and printing into named methods.

Run 2

Code Structure: Logically separates triangle construction from output, though helper methods could make this separation clearer. Nesting: Two-level loops are shallow and appropriate for the problem. Clarity of intent: The class name, numRows, and triangle clearly communicate the purpose; conventional i and j indices are easy to follow. Code length: Concise, with no unnecessary logic. Action granularity: Each statement performs a single action, and loop headers use standard conventions. Reading flow: Initialization, row construction, and printing follow a natural sequence, aided by blank lines. Minor readability improvements include consistent spacing around subtraction operators and extracting construction and printing into named methods.

Run 3

Code Structure: Generation and printing are clearly separated into sequential loops, though helper methods could make that separation explicit. Nesting: Two-level loops are shallow and appropriate for a triangular array. Clarity of intent: The class name, numRows, and triangle clearly convey the purpose; conventional i and j indices are understandable. Code length: Concise, with no unnecessary logic. Action granularity: Each statement performs a single clear action; loop headers use standard conventions. Reading flow: Initialization, row construction, and output follow a natural order, aided by blank lines. Minor improvements include consistent spacing around subtraction operators and extracting generation and printing into named methods.