Sample

MBJP/3

Human rating uses the original dataset scale.

DatasetMBJP
Human5
Lines28

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett0.180–1; higher is more readable
68.8Δ 25.0
Scalabrino0.9420–1; higher is more readable
87.5Δ 6.2
Dorn0.7720–1; higher is more readable
75.0Δ 18.8
Mi0.7550–1; higher is more readable
75.0Δ 18.8
LLOC8Logical lines; fewer is more readable
62.5Δ 31.2
DeepSeek V4 Pro16.670–20; mean of three runs
56.2Δ 37.5
GPT-6.1 Sol180–20; mean of three runs
65.6Δ 28.1
BTTF0.7140–1; higher is more readable
87.5Δ 6.2
Human51–5; original rating
93.8

Views

Source code

import java.io.*; import java.lang.*; import java.util.*; import java.math.*; class IsNotPrime { /** * * Write a Java function to identify non-prime numbers. * * > isNotPrime(2) * false * > isNotPrime(10) * true * > isNotPrime(35) * true */ public static Boolean isNotPrime(int n) { if (n <= 1) { return true; } for (int i = 2; i <= Math.sqrt(n); i++) { if (n % i == 0) { return true; } } return false; } }

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.468.851−15.472
Source linesThe number of non-empty source lines.28+11.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.078−6.116

Intercept 8.87 + feature contributions = -1.518 (log-odds).
Score = sigmoid(-1.518) = 0.18.

Score0.942

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.61+1.082
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.58.893+0.146
Indentation frequencyHow rapidly indentation changes from line to line.19−0.08
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.28+0.045
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.26.952−0.033
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.19−0.015
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.097+0.003

Intercept 0.07 + feature contributions = 1.217 (log-odds).
Score = sigmoid(1.217) = 0.772.

Score0.755
Score8
Run 1

The code is well-structured, with a clear class and method name that directly convey intent. Nesting is minimal, using early returns to avoid unnecessary indentation. The action granularity is appropriate, though the loop body could be slightly more compact. The logic for identifying non-prime numbers is straightforward and readable. The redundant import statements and over-commented Javadoc are minor issues but don't significantly affect readability. Overall, the code is concise, flows naturally, and requires no additional explanation.

Run 2

The code is well-structured, with a single class and method that clearly implement the prime-checking logic. Nesting is minimal (one level), and intent is straightforward: return true if the number is non-prime. The use of Math.sqrt(n) as the loop bound is efficient and readable. Variable names are concise but clear. The main weakness is that the logic is inverted relative to the method name — the function returns true for non-prime numbers, but the loop checks for divisibility to return true, which can be slightly counterintuitive. Additionally, the imported packages (java.io, java.lang, java.math) are unused, adding unnecessary noise. Overall, the code is easy to follow but could be improved by removing unused imports and perhaps renaming or restructuring to make the non-prime detection more explicit.

Run 3

The code is well-structured and readable. It uses clear naming (isNotPrime, n, i), a flat control flow with only one level of nesting, and a concise loop that directly expresses the primality check. The method is short, has a single responsibility, and the action granularity is good—each line does one logical step. The included Javadoc with examples clarifies intent. Minor deductions: the import statements are unnecessary and add clutter, and the primitive wrapper Boolean could be replaced with boolean for consistency. The loop bound Math.sqrt(n) is recalculated per iteration, but this is a minor efficiency not readability issue. Overall, the code is straightforward and easy to follow.

Run 1

Code Structure: A single focused method is logically organized into an edge-case check, divisor search, and final result. Nesting: Shallow nesting and early returns keep control flow easy to follow. Clarity of intent: The class and method names clearly express the purpose, reinforced by examples; however, the documentation could clarify that numbers less than 2 are considered non-prime. Code length: The implementation is concise, though unused wildcard imports add clutter. Action granularity: Each statement performs one clear action, with conventional loop syntax. Reading flow: Consistent formatting and a natural top-to-bottom progression make the code easy to read. Minor distractions include the malformed documentation marker and using boxed Boolean rather than primitive boolean.

Run 2

Code Structure: The single method is logically organized, with an edge-case check followed by divisor testing. Nesting: Shallow nesting and early returns keep control flow easy to follow. Clarity of intent: The class and method names, documentation, and examples clearly communicate the non-prime check. Code length: The implementation is concise, though unused wildcard imports and the redundant java.lang import add clutter. Action granularity: Each statement performs one clear action. Reading flow: Conventional formatting and a natural progression from edge cases to testing to the final result make the code readable. Minor distractions include the malformed documentation marker and using boxed Boolean rather than primitive boolean.

Run 3

Code Structure: A single, well-organized method separates the edge case, divisor search, and final result. Nesting: Shallow nesting and early returns keep the logic easy to follow. Clarity of intent: The class and method names clearly identify the purpose, and examples document expected behavior; the stray asterisk in the comment slightly reduces polish. Code length: The implementation is concise, though unused wildcard imports add clutter. Action granularity: Statements generally perform one action each; the conventional loop header remains readable. Reading flow: Execution proceeds naturally from handling numbers at or below one to checking divisors and returning the result.