Sample
int-685e079a5885-I12
Inline all eligible single-use intermediate local variables
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.854 | 0–1; higher is more readable |
| Dorn | 0.497 | 0–1; higher is more readable |
| Mi | 0.584 | 0–1; higher is more readable |
| LLOC | 23 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 18 | 0–20; mean of three runs |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs |
| BTTF | 0.448 | 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. | 1795.802 | −59.261 |
| Source linesThe number of non-empty source lines. | 53 | +21.2 |
| 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.895 | −7.343 |
Intercept 8.87 + feature contributions = -36.534 (log-odds).
Score = sigmoid(-36.534) = 0.
| Score | 0.854 |
|---|
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. | 54 | −0.876 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 97.981 | +0.776 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 43 | +0.75 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 43 | −0.566 |
| 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.981 | −0.485 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 52.848 | +0.329 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.098 | −0.012 |
Intercept 0.07 + feature contributions = -0.013 (log-odds).
Score = sigmoid(-0.013) = 0.497.
| Score | 0.584 |
|---|
| Score | 23 |
|---|
Run 1
The code is highly readable. It has a clear, logical structure: a private constructor, constants, and a single public method. The method's Javadoc clearly explains the intent and edge cases. Nesting is shallow (only two levels), and action granularity is one action per line within the if-else chain. The chain of primitive type checks is explicit and follows a natural order, though it is somewhat verbose; a switch statement or map could reduce length, but the current form prioritizes clarity. The only minor drawbacks are the unchecked casts and the suppressions, which slightly obscure the type-safety rationale. Overall, the code is straightforward, self-documenting, and easy to follow.
Run 2
The code is highly readable. The structure is logical and well-organized, with a clear class purpose documented in Javadoc. The method is concise and purpose-built. Nesting is shallow, with a single if-else chain inside an outer if that handles primitive types. Intent is immediately clear: return the JLS default for a given type. Action granularity is consistent, with one meaningful operation per line (cast and return). The reading flow is natural, checking non-null first, then handling primitives, and finally returning null for objects. The if-else chain is straightforward and avoids unnecessary complexity. Minor deductions: using both primitive wrappers and constants (FLOAT_DEFAULT, DOUBLE_DEFAULT) without explanation slightly breaks consistency, and repeated 'return (T)' casts add some visual noise. Overall, excellent readability in a utility method.
Run 3
The code is highly readable. Structure is logical: a final utility class with a private constructor, clear constant declarations, and a single-purpose method. Nesting is shallow—a two-level if/else chain is manageable given the unavoidable enumeration of primitives. Intent is clearly documented via Javadoc and method naming. Code length is appropriate; it handles all eight primitive types without redundancy. Each return statement is on its own line, maintaining action granularity. Reading flow is natural: null check, primitive verification, type-by-type dispatch, then fallback null return. The only minor blemish is the repetitive if/else chain, but a switch would not materially improve clarity for Class objects. Overall, this is a model of straightforward utility code.
Run 1
Code Structure: A well-organized utility class with a single focused method, clearly separated constants, and useful documentation. Nesting: Limited to two conditional levels; the primitive-type guard adds minor indentation. Clarity of intent: Descriptive names and Javadoc make the purpose and special cases explicit, though generic casts introduce slight complexity. Code length: Appropriately concise; the repetitive conditional chain is justified by distinct primitive types. Action granularity: Each statement performs one clear action, with no crowded lines. Reading flow: Validation, primitive checks, type-specific returns, and the null fallback follow a natural sequence. Minor drawbacks are the long else-if chain and lack of spacing between package and import sections.
Run 2
Code Structure: A focused utility class with clearly organized constants and a single public method. Nesting: Only two levels, though the outer primitive check adds some indentation. Clarity of intent: Descriptive names and precise documentation make the default-value behavior explicit; generic casts introduce minor complexity. Code length: Appropriately concise, with repetitive branches justified by distinct primitive types. Action granularity: Each statement performs one clear action, and each branch returns a single value. Reading flow: Validation, primitive dispatch, and the null fallback follow a natural sequence. Minor drawbacks are the lengthy else-if chain and cramped spacing around the package and imports.
Run 3
Code Structure: A focused utility class with logically organized constants and a single public method. Nesting: Only two conditional levels, though the outer primitive check adds slight indentation. Clarity of intent: Descriptive names and precise documentation clearly explain the default-value behavior, including null for void and reference types. Code length: Appropriately concise; the repetitive type checks are straightforward and justified. Action granularity: Each check and return performs one clear action, with no crowded statements. Reading flow: Validation, primitive handling, and the final null fallback follow a natural sequence. Minor drawbacks are the lengthy else-if chain and unchecked generic casts, which require some Java type-system knowledge.