Sample
MBJP/10
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0.005 | 0–1; higher is more readable | 43.8Δ 28.1 |
| Scalabrino | 0.577 | 0–1; higher is more readable | 31.2Δ 40.6 |
| Dorn | 0.774 | 0–1; higher is more readable | 81.2Δ 9.4 |
| Mi | 0.474 | 0–1; higher is more readable | 18.8Δ 53.1 |
| LLOC | 8 | Logical lines; fewer is more readable | 62.5Δ 9.4 |
| DeepSeek V4 Pro | 15.67 | 0–20; mean of three runs | 50.0Δ 21.9 |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs | 65.6Δ 6.2 |
| BTTF | 0.554 | 0–1; higher is more readable | 50.0Δ 21.9 |
| Human | 4.5 | 1–5; original rating | 71.9 |
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. | 517.969 | −17.093 |
| 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.502 | −6.754 |
Intercept 8.87 + feature contributions = -5.377 (log-odds).
Score = sigmoid(-5.377) = 0.005.
| Score | 0.577 |
|---|
Feature contributions
| Feature | Value | Contribution (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. | 70.958 | +0.66 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 70.917 | +0.34 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 15 | −0.218 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.076 | +0.207 |
| 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.847 | −0.09 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 15 | +0.077 |
Intercept 0.07 + feature contributions = 1.231 (log-odds).
Score = sigmoid(1.231) = 0.774.
| Score | 0.474 |
|---|
| Score | 8 |
|---|
Run 1
The code is generally readable and well-structured. It uses a clear method name, a straightforward PriorityQueue-based approach, and includes helpful documentation with examples. The logic is flat with minimal nesting, and each action is reasonably granular. Minor points deducted for: the class name 'SmallNnum' being slightly cryptic, the parameter name 'list1' being vague, and the redundant isEmpty check inside the loop. Overall, the code is concise and intent is clear.
Run 2
The code is concise and logically structured, using a PriorityQueue min-heap to extract the n smallest items efficiently. Nesting is minimal, with only one loop and one conditional check. The intent is fairly clear from the method name and Javadoc examples, though the naming 'SmallNnum' is slightly awkward and could be more descriptive (e.g., SmallestNItems). Action granularity is good—each meaningful step is on its own line. Reading flow is natural: create result list, populate heap, poll n times. However, the method does not guard against n exceeding the list size beyond the heap empty check, which is acceptable but could be clearer. The code is not overly long, but the Javadoc adds verbosity. Overall, it is readable but could improve slightly in naming and input validation clarity.
Run 3
The code is clean, concise, and easy to follow. It uses a PriorityQueue (min-heap) to extract the n smallest items, which is clear and efficient. The structure is logical with minimal nesting and good action granularity. The method name 'smallNnum' is somewhat ambiguous and the parameter 'n' lacks validation, but the Javadoc examples help clarify intent. Overall, the code is readable but could benefit from a clearer method name and handling of edge cases.
Run 1
Code Structure: The method is logically organized into initialization, extraction, and return. Nesting: Only a loop and a simple conditional are nested, keeping complexity low. Clarity of intent: The documentation and examples clearly explain the purpose, and result and minHeap are descriptive; smallNnum and list1 are less clear names. Code length: The implementation is concise, though the examples are somewhat repetitive. Action granularity: Each statement performs one clear operation, with polling directly inside addition remaining easy to understand. Reading flow: Execution proceeds naturally from building the heap to collecting the smallest values and returning them. The wildcard import and stray documentation asterisk are minor readability weaknesses.
Run 2
Code Structure: The method is logically organized into initialization, extraction, and return. Nesting: Only a loop and a simple conditional are nested, keeping complexity low. Clarity of intent: Documentation, examples, and the minHeap variable make the purpose clear, though SmallNnum, smallNnum, and list1 are awkward or generic names. Code length: The implementation is concise without unnecessary scaffolding. Action granularity: Each line performs one clear operation; adding a polled value is a natural combined expression. Reading flow: Execution proceeds naturally from building the heap to collecting the smallest items. Minor readability drawbacks include the wildcard import, a stray documentation asterisk, and no explicit explanation of behavior when n exceeds the dataset size or is negative.
Run 3
Code Structure: Imports, class, documentation, and method are logically organized. Nesting: Only a loop and a single conditional, keeping complexity low. Clarity of intent: The documentation and descriptive names result and minHeap clearly explain the purpose, although SmallNnum, smallNnum, and list1 are awkward or generic names. Code length: The implementation is concise without unnecessary abstractions. Action granularity: Each statement performs one clear action, with polling and adding naturally combined. Reading flow: Initialization, heap construction, extraction, and return follow a straightforward sequence. Minor readability improvements include explicit imports and Java-style documentation examples rather than Python-like list notation.