Sample

JetBrains/e39

Human rating uses the original dataset scale.

DatasetJetBrains
Human0.75
Lines15

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett0.0040–1; higher is more readable
80.5Δ 27.1
Scalabrino0.8130–1; higher is more readable
75.4Δ 22.0
Dorn0.7780–1; higher is more readable
94.9Δ 41.5
Mi0.6250–1; higher is more readable
76.3Δ 22.9
LLOC11Logical lines; fewer is more readable
63.6Δ 10.2
DeepSeek V4 Pro13.330–20; mean of three runs
28.0Δ 25.4
GPT-6.1 Sol160–20; mean of three runs
26.7Δ 26.7
BTTF0.5420–1; higher is more readable
76.3Δ 22.9
Human0.750–1; original rating
53.4

Views

Source code

public class PrimeNumbers { public static void main(String[] args) { for(int i=2;i<=10000;i++){ boolean flag=true; for(int j=2;j<=Math.sqrt(i);j++){ if(i%j==0){ flag=false; break; } } if(flag) 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.465.115−15.349
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.371−5.057

Intercept 8.87 + feature contributions = -5.536 (log-odds).
Score = sigmoid(-5.536) = 0.004.

Score0.813

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+1.59
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
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.122−0.241
Indentation frequencyHow rapidly indentation changes from line to line.15−0.218
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.13.78−0.217
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.15+0.077

Intercept 0.07 + feature contributions = 1.256 (log-odds).
Score = sigmoid(1.256) = 0.778.

Score0.625
Score11
Run 1

The code is functionally correct but only moderately readable. Structure is simple and logical, with clear separation between the outer and inner loops. Nesting is shallow (two levels), which helps comprehension. The intent — finding primes up to 10,000 — is reasonably clear, but variable names like 'flag' are vague. Code length is concise, which is good, but several lines cram multiple actions (initialization, condition, increment), and 'if(flag)' without braces is a minor style risk. Reading flow is mostly natural, yet missing whitespace and inconsistent bracing slightly hinder readability. Overall, it's understandable but could be improved with better naming, consistent formatting, and perhaps a helper method for the primality check.

Run 2

The code is logically organized and readable at a basic level, but it lacks several clarity and style improvements. The nested loops are minimal, but the inner condition uses break, which slightly interrupts flow. The variable name 'flag' is ambiguous; 'isPrime' would be clearer. The Math.sqrt(i) is computed repeatedly in the loop condition, which is inefficient and less readable than caching it. The `if(flag)` without braces and the one-line print are acceptable here but can reduce readability in larger codebases. The code is concise but omits comments or meaningful names. Overall, it is a straightforward prime number generator, but readability suffers from vague naming and minor structural inconsistencies.

Run 3

The code is logically structured and readable for its small size. It uses a simple nested loop to check for primes, with clear variable names like 'flag' and straightforward math. However, readability is reduced by missing braces on the outer if statement, slightly cramped formatting (e.g., no spaces around operators), and a boolean flag that could be replaced with a method call. The action granularity is acceptable, but the reading flow is slightly interrupted by the inline 'if(flag)' without braces. Overall, it is understandable but not exemplary.

Run 1

Code Structure: Logically organized around candidate numbers, divisor checks, and output. Nesting: Moderate nesting with two loops and a conditional, but the short blocks remain easy to follow. Clarity of intent: The class name and logic clearly indicate prime-number generation, though 'flag' is less descriptive than 'isPrime' and the upper limit is unexplained. Code length: Concise without unnecessary statements. Action granularity: Most statements perform one action; the loop headers conventionally combine initialization, checking, and incrementing. Reading flow: Execution proceeds naturally from testing to printing, but cramped operator spacing and omitted braces around the final conditional slightly reduce readability.

Run 2

Code Structure: Logically organized into candidate iteration, divisor checking, and output. Nesting: Three nested control levels are manageable for this short algorithm. Clarity of intent: The class name and divisibility test clearly indicate prime generation, but 'flag' is less descriptive than 'isPrime', and 10000 is an unexplained limit. Code length: Concise without unnecessary logic. Action granularity: Each statement performs one action; the compact loop headers remain conventional. Reading flow: Execution proceeds naturally, and the early break is easy to follow. However, missing spaces around operators and inconsistent brace usage reduce readability.

Run 3

Code Structure: Logically organized into candidate iteration, divisor testing, and output. Nesting: Moderate nesting with two loops and a conditional, but the short blocks remain easy to follow. Clarity of intent: The class name and algorithm clearly indicate prime-number generation; however, flag is vague, and the upper bound 10000 is unexplained. Code length: Concise without unnecessary statements. Action granularity: Each body statement performs one action; the loop headers use conventional initialization, condition, and increment. Reading flow: Natural progression from testing to printing, although missing spaces around operators and omitted braces around the final if reduce visual clarity.