Sample
int-db087f0ac5a2-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.723 | 0–1; higher is more readable |
| Dorn | 0.377 | 0–1; higher is more readable |
| Mi | 0.488 | 0–1; higher is more readable |
| LLOC | 34 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 14 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs |
| BTTF | 0.423 | 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. | 2457.592 | −81.101 |
| Source linesThe number of non-empty source lines. | 114 | +45.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.509 | −6.764 |
Intercept 8.87 + feature contributions = -33.394 (log-odds).
Score = sigmoid(-33.394) = 0.
| Score | 0.723 |
|---|
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. | 114 | −3 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 70 | +1.684 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 113.901 | +1.182 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 69 | −1.163 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 99.93 | +0.808 |
| 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. | 99.965 | −0.569 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.047 | +0.484 |
Intercept 0.07 + feature contributions = -0.503 (log-odds).
Score = sigmoid(-0.503) = 0.377.
| Score | 0.488 |
|---|
| Score | 34 |
|---|
Run 1
The code demonstrates good structure with a single purpose class, clear field names, and useful Javadoc comments explaining the purpose and timeline usage. Nesting is minimal, and methods are short with reasonable action granularity. However, readability is hurt by cryptic constructs like `final int a = 1; final int b = -1;` used to create zero, and similarly meaningless variable names in `lastRedundantOffset()`. These obfuscate intent and violate the principle of clarity. The `findRedundantOffset` logic is non-obvious, and the early return inside the loop when `soFar == lastRedundantOffset.get()` could be confusing. The variable `soFar` is acceptable but could be more descriptive. Overall the code is readable for domain experts but contains unnecessary obscurity and could benefit from cleaner constant definitions and better comments around tricky logic.
Run 2
The code has a clear purpose and the class's intent is documented, but several factors reduce readability. Unnecessarily obfuscated constructs like `(a + b)` and `(c + d)` for zero are confusing and lack justification. The `findRedundantOffset` method has a loop with a condition that always returns `soFar`, making the early-return logic misleading and the comment over-complex. The `updateState` method mixes state updates, conditional logic, and side effects without clear separation. Action granularity is mostly fine, but the dense comments disrupt flow. The structure is acceptable but could be improved by simplifying methods and removing magic variables. Overall, the code is understandable but requires extra effort, and the confusing patterns detract from clarity.
Run 3
The code is generally readable with clear class-level documentation and logical organization. The class has a single well-defined responsibility. Nesting is flat and methods are concise. Action granularity is mostly one operation per line. However, a few issues hurt clarity: the use of magic expressions like '(a + b)' and '(c + d)' with meaningless variable names is confusing and should be constants like ZERO or INVALID_OFFSET. The unused variables 'a', 'b', 'c', 'd' are unnecessary and obscure intent. The loop in findRedundantOffset has good inline comments but the logic could be clearer. The updateState method mixes state updates with deletion handling in a slightly awkward order. Overall, naming is descriptive and the code follows a natural flow, making it readable despite minor clarity improvements.
Run 1
Code Structure: Cohesive class with clearly separated initialization, state updates, minimum-offset calculation, and accessors. Nesting: Shallow conditionals and a single loop keep control flow easy to follow. Clarity of intent: Descriptive method names and documentation explain the purpose, but arbitrary variables a, b, c, and d obscure simple zero values; soFar is also less descriptive than minimumOffset. The name lastRedundantOffset contrasts somewhat with comments describing the smallest necessary offset. Code length: Methods are concise, although lengthy comments and unnecessary arithmetic add noise. Action granularity: Statements generally perform one action per line, making mutations easy to identify. Reading flow: Organization and early returns support natural reading, but understanding why deletion occurs after minimum-offset calculation requires extra attention. Overall, readable and well organized, with avoidable distractions and some semantic ambiguity.
Run 2
Code Structure: Fields, initialization, updates, calculation, and accessors are logically separated into focused methods. Nesting: Shallow conditionals and a single loop keep complexity low; early returns help. Clarity of intent: Descriptive method names and documentation explain offset tracking, but arbitrary variables a, b, c, and d obscure simple zero constants. The distinction between a redundant offset and the smallest necessary offset is also somewhat confusing. Code length: Methods are concise, but lengthy comments and unnecessary constant arithmetic add clutter. Action granularity: Statements generally perform one action per line, making state changes easy to follow. Reading flow: Organization is natural, though the sentinel handling and deletion occurring after minimum calculation require careful reading to understand. Overall, readable and well organized, with avoidable distractions and some semantic ambiguity.
Run 3
Code Structure: Fields, constructor, update logic, helper, and accessors are logically organized with clear responsibilities. Nesting: Shallow conditionals and a single loop keep control flow easy to follow; early returns help. Clarity of intent: Descriptive method names and documentation explain offset tracking, but arbitrary variables a, b, c, and d obscure simple zero constants. The relationship between lastRedundantOffset and the smallest necessary offset also requires careful interpretation. Code length: Implementation is reasonably concise, though verbose comments and unnecessary arithmetic add clutter. Action granularity: Statements generally perform one action per line, making state changes easy to identify. Reading flow: Overall progression is natural, but the deletion occurring after minimum-offset calculation requires closer reading, and repeated explanatory comments interrupt the otherwise straightforward logic.