Sample

JetBrains/b58

Human rating uses the original dataset scale.

DatasetJetBrains
Human0.8
Lines19

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
22.9Δ 38.6
Scalabrino0.1460–1; higher is more readable
2.5Δ 58.9
Dorn0.1990–1; higher is more readable
15.3Δ 46.2
Mi0.2580–1; higher is more readable
16.9Δ 44.5
LLOC14Logical lines; fewer is more readable
47.9Δ 13.6
DeepSeek V4 Pro14.330–20; mean of three runs
38.1Δ 23.3
GPT-6.1 Sol170–20; mean of three runs
46.2Δ 15.3
BTTF0.3040–1; higher is more readable
10.2Δ 51.3
Human0.80–1; original rating
61.4

Views

Source code

import java.math.BigInteger; public class CatalanNumber { public static void main(String[] args) { BigInteger binomial = BigInteger.ONE; for (int n = 0; n <= 99; n++) { BigInteger numerator = BigInteger.ONE; for (int i = 2 * n; i > n; i--) { numerator = numerator.multiply(BigInteger.valueOf(i)); } BigInteger denominator = BigInteger.ONE; for (int i = n; i >= 1; i--) { denominator = denominator.multiply(BigInteger.valueOf(i)); } BigInteger catalan = numerator.divide(denominator).divide(BigInteger.valueOf(n + 1)); System.out.println("C(" + n + ") = " + catalan); } } }

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.898.354−29.646
Source linesThe number of non-empty source lines.19+7.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.4.045−6.068

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

Score0.146

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
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.100.895−0.608
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.19+0.364
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.17.745−0.162
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.113−0.157
Indentation frequencyHow rapidly indentation changes from line to line.19−0.08
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.19−0.015

Intercept 0.07 + feature contributions = -1.393 (log-odds).
Score = sigmoid(-1.393) = 0.199.

Score0.258
Score14
Run 1

The code is generally clear and logically organized, with a straightforward main method and separate loops for numerator and denominator calculation. Nesting is moderate (two levels), which is acceptable. Intent is reasonably clear—compute Catalan numbers using a binomial formula—though the formula isn't commented or broken into a helper method. The code is concise but slightly verbose due to repeated loop structures. Action granularity is mostly one action per line. Reading flow is natural: compute numerator, denominator, divide, print. However, the unused variable 'binomial' is confusing, and the lack of a named helper method for the Catalan computation reduces clarity. The variable names are descriptive, but the overall structure could be improved by extracting the calculation into a function.

Run 2

The code is logically structured with clear separation of numerator and denominator calculations, and it is concise for computing Catalan numbers. Nesting is minimal, with only two nested loops and no deep conditional complexity. Intent is reasonably clear, though the formula being used (C(n) = (2n)! / (n! (n+1)!)) could be more explicitly documented. Code length is appropriate. Action granularity is decent, but some compound operations (e.g., chained divides on one line) reduce clarity. Reading flow is mostly natural, but the variable 'binomial' is unused, which is misleading. The main readability drawbacks are the lack of comments or explanation for the mathematical approach, and the unused variable. Overall, the code is fairly readable but could be improved with a brief comment on the formula and removal of dead code.

Run 3

The code is logically organized and easy to follow, but it has several readability issues. The unused variable 'binomial' creates confusion. The Catalan number calculation is split into multiple loops, making the mathematical formula less apparent. Action granularity is mostly one action per line, but variable names are generic. The nested loops are not deeply nested, but reading flow is interrupted by redundant loops for numerator and denominator that could be combined. The intent could be clearer with a helper method for factorial calculations or direct Catalan formula implementation. Overall, the code is readable but unnecessarily verbose.

Run 1

Code Structure: Logically organized into numerator calculation, denominator calculation, Catalan computation, and output, though the unused binomial variable adds clutter. Nesting: The inner loops are only two levels deep and remain easy to follow. Clarity of intent: The class name, variable names, and output clearly indicate Catalan-number generation, but the mathematical formula and fixed upper bound of 99 lack explanation. Code length: Compact and appropriately sized, aside from the unused declaration. Action granularity: Most lines perform one clear action; the chained divisions are a readable exception. Reading flow: Execution proceeds naturally from intermediate calculations to the result and output, with consistent formatting.

Run 2

Code Structure: Logically organized into numerator calculation, denominator calculation, Catalan computation, and output, though everything resides in main. Nesting: Shallow and manageable, with two separate inner loops inside the outer loop. Clarity of intent: The class name, descriptive variables, and output clearly indicate Catalan-number generation; however, the unused binomial variable, unexplained limit of 99, and lack of formula documentation slightly reduce clarity. Code length: Concise without excessive boilerplate, aside from the unused declaration. Action granularity: Each statement performs one clear action; the chained divisions remain understandable. Reading flow: Natural top-to-bottom progression follows the mathematical computation, with consistent formatting and no distracting control flow.

Run 3

Code Structure: Logically organized into numerator calculation, denominator calculation, Catalan calculation, and output, though helper methods could clarify these stages. Nesting: Shallow and manageable, with two sequential inner loops inside the main loop. Clarity of intent: The class name, variable names, and output clearly communicate the purpose; however, the unused binomial variable and unexplained limit of 99 add minor ambiguity. Code length: Concise overall, with little unnecessary code beyond the unused declaration. Action granularity: Most lines perform one clear action; the chained divisions remain understandable. Reading flow: Natural top-to-bottom progression, supported by consistent formatting, although brief comments explaining the mathematical formula would improve accessibility.