Sample

JetBrains/e24

Human rating uses the original dataset scale.

DatasetJetBrains
Human0.95
Lines33

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
0.8Δ 91.9
Scalabrino0.2230–1; higher is more readable
9.3Δ 83.5
Dorn0.0220–1; higher is more readable
1.7Δ 91.1
Mi0.0060–1; higher is more readable
1.7Δ 91.1
LLOC23Logical lines; fewer is more readable
14.8Δ 78.0
DeepSeek V4 Pro15.670–20; mean of three runs
49.6Δ 43.2
GPT-6.1 Sol170–20; mean of three runs
46.2Δ 46.6
BTTF0.4740–1; higher is more readable
58.5Δ 34.3
Human0.950–1; original rating
92.8

Views

Source code

public class IntegerToEnglish { private static final String[] ONES = {"", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"}; private static final String[] TENS = {"", "ten", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"}; private static final String[] TEENS = {"", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen"}; private static final String HUNDRED = "hundred"; private static final String THOUSAND = "thousand"; public static void main(String[] args) { for (String arg : args) { int n = Integer.parseInt(arg); if (n >= 1000) { System.out.print(ONES[n / 1000] + " " + THOUSAND + " "); n %= 1000; } if (n >= 100) { System.out.print(ONES[n / 100] + " " + HUNDRED + " "); n %= 100; } if (n >= 11 && n <= 19) { System.out.print(TEENS[n - 10] + " "); n = 0; } if (n >= 10) { System.out.print(TENS[n / 10] + " "); n %= 10; } if (n > 0) { System.out.print(ONES[n] + " "); } System.out.println(); } } }

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.1881.835−62.101
Source linesThe number of non-empty source lines.33+13.2
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.161−6.241

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

Score0.223

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.152.97−2.814
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.33+0.404
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.33−0.336
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.122−0.239
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.33−0.132
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.31.792+0.035

Intercept 0.07 + feature contributions = -3.817 (log-odds).
Score = sigmoid(-3.817) = 0.022.

Score0.006
Score23
Run 1

The code is generally clear and well-structured, with logical separation of arrays for ones, tens, and teens. The main flow is flat with minimal nesting, and each action is granular per line. However, there are subtle readability issues: the TEENS array has an empty first element which is non-obvious, and the logic for handling numbers 11–19 by setting n=0 is a bit ambiguous. The single-letter variable 'n' lacks clarity, and the repeated System.out.print calls could be consolidated for better flow. Missing input validation and handling for zero also reduce clarity. Overall, it's readable but could be improved with better naming and clearer edge-case handling.

Run 2

The code is generally readable with clear intent, flat structure, and concise logic. It uses well-named constants and processes each number segment sequentially. However, there are minor flaws: it doesn't handle zero, the TEENS array indexing could confuse (index 0 is empty, so n-10 requires mental offset), and the overall logic isn't encapsulated in a reusable method. The 'if' blocks are flat and each does one logical step, improving flow, but variable mutation (n) reduces clarity slightly. Overall, understandable for a small utility but could benefit from encapsulation and zero-case handling.

Run 3

The code is generally straightforward with a flat structure and one action per line, which aids readability. Variable names are clear, and the arrays for number words are logically organized. However, the logic for handling teens (11-19) is somewhat awkward because it sets n=0 and relies on subsequent conditions failing, which makes the intent less obvious. Also, the program silently ignores numbers 0-10 and lacks input validation, which could confuse readers. The main method is concise but the control flow could be clearer with an if-else chain or helper method. Overall, the code is readable for its small size but has some logic quirks.

Run 1

Code Structure: Lookup constants precede a logically ordered conversion routine, though parsing, conversion, and printing are combined in main. Nesting: Shallow, with straightforward conditional blocks inside one loop. Clarity of intent: The class name and constants clearly communicate integer-to-English conversion; the abbreviated variable n and unstated supported range reduce clarity slightly. Code length: Compact without substantial unnecessary code, although long array declarations are harder to scan. Action granularity: Each statement performs one primary action, with output and remainder updates on separate lines. Reading flow: Processing thousands, hundreds, teens, tens, and ones follows a natural descending order. Mutating n requires tracking the remaining value, but the consistent pattern makes this manageable.

Run 2

Code Structure: Lookup constants and a straightforward conversion sequence provide logical organization, though conversion and output are combined in main. Nesting: Shallow nesting—one loop containing simple conditionals—makes the code easy to follow. Clarity of intent: The class name, constants, and arithmetic clearly communicate integer-to-English conversion; however, the supported input range and handling of zero or negative numbers are not explicit. Code length: Compact without substantial repetition, although the lookup-array declarations are long. Action granularity: Each statement performs one primary action, with output and remainder updates on separate lines. Reading flow: Processing thousands, hundreds, teens, tens, and ones follows a natural descending order. Repeated mutation of the terse variable n requires some tracking, but the overall flow remains clear.

Run 3

Code Structure: Lookup constants and a logically ordered conversion routine provide clear organization, though separating conversion from argument parsing and printing would improve modularity. Nesting: Shallow nesting, with only conditionals inside a loop, makes the code easy to follow. Clarity of intent: The class name, constants, and arithmetic clearly communicate integer-to-English conversion; the abbreviated variable n and unstated supported range reduce clarity slightly. Code length: Compact without substantial duplication or unnecessary code. Action granularity: Each statement performs a distinct action, with output and remainder updates on separate lines. Reading flow: Processing thousands, hundreds, teens, tens, and ones follows a natural descending order. Repeated printing mildly fragments the conversion logic, and behavior for zero, negative values, and larger numbers is not explicit.