Sample
JetBrains/e58
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0.001 | 0–1; higher is more readable | 70.3Δ 25.8 |
| Scalabrino | 0.924 | 0–1; higher is more readable | 92.4Δ 47.9 |
| Dorn | 0.53 | 0–1; higher is more readable | 51.7Δ 7.2 |
| Mi | 0.727 | 0–1; higher is more readable | 98.3Δ 53.8 |
| LLOC | 10 | Logical lines; fewer is more readable | 72.9Δ 28.4 |
| DeepSeek V4 Pro | 17.67 | 0–20; mean of three runs | 88.6Δ 44.1 |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs | 46.2Δ 1.7 |
| BTTF | 0.304 | 0–1; higher is more readable | 9.3Δ 35.2 |
| Human | 0.71 | 0–1; original rating | 44.5 |
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. | 506.653 | −16.72 |
| Source linesThe number of non-empty source lines. | 15 | +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.72 | −5.58 |
Intercept 8.87 + feature contributions = -7.429 (log-odds).
Score = sigmoid(-7.429) = 0.001.
| Score | 0.924 |
|---|
Feature contributions
| Feature | Value | Contribution (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. | 47 | +1.675 |
| 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 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 15 | +0.505 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.149 | −0.504 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 13.792 | −0.217 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 14 | +0.1 |
Intercept 0.07 + feature contributions = 0.121 (log-odds).
Score = sigmoid(0.121) = 0.53.
| Score | 0.727 |
|---|
| Score | 10 |
|---|
Run 1
The code is highly readable due to its clear structure, concise implementation, and straightforward logic. It computes Catalan numbers iteratively with one action per line and a flat control flow. Variable names like 'res' and 'n' are slightly abbreviated but acceptable. The main loop prints results sequentially, and the method is self-contained with minimal nesting. The only minor issue is the lack of comments explaining the formula, but the mathematical intent is clear from context.
Run 2
The code is well-structured with clear separation of concerns: a main method for output and a dedicated catalan method. Nesting is minimal and depth is flat. Intent is clear from method and variable names. Logic is concise. However, with n up to 99, the method uses long, which will overflow for large n — a potential correctness issue, though not readability. The `(long) n + i` cast is slightly awkward; casting n before the loop would improve clarity. The computation formula is mathematically compact but may not be immediately obvious to all readers. Adding a brief comment explaining the recurrence would improve clarity. Overall, the code is highly readable due to its short length, straightforward flow, and single-purpose methods.
Run 3
The code is well-structured and concise. It cleanly separates the main loop from the Catalan calculation method. The `catalan` function uses a simple iterative formula with clear variable names (`n`, `res`, `i`), maintaining a flat nesting level and one core action per line. The cast to `long` is explicit and prevents integer overflow. The reading flow is natural: main iterates, prints, and calls a self-contained helper. Overall, it is highly readable for a small algorithm implementation.
Run 1
Code Structure: Clearly separates output in main from calculation in catalan. Nesting: Shallow, with one loop per method and no nested conditionals. Clarity of intent: Class and method names communicate the purpose, although res is generic and the mathematical formula lacks explanation. Code length: Compact without unnecessary boilerplate beyond standard Java structure. Action granularity: Each statement performs one primary action; the arithmetic update is short enough to follow. Reading flow: Natural progression from iteration to calculation to return, supported by consistent formatting. However, integer division within the multiplication makes the intended formula harder to verify and produces incorrect values for some inputs; long overflow also limits the displayed range. These are primarily correctness issues, but they weaken confidence that the implementation expresses its stated intent.
Run 2
Code Structure: The class cleanly separates output in main from calculation in catalan. Nesting: Both methods use shallow, straightforward loops. Clarity of intent: Class and method names clearly identify the intended calculation, though res is generic and the mathematical expression lacks explanation. Integer division and possible overflow also make the calculation's behavior less obvious. Code length: The implementation is concise without unnecessary statements. Action granularity: Each line performs one primary action, although the compound arithmetic assignment takes some effort to interpret. Reading flow: Consistent formatting and a natural progression from initialization through iteration to return make the code easy to follow.
Run 3
Code Structure: Clearly separates output generation from the calculation method. Nesting: Shallow loops with no complex branching make the code easy to follow. Clarity of intent: Class and method names establish the purpose, but 'res' is generic and the mathematical formula is unexplained; integer truncation and overflow also obscure whether the implementation achieves its intent. Code length: Compact without unnecessary boilerplate beyond Java requirements. Action granularity: Each statement performs one main action, although the compound arithmetic expression requires extra attention. Reading flow: Execution proceeds naturally from main to calculation and return, with consistent formatting.