Sample

JetBrains/b4

Human rating uses the original dataset scale.

DatasetJetBrains
Human0.8
Lines15

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett0.0170–1; higher is more readable
90.7Δ 29.2
Scalabrino0.7980–1; higher is more readable
72.9Δ 11.4
Dorn0.7070–1; higher is more readable
88.1Δ 26.7
Mi0.6430–1; higher is more readable
83.9Δ 22.5
LLOC10Logical lines; fewer is more readable
72.9Δ 11.4
DeepSeek V4 Pro17.670–20; mean of three runs
88.6Δ 27.1
GPT-6.1 Sol180–20; mean of three runs
77.5Δ 16.1
BTTF0.5350–1; higher is more readable
72.0Δ 10.6
Human0.80–1; original rating
61.4

Views

Source code

public class NivenNumbers { public static void main(String[] args) { for(int i = 1; i <= 10000; i++) { int sum = 0; int number = i; while(number > 0) { sum += number % 10; number /= 10; } if(i % sum == 0) { System.out.println(i); } } } }

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.419.834−13.855
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.396−5.095

Intercept 8.87 + feature contributions = -4.079 (log-odds).
Score = sigmoid(-4.079) = 0.017.

Score0.798

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.46.8+1.683
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.12−0.226
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.13.708−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.879 (log-odds).
Score = sigmoid(0.879) = 0.707.

Score0.643
Score10
Run 1

The code is concise and logically structured, making good use of a simple loop to compute digit sums and check divisibility. Nesting is minimal with only one level of indentation inside the for-loop, and the while-loop is flat and straightforward. The variable names ('sum', 'number', 'i') are clear given the small scope, and the purpose—finding Niven numbers—is evident from the class name and logic. Each line performs a single action, maintaining good action granularity. The reading flow follows a natural progression: initialize, extract digits, test condition, print. Minor deductions: the logic assumes no division by zero (not an issue for positive integers) and lacks comments, but the code is simple enough that comments are unnecessary. Overall, it is highly readable and suitable for its purpose.

Run 2

The code is highly readable. It has a clear structure: a main method, a for-loop, and a while-loop, all logically organized. Nesting is minimal (only two levels deep). The intent is obvious — find Niven (Harshad) numbers up to 10,000. It is concise, with no unnecessary comments or extra lines. Each line performs a single action, and the reading flow is natural: loop, compute digit sum, test divisibility, print. Minor improvements could include wrapping the digit-sum logic in a well-named method and adding a blank line for separation, but overall it is very clear.

Run 3

The code is well-structured with clear separation of concerns: a loop to iterate numbers, a while loop to compute digit sum, and a conditional to check the Niven property. Nesting is minimal and flat. Intent is clear: it finds and prints Niven numbers up to 10000. Code length is concise with no redundant lines. Each line performs one logical action, improving readability. Reading flow is natural: outer iteration, inner computation, then check and output. Minor deductions could be for lack of comments explaining a Niven number, and variables like 'sum' and 'number' could be slightly more descriptive, but overall the code is highly readable.

Run 1

Code Structure: Logically organized into iteration, digit summation, and divisibility checking. Nesting: Modest and appropriate; the while loop and conditional sit naturally within the for loop. Clarity of intent: The class name and straightforward arithmetic convey the purpose, although naming i as candidate and sum as digitSum would improve clarity. Code length: Concise, with no unnecessary statements. Action granularity: Each statement performs one clear action; the for-loop header uses conventional Java syntax. Reading flow: Execution proceeds naturally from selecting a number to calculating its digit sum and printing qualifying numbers. Consistent indentation helps, though conventional spacing around control statements and a named upper-limit constant would improve polish.

Run 2

Code Structure: Logically organized into iteration, digit summation, divisibility checking, and output. Nesting: Shallow and appropriate, with a while loop and conditional inside the main loop. Clarity of intent: The class name and straightforward arithmetic convey the purpose, although names such as digitSum and remainingDigits would be clearer than sum and number. Code length: Concise, with no unnecessary statements or abstractions. Action granularity: Each statement performs one clear action; the for-loop header follows standard conventions. Reading flow: Natural and sequential, though consistent spacing around control keywords and operators would improve presentation.

Run 3

Code Structure: Logically organized, with digit summation followed by the divisibility test. Nesting: Shallow and appropriate; the while loop and if statement sit inside a single for loop. Clarity of intent: The class name identifies the purpose, though digitSum and remainingDigits would be clearer than sum and number, and 10000 is an unexplained limit. Code length: Concise without unnecessary statements. Action granularity: Each statement performs one action; the for header uses conventional initialization, condition, and increment. Reading flow: Natural progression from candidate selection to digit summation and output. Minor spacing inconsistencies slightly reduce polish.