Sample
JetBrains/b17
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 32.2Δ 57.2 |
| Scalabrino | 0.507 | 0–1; higher is more readable | 32.2Δ 57.2 |
| Dorn | 0.188 | 0–1; higher is more readable | 13.6Δ 75.8 |
| Mi | 0.142 | 0–1; higher is more readable | 10.2Δ 79.2 |
| LLOC | 12 | Logical lines; fewer is more readable | 56.8Δ 32.6 |
| DeepSeek V4 Pro | 14 | 0–20; mean of three runs | 35.2Δ 54.2 |
| GPT-6.1 Sol | 15.67 | 0–20; mean of three runs | 19.9Δ 69.5 |
| BTTF | 0.47 | 0–1; higher is more readable | 54.2Δ 35.2 |
| Human | 0.94 | 0–1; original rating | 89.4 |
Views
Loading feature diagnosis…
Source regions
Feature contributions
Feature contributions
| Feature | Value | Contribution (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. | 818.359 | −27.006 |
| Source linesThe number of non-empty source lines. | 21 | +8.4 |
| 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.163 | −6.244 |
Intercept 8.87 + feature contributions = -15.98 (log-odds).
Score = sigmoid(-15.98) = 0.
| Score | 0.507 |
|---|
Feature contributions
| Feature | Value | Contribution (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. | 103.81 | −0.732 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 21 | +0.293 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 19.914 | −0.131 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.106 | −0.089 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 21 | −0.061 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 21 | −0.011 |
Intercept 0.07 + feature contributions = -1.465 (log-odds).
Score = sigmoid(-1.465) = 0.188.
| Score | 0.142 |
|---|
| Score | 12 |
|---|
Run 1
The code is reasonably structured but has several readability issues. The main logic for computing Catalan's constant is straightforward, but the alternating sign handling adds unnecessary duplication: the term calculation appears in both branches of the if/else. Magic numbers like 1000 appear twice (loop bound and scale), and the intent behind the loop is not immediately clear. Variable naming is adequate but could be more descriptive (e.g., `scale`, `terms`). The structure is flat, which is good, but the code would benefit from extracting the term calculation and sign logic to reduce redundancy and improve clarity. Overall, it is understandable but not as clean or expressive as it could be.
Run 2
The code has a clear overall purpose and follows a simple, flat structure with no deep nesting. The loop logic is straightforward, and variable names like 'sum' and 'term' are generally clear. However, the code could be more concise: the term computation is duplicated in both branches of the if-else, which makes the logic slightly redundant and less clear. The condition `i % 2 == 0` to determine sign works, but the relationship between sign and the alternating series is implicit. Action granularity is reasonable; each key calculation is on its own line. The reading flow is natural, moving from initialization to looping to output. Overall, readability is good but would improve by extracting the term computation and using a clearer sign-handling approach.
Run 3
The code is generally clear and concise. It has a logical structure with a simple loop and basic operations. Nesting is minimal (one level inside the loop). The intent — approximating Catalan's constant — is deducible from the class name and output. However, readability is weakened by repeated code in both branches of the if-else, which could be reduced to a single term computation with a sign variable. The magic numbers (1000 iterations, 1000 scale) lack named constants, making them ambiguous. Line length is moderate, action granularity is mostly one action per line, and the reading flow is natural. Overall, it's readable but could be improved by eliminating duplication and adding named constants.
Run 1
Code Structure: Clearly organized into initialization, calculation, and output, though term calculation is duplicated across branches. Nesting: Shallow loop and conditional nesting is easy to follow. Clarity of intent: Variable names convey accumulation, but 'power' actually denotes an odd denominator, and the series computes an approximation to pi/4 rather than Catalan's constant, making the class name and output misleading. Code length: Compact overall, with avoidable duplication. Action granularity: Each statement performs a distinct action; long division expressions remain understandable. Reading flow: Execution proceeds naturally from setup to iteration to printing, although unexplained literals such as 1000 and the misleading mathematical labeling reduce clarity.
Run 2
Code Structure: The class, main method, loop, and output are logically organized, although term calculation is duplicated across branches. Nesting: A single conditional inside a loop keeps nesting manageable. Clarity of intent: Variable names and alternating addition/subtraction are understandable, but the code sums reciprocal odd integers rather than their squares, contradicting the stated Catalan's constant purpose. The unexplained values of 1000 for iteration count and decimal scale also obscure intent. Code length: Short overall, but calculating the term once before the conditional would eliminate redundancy. Action granularity: Each statement performs one clear action. Reading flow: Initialization, accumulation, and printing follow a natural sequence, though the misleading label and duplicated expression interrupt comprehension.
Run 3
Code Structure: Imports, class, initialization, computation, and output are logically organized, though the division is duplicated across branches. Nesting: A single loop containing an if/else keeps nesting shallow and manageable. Clarity of intent: Names and output convey the intended computation, but 'power' misleadingly names an odd denominator, and the formula lacks the squared denominator required for Catalan's constant. Code length: Short overall; computing the shared term before the conditional would remove repetition. Action granularity: Each statement performs one clear action. Reading flow: The sequence from setup through accumulation to printing is natural, although duplicated arithmetic and unexplained iteration and precision values slightly impede understanding.