Sample
MBJP/19
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0.553 | 0–1; higher is more readable | 93.8Δ 0.0 |
| Scalabrino | 0.85 | 0–1; higher is more readable | 68.8Δ 25.0 |
| Dorn | 0.722 | 0–1; higher is more readable | 68.8Δ 25.0 |
| Mi | 0.769 | 0–1; higher is more readable | 81.2Δ 12.5 |
| LLOC | 7 | Logical lines; fewer is more readable | 81.2Δ 12.5 |
| DeepSeek V4 Pro | 18 | 0–20; mean of three runs | 90.6Δ 3.1 |
| GPT-6.1 Sol | 19 | 0–20; mean of three runs | 93.8Δ 0.0 |
| BTTF | 0.778 | 0–1; higher is more readable | 100.0Δ 6.2 |
| Human | 5 | 1–5; original rating | 93.8 |
Views
Loading feature diagnosis…
Source regions
Feature contributions
Feature contributions
| Feature | Value | Contribution (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. | 359.05 | −11.849 |
| Source linesThe number of non-empty source lines. | 24 | +9.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. | 4.272 | −6.408 |
Intercept 8.87 + feature contributions = 0.213 (log-odds).
Score = sigmoid(0.213) = 0.553.
| Score | 0.85 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 98.917 | +0.792 |
| 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. | 99 | −0.528 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.061 | +0.346 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 15 | −0.218 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 24 | +0.187 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 22.85 | −0.09 |
Intercept 0.07 + feature contributions = 0.956 (log-odds).
Score = sigmoid(0.956) = 0.722.
| Score | 0.769 |
|---|
| Score | 7 |
|---|
Run 1
The code is highly readable. It follows a clear, logical structure with a single purpose method that is easy to understand. The method is flat, with only one level of nesting inside the loop, which keeps the control flow straightforward. The intent is unambiguous: check for duplicates using a HashSet for O(1) lookups. The code is concise and avoids unnecessary length; the algorithm is efficient without extra boilerplate. Action granularity is appropriate—each line performs one distinct operation (check contains, return true, add to set, return false). The reading flow is natural: initialize set, iterate, check, add, return. Minor improvements could include using the return value of `add` to simplify (e.g., `if (!seen.add(num)) return true;`), but the current version is clear and self-documenting. Javadoc examples enhance comprehension.
Run 2
The code is highly readable. It uses clear imports, a well-documented method, and a straightforward algorithm. The structure is logical, with a single loop and minimal nesting. The use of a HashSet for tracking seen elements clarifies intent, and each action is on its own line. The code is concise and follows natural reading flow from initialization through iteration to return.
Run 3
The code is well-structured with a single, clearly named method and an appropriate import. Nesting is minimal, with only one level inside the loop. Intent is clear from the method name and Javadoc examples, though the comment formatting is slightly unusual. The code is concise and avoids unnecessary length. Each line performs one logical action, enhancing readability. Reading flow is natural: initialize a set, iterate, check for duplicates, and return. Minor improvements could include using `Set.add()` to combine the check and add, and aligning the Javadoc style, but these are negligible.
Run 1
Code Structure: A single focused method is logically organized around tracking previously seen values. Nesting: Only a loop and one conditional, keeping nesting shallow. Clarity of intent: The method name, examples, and descriptive variable 'seen' clearly communicate duplicate detection, though 'arraynums' is awkward for a List. Code length: The implementation is concise without unnecessary logic. Action granularity: Each statement performs one clear action on its own line. Reading flow: Initialization, iteration, early return on a duplicate, and the final false return follow a natural sequence. Minor readability issues include the wildcard import, the malformed introductory comment marker, and using boxed Boolean instead of primitive boolean.
Run 2
Code Structure: The method is logically organized around initializing a set, scanning the input, and returning a result. Nesting: Only a loop and a conditional are nested, with an early return keeping control flow simple. Clarity of intent: The documentation, examples, and 'seen' variable clearly communicate duplicate detection; 'arraynums' is less precise for a List parameter. Code length: The implementation is concise without unnecessary logic. Action granularity: Each statement performs one clear action. Reading flow: Initialization, duplicate checking, recording values, and the final fallback follow a natural sequence. Minor readability issues include the wildcard import, an extra asterisk in the documentation, and using boxed Boolean instead of primitive boolean.
Run 3
Code Structure: The method is logically organized into set initialization, iteration, duplicate detection, and a final result. Nesting: A single loop with one conditional keeps nesting shallow. Clarity of intent: The method name, descriptive 'seen' variable, and documented examples make the purpose clear, though 'arraynums' is awkwardly named for a List. Code length: The implementation is concise without unnecessary logic. Action granularity: Each statement performs one clear action. Reading flow: The straightforward sequence and early return make the algorithm easy to follow. Minor distractions include the wildcard import, boxed Boolean return type, and stray documentation asterisk.