Sample
JetBrains/i4
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0.01 | 0–1; higher is more readable | 86.4Δ 50.8 |
| Scalabrino | 0.819 | 0–1; higher is more readable | 77.1Δ 41.5 |
| Dorn | 0.686 | 0–1; higher is more readable | 82.2Δ 46.6 |
| Mi | 0.664 | 0–1; higher is more readable | 89.8Δ 54.2 |
| LLOC | 10 | Logical lines; fewer is more readable | 72.9Δ 37.3 |
| DeepSeek V4 Pro | 17.33 | 0–20; mean of three runs | 78.8Δ 43.2 |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs | 77.5Δ 41.9 |
| BTTF | 0.499 | 0–1; higher is more readable | 68.6Δ 33.1 |
| Human | 0.65 | 0–1; original rating | 35.6 |
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. | 430.33 | −14.201 |
| 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.544 | −5.316 |
Intercept 8.87 + feature contributions = -4.647 (log-odds).
Score = sigmoid(-4.647) = 0.01.
| Score | 0.819 |
|---|
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. | 46 | +1.717 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 1 | +1.001 |
| 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.134 | −0.359 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 13.745 | −0.218 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 15 | +0.077 |
Intercept 0.07 + feature contributions = 0.781 (log-odds).
Score = sigmoid(0.781) = 0.686.
| Score | 0.664 |
|---|
| Score | 10 |
|---|
Run 1
The code is clear and well-structured. It uses a simple loop to iterate numbers, extracts digits correctly, calculates the digit sum, and checks divisibility. The logic is straightforward, with flat nesting and clear variable names. However, there is a potential issue: for i=1, sum will be 1, so i % sum is valid, but there is no division-by-zero risk since sum is always at least 1 for positive integers. Minor improvements could include adding a comment or extracting the digit-sum logic into a method for readability. Overall, concise and easy to follow.
Run 2
The code is straightforward and easy to follow. It has a clear structure: a main method, a loop, a digit-sum calculation, and a conditional print. Nesting depth is minimal (only two levels), and the intent—finding Niven numbers up to 10,000—is obvious. The digit-sum logic is compact and uses standard modulo/division operations. Each line performs a single action, and the reading flow is logical. Minor deductions: the variable name 'i' is acceptable for a loop but 'num' shadows the loop variable purpose slightly; adding comments or a method extraction for digit-sum could improve clarity for larger programs. Overall, it is concise, readable, and well-structured.
Run 3
The code is structured clearly with a simple main method and nested loops. Nesting is shallow (one loop inside another). The intent is evident: find Niven numbers up to 10000 by summing digits and checking divisibility. Each line generally performs one action, except the 'if' condition which is straightforward. Reading flow follows a natural top-down progression: loop, sum digits, check divisibility, print. Variable names like sum and num are concise but could be slightly clearer. The code is short and avoids unnecessary complexity. Minor improvement could be more descriptive naming or extracting a sumDigits method, but overall it is highly readable.
Run 1
Code Structure: Logically organized, with digit summation followed by divisibility testing inside a straightforward loop. Nesting: Moderate and necessary; the while loop and conditional are separate rather than deeply nested. Clarity of intent: The class name and arithmetic convey the purpose, though more descriptive names such as digitSum and remainingDigits would help unfamiliar readers. Code length: Concise, with no unnecessary statements or abstractions. Action granularity: Each statement performs one clear operation; the for-loop header follows standard Java conventions. Reading flow: Natural progression from initialization to digit processing, testing, and output. The unexplained upper limit of 10000 is a minor readability weakness.
Run 2
Code Structure: Logically organized into iteration, digit summation, divisibility checking, and output. Nesting: Modest and necessary; the while loop and conditional are contained within a single for loop. Clarity of intent: The class name and arithmetic clearly indicate finding Niven numbers, though more descriptive names such as digitSum and remainingDigits would help. Code length: Concise without unnecessary statements. Action granularity: Each statement performs one clear action; the conventional for-loop header is easy to follow. Reading flow: Natural progression from candidate number to digit sum to divisibility test. The unexplained upper bound of 10000 slightly reduces readability.
Run 3
Code Structure: Logically organized into candidate iteration, digit summation, and divisibility testing. Nesting: Moderate and appropriate; the while loop and conditional sit inside a single for loop without excessive depth. Clarity of intent: The class name and straightforward arithmetic convey the purpose, though more descriptive variable names and a named upper-limit constant would help. Code length: Concise with no unnecessary statements. Action granularity: Each body statement performs one clear action; the for-loop header uses standard Java conventions. Reading flow: Natural top-to-bottom progression makes the algorithm easy to follow, although blank lines between the calculation and divisibility check could improve visual separation.