Sample

JetBrains/b9

Human rating uses the original dataset scale.

DatasetJetBrains
Human0.9
Lines47

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
14.4Δ 63.1
Scalabrino0.9020–1; higher is more readable
89.8Δ 12.3
Dorn0.5250–1; higher is more readable
50.8Δ 26.7
Mi0.6370–1; higher is more readable
78.8Δ 1.3
LLOC31Logical lines; fewer is more readable
3.8Δ 73.7
DeepSeek V4 Pro16.670–20; mean of three runs
62.3Δ 15.3
GPT-6.1 Sol17.330–20; mean of three runs
58.5Δ 19.1
BTTF0.4730–1; higher is more readable
57.6Δ 19.9
Human0.90–1; original rating
77.5

Views

Source code

public class SmithNumber { public static void main(String[] args) { for(int i = 0; i <= 10000; i++){ if(isSmith(i)){ System.out.println(i); } } } public static boolean isSmith(int n){ int digitSum = getDigitSum(n); int factorSum = getFactorSum(n); return !isPrime(n) && digitSum == factorSum; } public static int getDigitSum(int n){ int sum = 0; while(n > 0){ sum += n % 10; n /= 10; } return sum; } public static int getFactorSum(int n){ int sum = 0; for(int i = 2; i <= n; i++){ while(n % i == 0){ sum += getDigitSum(i); n /= i; } } return sum; } public static boolean isPrime(int n){ if(n <= 1){ return false; } for(int i = 2; i <= Math.sqrt(n); i++){ if(n % i == 0){ return false; } } return true; } }

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.1357.517−44.798
Source linesThe number of non-empty source lines.47+18.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.3.798−5.697

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

Score0.902

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.51.894+1.467
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.44+0.785
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.47−0.658
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.47−0.628
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.134−0.363
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.45.906+0.232

Intercept 0.07 + feature contributions = 0.101 (log-odds).
Score = sigmoid(0.101) = 0.525.

Score0.637
Score31
Run 1

The code is well-structured into small, focused methods with clear names, making the intent easy to follow. Nesting depth is minimal, with each method handling one specific task. The main loop is simple and readable. Action granularity is good, with one logical step per line. The reading flow is natural—methods are ordered in a logical progression. Minor improvements could include using braces consistently in the for loops, adding comments to explain Smith numbers, and slightly more whitespace between methods, but overall readability is high.

Run 2

The code is reasonably readable. It is well-structured into small methods with clear purposes (isSmith, getDigitSum, getFactorSum, isPrime), which aids comprehension. Nesting is minimal, and action granularity is mostly one action per line. The overall flow is logical: main loop, then helper methods. However, readability is reduced by missing braces on the outer for loop in main and inconsistent formatting (e.g., spacing in `for(int i = 0;`). The use of single-letter variable names (i, n) is acceptable for local loop variables, but `n` in helper methods could be more descriptive (e.g., `number`). The logic in `getFactorSum` is slightly dense due to the nested while inside the for loop, but it remains understandable. Overall, clear structure and intent lift the score above average, but spacing/brace consistency and variable naming prevent a higher rating.

Run 3

The code is well-structured into small, focused methods with descriptive names, making intent clear. The main loop is flat and easy to follow. Nesting is minimal—only one level in a few places. Action granularity is mostly one statement per line, and reading flow is natural from high-level check to helper functions. Minor style issues: inconsistent spacing in for loops (e.g., `for(int i...` vs `for (int...`), and `isPrime` repeatedly calls `Math.sqrt` in the loop condition. `getFactorSum` could be slightly optimized, but overall readability is high due to clean separation of concerns and clear naming.

Run 1

Code Structure: Well-organized methods separate digit summation, factor summation, primality testing, and enumeration. Nesting: Shallow overall, with straightforward two-level nesting in the main and factorization loops. Clarity of intent: Descriptive method names make the purpose clear, although getFactorSum actually sums the digits of prime factors, and modifying n makes its changing role less explicit. Code length: Concise without unnecessary repetition. Action granularity: Each line generally performs one action, making operations easy to follow. Reading flow: The progression from main to supporting methods is natural, though inconsistent spacing slightly reduces polish. The treatment of 0 and 1 in isSmith is a correctness issue rather than primarily a readability issue.

Run 2

Code Structure: Well organized into focused methods for Smith-number detection, digit sums, factor sums, and primality. Nesting: Shallow and easy to follow, with at most two nested control structures. Clarity of intent: Descriptive method names reveal the overall purpose, though getFactorSum could more explicitly indicate summing prime-factor digits, and modifying n requires some attention. Code length: Concise without unnecessary repetition. Action granularity: Each statement performs a single clear action. Reading flow: The entry point and high-level check precede supporting helpers, creating a natural progression. Minor readability weaknesses include inconsistent spacing around control statements and operators, the unexplained upper bound of 10000, and the absence of a brief explanation of Smith numbers.

Run 3

Code Structure: Well organized into small methods separating digit summation, factor summation, primality testing, and output. Nesting: Shallow, with at most two control-flow levels within methods. Clarity of intent: Descriptive method names communicate the purpose, though getFactorSum could more explicitly indicate summing prime-factor digits; accepting 0 and 1 as Smith numbers also obscures the intended definition. Code length: Concise without unnecessary repetition. Action granularity: Statements generally perform one action per line, with conventional loop headers. Reading flow: Natural progression from the entry point to the main predicate and supporting helpers. Consistent indentation helps, but missing spaces around control-flow parentheses and braces slightly reduce polish.