Sample

JetBrains/b25

Human rating uses the original dataset scale.

DatasetJetBrains
Human0.96
Lines22

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
45.8Δ 50.0
Scalabrino0.380–1; higher is more readable
19.5Δ 76.3
Dorn0.690–1; higher is more readable
83.1Δ 12.7
Mi0.5610–1; higher is more readable
64.4Δ 31.4
LLOC17Logical lines; fewer is more readable
34.3Δ 61.4
DeepSeek V4 Pro14.670–20; mean of three runs
40.3Δ 55.5
GPT-6.1 Sol180–20; mean of three runs
77.5Δ 18.2
BTTF0.6190–1; higher is more readable
89.8Δ 5.9
Human0.960–1; original rating
95.8

Views

Source code

public class Main { public static void main(String[] args) { for (int i = 0; i < args.length; i++) { int num = Integer.parseInt(args[i]); String suffix; int lastDigit = num % 10; int secondLastDigit = num % 100 / 10; if (secondLastDigit == 1) { suffix = "th"; } else if (lastDigit == 1) { suffix = "st"; } else if (lastDigit == 2) { suffix = "nd"; } else if (lastDigit == 3) { suffix = "rd"; } else { suffix = "th"; } System.out.println(num + suffix); } } }

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.759.555−25.065
Source linesThe number of non-empty source lines.22+8.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.624−5.437

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

Score0.38

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.49.955+1.549
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
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.20.765−0.12
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.108−0.112
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.22−0.084

Intercept 0.07 + feature contributions = 0.798 (log-odds).
Score = sigmoid(0.798) = 0.69.

Score0.561
Score17
Run 1

The code is generally readable and well-structured. It has a clear purpose: converting numbers to ordinal strings via command-line arguments. The structure is logical, with low nesting (one loop and one if-else chain). The intent is fairly clear, though the ordinal logic could be more explicit. The code length is appropriate and concise. Action granularity is mostly one action per line, except the lastDigit and secondLastDigit calculations, which could be clearer if separated or better named. The reading flow is natural: parse input, compute suffix, print result. However, there is a minor ambiguity: the algorithm does not handle negative numbers, and the use of lastDigit/secondLastDigit could be clearer. Overall, it is readable but could be improved with a helper method for ordinal logic and better variable naming.

Run 2

The code is logically structured and straightforward, with a single class and a clear main method. It is relatively flat, with only a few conditional branches. The intent is clear: generate ordinal suffixes for numbers from command-line arguments. Action granularity is good, with one main action per line. However, readability is slightly reduced by the lack of helper methods for parsing and suffix logic, which could make the code more modular and reduce cognitive load. Variable names are mostly clear, but 'secondLastDigit' logic could be extracted for clarity. The code is concise but not overly compressed, and the flow is natural.

Run 3

The code is fairly readable with a clear purpose: it appends an ordinal suffix to each numeric command-line argument. The structure is logical and the if-else chain is flat, which aids readability. The action granularity is good, with one main operation per line. However, the code is slightly verbose: the suffix determination could be condensed, and the secondLastDigit variable could be more clearly named. The intent of the conditional logic is understandable, but the repeated suffix assignments make it longer than necessary. Overall, it is readable but not maximally concise.

Run 1

Code Structure: Logically organized into input parsing, digit extraction, suffix selection, and output. Nesting: Shallow and manageable, with a single loop containing a straightforward conditional chain. Clarity of intent: Descriptive variable names and familiar suffixes make ordinal formatting clear, though the special handling of teen numbers could benefit from a brief comment. Code length: Concise, with little unnecessary code; the repeated suffix assignments are reasonable for readability. Action granularity: Each statement performs one action, making individual steps easy to follow. Reading flow: Consistent indentation and a natural top-to-bottom progression support quick comprehension.

Run 2

Code Structure: Logically organized into argument parsing, digit extraction, suffix selection, and output. Nesting: Shallow and easy to follow; the conditional chain sits within a single loop. Clarity of intent: Descriptive variable names and recognizable suffix rules clearly convey ordinal formatting, though Main is generic and the digit arithmetic requires brief interpretation. Code length: Concise, with little unnecessary code; the repeated suffix assignments are straightforward. Action granularity: Each statement performs a focused action, with no crowded lines. Reading flow: Consistent indentation and sequential processing make the code natural to read. Extracting suffix selection into a named helper could make its purpose even more explicit.

Run 3

Code Structure: Logically organized into argument parsing, digit extraction, suffix selection, and output. Nesting: Limited to a loop and a straightforward if/else chain; easy to follow. Clarity of intent: Descriptive names make ordinal suffix generation apparent, though a dedicated method could make the purpose more explicit. Code length: Concise, with only minor repetition in assigning "th". Action granularity: Each statement performs a single clear action; standard loop syntax is appropriate. Reading flow: Natural top-to-bottom progression and consistent indentation support readability. A few blank lines separating processing stages and parentheses around the digit calculation would improve scanning slightly.