Sample
MBJP/22
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0.474 | 0–1; higher is more readable | 87.5Δ 6.2 |
| Scalabrino | 0.909 | 0–1; higher is more readable | 75.0Δ 18.8 |
| Dorn | 0.689 | 0–1; higher is more readable | 56.2Δ 37.5 |
| Mi | 0.862 | 0–1; higher is more readable | 100.0Δ 6.2 |
| LLOC | 7 | Logical lines; fewer is more readable | 81.2Δ 12.5 |
| DeepSeek V4 Pro | 19.33 | 0–20; mean of three runs | 100.0Δ 6.2 |
| GPT-6.1 Sol | 19 | 0–20; mean of three runs | 93.8Δ 0.0 |
| BTTF | 0.754 | 0–1; higher is more readable | 93.8Δ 0.0 |
| 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. | 382.574 | −12.625 |
| Source linesThe number of non-empty source lines. | 25 | +10 |
| 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.232 | −6.348 |
Intercept 8.87 + feature contributions = -0.103 (log-odds).
Score = sigmoid(-0.103) = 0.474.
| Score | 0.909 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 90.88 | +0.662 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.065 | +0.308 |
| 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. | 91 | −0.189 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 16 | −0.184 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 25 | +0.151 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 23.783 | −0.077 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 16 | +0.054 |
Intercept 0.07 + feature contributions = 0.794 (log-odds).
Score = sigmoid(0.794) = 0.689.
| Score | 0.862 |
|---|
| Score | 7 |
|---|
Run 1
The code is well-structured, clear, and easy to read. It uses a simple for-each loop and a HashSet to track seen elements. The logic is flat with only one level of nesting. Each action is on its own line, and the purpose is immediately clear from the method name and documentation. The code is concise, avoids unnecessary complexity, and follows natural reading flow from left to right, top to bottom.
Run 2
The code is highly readable. It uses a clear, flat structure with a single method and a straightforward for-loop. The logic is immediately obvious: iterate through the list, track seen numbers in a HashSet, and return the first duplicate encountered. There is minimal nesting (one level inside the loop), clear intent, and concise length. Each action is on its own line, and the reading flow is natural. Although the else block could be omitted for brevity, its presence is not harmful and arguably improves clarity. Documentation with examples is included, enhancing understandability.
Run 3
The code is highly readable. It has a clear class and method name, a concise docstring with illustrative examples, and a flat control flow with minimal nesting. The logic is straightforward: use a HashSet to track seen numbers and return the first repeated element. Each iteration performs a single logical check, and the early return avoids unnecessary processing. The code is concise, uses standard Java idioms, and follows a natural reading flow from problem description to implementation.
Run 1
Code Structure: The method is logically organized around tracking seen values and returning the first repeated value. Nesting: Only a loop and a simple conditional are nested; the else is unnecessary after an early return. Clarity of intent: Descriptive class, method, and variable names, plus examples, make the purpose clear, although the documentation says array while the parameter is a List. Code length: Short and focused, with no substantial redundancy. Action granularity: Each statement performs one clear action. Reading flow: Initialization, sequential scanning, duplicate detection, and the fallback return follow a natural order. Minor distractions include the wildcard import and the stray asterisk in the documentation.
Run 2
Code Structure: Logically organized into a single focused method with a set tracking previously encountered values. Nesting: Shallow loop-and-conditional nesting is easy to follow, though the else is unnecessary after an early return. Clarity of intent: Descriptive names and illustrative examples clearly communicate the purpose; the documentation slightly mismatches the List parameter by calling it an array. Code length: Concise, with no substantial redundancy. Action granularity: Each statement performs one clear action. Reading flow: Natural progression from initialization through iteration, duplicate detection, and the fallback return. Minor distractions include the wildcard import and stray asterisk in the documentation.
Run 3
Code Structure: Imports, class, documentation, and method are logically organized. Nesting: A single loop with one conditional keeps nesting shallow; the else is unnecessary after an early return. Clarity of intent: Descriptive names and examples clearly explain finding the first repeated value encountered. Code length: The implementation is concise, though the documentation has minor formatting clutter. Action granularity: Each statement performs one clear action on its own line. Reading flow: Initialization, iteration, duplicate detection, tracking, and fallback return follow a natural sequence.