Sample

JetBrains/e17

Human rating uses the original dataset scale.

DatasetJetBrains
Human0.73
Lines17

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
27.1Δ 22.9
Scalabrino0.2310–1; higher is more readable
10.2Δ 39.8
Dorn0.1470–1; higher is more readable
10.2Δ 39.8
Mi0.0490–1; higher is more readable
7.6Δ 42.4
LLOC12Logical lines; fewer is more readable
56.8Δ 6.8
DeepSeek V4 Pro13.330–20; mean of three runs
28.0Δ 22.0
GPT-6.1 Sol170–20; mean of three runs
46.2Δ 3.8
BTTF0.470–1; higher is more readable
53.4Δ 3.4
Human0.730–1; original rating
50.0

Views

Source code

import java.math.BigDecimal; public class CatalanConstant { public static void main(String[] args) { BigDecimal sum = new BigDecimal(0); BigDecimal term; int sign; for (int k = 0; k < 1000; k++) { sign = (k % 2 == 0) ? 1 : -1; term = BigDecimal.ONE.divide(new BigDecimal(2*k + 1).pow(2), 1000, BigDecimal.ROUND_HALF_UP); term = term.multiply(new BigDecimal(sign)); sum = sum.add(term); } sum = sum.multiply(new BigDecimal(4)); System.out.println(sum); } }

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.820.863−27.088
Source linesThe number of non-empty source lines.17+6.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.396−6.594

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

Score0.231

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.105.941−0.822
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.17+0.434
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.131−0.331
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.15.71−0.19
Indentation frequencyHow rapidly indentation changes from line to line.17−0.149
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.17+0.031

Intercept 0.07 + feature contributions = -1.761 (log-odds).
Score = sigmoid(-1.761) = 0.147.

Score0.049
Score12
Run 1

The code is logically structured and generally easy to follow. The main loop computes terms of an alternating series for Catalan's constant, with clear variable names and a reasonable separation of concerns. However, readability is hurt by several issues: the loop body performs multiple operations (sign computation, term calculation, sign application, accumulation) in a dense block; the mathematical formula is not explained; and the magic numbers (1000, 2, 4) lack context. Nesting is flat, which is good, but the code's intent—computing Catalan's constant via series—is not immediately obvious without domain knowledge. The mathematical expression on one line makes the action granularity slightly poor. Overall, it's competent but could benefit from comments, constants, and clearer separation of computation vs aggregation.

Run 2

The code is reasonably readable: it has a clear single-purpose main method, adequate variable names, and straightforward logic. The loop structure is flat and easy to follow. However, it lacks comments or a constant for the number of iterations, and the mathematical intent (computing Catalan's constant via a series) is not explained. Magic numbers like 1000 (both loop limit and scale) appear without context. Multiple operations are packed into the term assignment lines, reducing clarity slightly. Formatting is consistent but the logic could be more modular or documented.

Run 3

The code has a clear purpose: computing Catalan's constant via series approximation. It uses meaningful variable names and follows a straightforward loop structure. However, several issues reduce readability. The absence of a method to compute the constant and the use of magic numbers (1000 for loop limit and scale) make the intent less clear. The logic of alternating sign and term computation is compressed into multiple operations on a single line, reducing action granularity. The loop body mixes sign calculation, term calculation, and accumulation, which hurts reading flow. The code is relatively concise, but it lacks explanatory comments or a clear separation of concerns. The nesting is flat, which is positive, but clarity is diminished by the inline arithmetic and hard-coded literals. Overall, it is understandable but would benefit from better structure, such as a dedicated method, named constants, and comments explaining the formula.

Run 1

Code Structure: A straightforward main method logically groups initialization, iteration, and output. Nesting: Only one loop, keeping nesting shallow. Clarity of intent: Variable names and the class name suggest a Catalan constant calculation, but unexplained values (1000 and 4) obscure intent; multiplying the series by 4 also conflicts with the named constant. Code length: Compact without substantial unnecessary code. Action granularity: Each statement performs a clear step, although the divide expression combines several operations and is relatively long. Reading flow: Execution proceeds naturally from setup through accumulation to printing. Consistent operator spacing, named constants, and a brief formula comment would improve readability.

Run 2

Code Structure: A straightforward main method organizes initialization, summation, and output logically. Nesting: Only one loop, making control flow easy to follow. Clarity of intent: Names such as sum, term, and sign explain their roles, but unexplained constants (1000 and 4) obscure numerical choices. Multiplying the series by 4 also conflicts with the class name, since the series itself represents Catalan's constant. Code length: Compact without substantial redundancy, although declaring term and sign inside the loop would improve locality. Action granularity: Each statement performs one principal action; the division expression combines several operations but remains understandable. Reading flow: Execution proceeds naturally from setup through calculation to printing. Inconsistent operator spacing and the long division line slightly reduce readability.

Run 3

Code Structure: The calculation is logically organized within a short main method. Nesting: A single loop keeps nesting shallow. Clarity of intent: The class name and sum, term, and sign variables communicate the intended series calculation, but the unexplained iteration count, precision, and final multiplication by 4 obscure the exact purpose; that multiplication also conflicts with computing Catalan's constant directly. Code length: Concise, without unnecessary scaffolding. Action granularity: Most lines perform one action, although the denominator construction, exponentiation, and division share a dense expression. Reading flow: Initialization, term generation, accumulation, and output follow a natural sequence. Consistent spacing around arithmetic operators, named constants, and a brief formula comment would improve readability.