Sample
int-725318bfed1b-I11
Split eligible integer literals into pairs of short-named intermediate variables
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.87 | 0–1; higher is more readable |
| Dorn | 0.464 | 0–1; higher is more readable |
| Mi | 0.584 | 0–1; higher is more readable |
| LLOC | 31 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 14.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15 | 0–20; mean of three runs |
| BTTF | 0.3 | 0–1; higher is more readable |
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. | 2281.601 | −75.293 |
| Source linesThe number of non-empty source lines. | 61 | +24.4 |
| 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.803 | −7.204 |
Intercept 8.87 + feature contributions = -49.227 (log-odds).
Score = sigmoid(-49.227) = 0.
| Score | 0.87 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 62 | −1.159 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 51 | +1.027 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 97.952 | +0.776 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 51 | −0.749 |
| 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. | 97.968 | −0.484 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 60.879 | +0.441 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.104 | −0.065 |
Intercept 0.07 + feature contributions = -0.143 (log-odds).
Score = sigmoid(-0.143) = 0.464.
| Score | 0.584 |
|---|
| Score | 31 |
|---|
Run 1
The code is fairly readable with clear intent and logical structure, but has some stylistic issues that reduce its score. The structure is straightforward: a utility class with a single method. Nesting is moderate—the if-else chain for primitive types is acceptable but could be flattened with a switch or map. Clarity of intent is good: the Javadoc and method name make the purpose clear. Code length is reasonable but some parts are unnecessarily verbose, such as the artificial `final int a = 1; final int b = -1; return (a + b);` patterns, which obscure the simple goal of returning zero for numeric types. Action granularity is mostly one action per line, but those multi-line zero computations violate this principle. Reading flow is mostly natural, though the odd workarounds for byte/short/int/long defaults interrupt comprehension. Overall, the code is understandable but could be significantly cleaner with direct returns or a switch expression.
Run 2
The code is generally well-structured and readable, with a clear purpose and good documentation. However, there are some readability issues. The method uses a single multi-branch if-else chain for primitive types, which is not deeply nested but could be improved for clarity. The lines declaring local variables like 'final int a = 1; final int b = -1;' for each numeric type are unnecessarily verbose and arguably reduce readability compared to using a simple literal like (byte) 0. These extra lines also slightly impact the action granularity and reading flow. The class structure and naming are good, and the use of constants for float and double defaults is sensible. Overall, it is readable but not exemplary.
Run 3
The code is well-structured, with clear intent and logical organization. The class is final with a private constructor, annotations are used appropriately, and Javadoc explains the purpose. Nesting is shallow, and the method follows a simple if-else chain over primitive types, making the flow easy to follow. Action granularity is mostly one action per line, though local variables like 'a + b = 0' are unnecessary and slightly obscure intent. The method is concise overall, and the use of constants for float/double defaults improves readability. Minor deductions for redundant local variables and some casts that could be clearer, but overall the code is highly readable and maintainable.
Run 1
Code Structure: A focused utility class with a single method and logically ordered type checks. Nesting: Only two conditional levels, though the long else-if chain requires scanning. Clarity of intent: Documentation and method naming clearly explain the purpose, but variables a through h and arithmetic expressions obscure simple zero defaults. Code length: Mostly concise, with unnecessary variable declarations and calculations in four branches. Action granularity: Each declaration and return occupies its own line, making individual operations easy to follow. Reading flow: Consistent formatting and sequential primitive-type handling support natural reading, but the artificial arithmetic interrupts an otherwise straightforward pattern.
Run 2
Code Structure: A focused utility class with a logically organized primitive-type dispatch. Nesting: Only two conditional levels, although the long else-if chain adds scanning effort. Clarity of intent: Documentation and method naming clearly explain the purpose, but computing zero through pairs of vaguely named variables obscures otherwise straightforward returns. Code length: Mostly concise, with unnecessary declarations and arithmetic in the byte, short, int, and long branches. Action granularity: Each statement performs one action, making individual steps easy to follow. Reading flow: Type checks follow a predictable sequence and end with a clear null fallback; however, redundant arithmetic interrupts the flow and inconsistent handling of numeric defaults reduces uniformity.
Run 3
Code Structure: The utility class and single method are logically organized, with a straightforward type-dispatch chain. Nesting: Two conditional levels are manageable, though the primitive guard adds some indentation. Clarity of intent: Documentation, method naming, and explicit type checks clearly explain the purpose; however, variables a through h and arithmetic expressions obscure the simple intent of returning zero. Code length: Generally compact, but the unnecessary variable declarations and additions inflate four branches. Action granularity: Each statement performs one action, making individual steps easy to follow. Reading flow: The sequential type checks and final null return are predictable and natural, but the inconsistent treatment of numeric defaults interrupts the pattern and adds avoidable cognitive effort.