Sample
MBJP/6
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0.324 | 0–1; higher is more readable | 81.2Δ 53.1 |
| Scalabrino | 0.921 | 0–1; higher is more readable | 81.2Δ 53.1 |
| Dorn | 0.618 | 0–1; higher is more readable | 43.8Δ 15.6 |
| Mi | 0.668 | 0–1; higher is more readable | 50.0Δ 21.9 |
| LLOC | 3 | Logical lines; fewer is more readable | 100.0Δ 71.9 |
| DeepSeek V4 Pro | 18 | 0–20; mean of three runs | 90.6Δ 62.5 |
| GPT-6.1 Sol | 19 | 0–20; mean of three runs | 93.8Δ 65.6 |
| BTTF | 0.641 | 0–1; higher is more readable | 81.2Δ 53.1 |
| Human | 2.5 | 1–5; original rating | 28.1 |
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. | 351.035 | −11.584 |
| Source linesThe number of non-empty source lines. | 22 | +8.8 |
| 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.548 | −6.823 |
Intercept 8.87 + feature contributions = -0.737 (log-odds).
Score = sigmoid(-0.737) = 0.324.
| Score | 0.921 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 102.955 | +0.857 |
| 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. | 103 | −0.697 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 12 | −0.322 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.067 | +0.287 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 22 | +0.257 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 12 | +0.145 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 20.904 | −0.118 |
Intercept 0.07 + feature contributions = 0.48 (log-odds).
Score = sigmoid(0.48) = 0.618.
| Score | 0.668 |
|---|
| Score | 3 |
|---|
Run 1
The code is well-structured and concise. It imports only necessary packages, defines a clear class name and method, and uses a clean bitwise check to determine if two numbers differ at exactly one bit position. The intent is explicitly documented through the JavaDoc and inline comment. Nesting is minimal, with no conditional branching or deep indentation. The method performs one logical action — computing XOR and testing if it is a power of two. The reading flow is natural: input parameters, XOR operation, then a single return expression. The only minor drawback is the use of the wrapper class `Boolean` instead of primitive `boolean`, which slightly impacts idiomatic Java style, but it does not significantly affect readability.
Run 2
The code is concise and clear. It uses a single, well-known bitwise trick to solve the problem efficiently. The method has a descriptive name, and the inline comment explains the logic. The structure is flat with no unnecessary nesting, and each statement performs one logical action. The reading flow is natural: compute the XOR, then check if it is a power of two. The minor deduction is due to the lack of a blank line between the method signature and the comment, and the unused imports, which slightly reduce cleanliness.
Run 3
The code is concise and well-structured. It clearly implements the single-bit difference check using XOR and the power-of-two test. The method name and variable names are descriptive, and the inline comment explains the core logic without being excessive. Nesting is minimal, with no unnecessary branching. Each meaningful action is on its own line, and reading flow is natural: compute XOR, then check. The only minor issue is the unused imports, but that does not significantly impact readability. Overall, it is highly readable.
Run 1
Code Structure: A single, focused method is logically organized, though unused wildcard imports add clutter. Nesting: No nested control flow; the implementation is flat. Clarity of intent: The descriptive class and method names, examples, and explanatory comment make the purpose clear, including the bitwise power-of-two check. Code length: The implementation is concise without sacrificing understanding; imports and minor documentation formatting could be cleaned up. Action granularity: Each statement performs one clear action, first calculating XOR and then checking whether exactly one bit is set. Reading flow: Documentation, calculation, and result follow a natural sequence.
Run 2
Code Structure: The class contains one focused, logically organized method. Nesting: There is no nesting, making the implementation easy to scan. Clarity of intent: The method name, examples, descriptive variable, and power-of-two comment clearly explain the purpose and bitwise test. Code length: The implementation is concise, although unused wildcard imports, the redundant java.lang import, and slightly awkward Javadoc formatting add clutter. Action granularity: Each statement performs one clear action; the combined return conditions express a single predicate naturally. Reading flow: The code progresses smoothly from computing the XOR to checking whether exactly one bit is set. Returning primitive boolean rather than Boolean would better communicate that the result cannot be null.
Run 3
Code Structure: The class contains a single, logically organized method; unnecessary wildcard imports add minor clutter. Nesting: The method is flat, with no nested control flow. Clarity of intent: The descriptive method name, examples, and explanatory comment make the purpose clear, although the bitwise power-of-two test requires some familiarity. Code length: The implementation is concise without sacrificing explanation. Action granularity: Each statement performs one clear task: computing the XOR and testing whether exactly one bit is set. Reading flow: Documentation, calculation, and return follow a natural sequence. Minor distractions include the malformed Javadoc opening text and using boxed Boolean instead of primitive boolean.