Sample
int-2b0c9b0b84cb-I12
Inline all eligible single-use intermediate local variables
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.863 | 0–1; higher is more readable |
| Dorn | 0.272 | 0–1; higher is more readable |
| Mi | 0.468 | 0–1; higher is more readable |
| LLOC | 31 | 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.581 | 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. | 2136.485 | −70.504 |
| Source linesThe number of non-empty source lines. | 134 | +53.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.609 | −6.913 |
Intercept 8.87 + feature contributions = -14.947 (log-odds).
Score = sigmoid(-14.947) = 0.
| Score | 0.863 |
|---|
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. | 135 | −3.744 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 64 | +1.477 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 133.812 | +1.461 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 64 | −1.048 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 95.548 | +0.737 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.032 | +0.633 |
| 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.993 | −0.57 |
Intercept 0.07 + feature contributions = -0.984 (log-odds).
Score = sigmoid(-0.984) = 0.272.
| Score | 0.468 |
|---|
| Score | 31 |
|---|
Run 1
The code is highly readable with excellent structure and clarity. It demonstrates a logical organization with clear field declarations, well-documented constructors, and methods that follow a natural flow from public API to implementation details. Nesting is minimal with early returns and guard clauses that keep the code flat and easy to follow. Each action is generally on its own line, and variable names clearly express intent (e.g., replacementsLength, safeMin/safeMax). The Javadoc comments are thorough and provide helpful context about usage patterns and performance considerations. Methods are concise and focused, with the escape logic cleanly separated between fast-path array lookup and slow-path character-by-character processing. The only minor deduction is for the complex boolean condition in the escape method's loop, which requires careful reading to parse, and the slight repetition between the two constructor overloads. Overall, this is exemplary Java code that balances thorough documentation with clean implementation.
Run 2
The code is well-structured with clear separation of concerns, logical field ordering, and thorough Javadoc documentation. Nesting is minimal—conditional blocks are shallow and readable. Intent is clearly conveyed through meaningful method and variable names like escapeUnsafe, replacementsLength, and safeMin/safeMax. Code length is appropriate; comments and documentation add value without excess. Action granularity is good, with most lines performing a single operation. Reading flow is natural, moving from fields to constructors to public API to protected methods. The only minor readability costs are the slightly complex conditional in escape(String s) and a few high-level details in method contracts, but these are justified by performance and design constraints.
Run 3
The code is highly readable with clear logical organization, flat structure, and explicit intent. The class has a single responsibility, and each method is concise with one primary action per line. Javadoc comments thoroughly explain behavior, edge cases, and performance considerations. Naming is descriptive, and guard clauses reduce nesting. Minor deductions: the `escape` method contains a compound condition that could be slightly clearer if broken into helper methods, and the `escapeUnsafe` method name is noted as needing improvement. Overall, natural reading flow and minimal nesting make it easy to understand.
Run 1
Code Structure: Fields, constructors, public behavior, and subclass extension points are logically organized. Nesting: Control flow is shallow, with only a small nested replacement check; early returns keep paths easy to follow. Clarity of intent: Descriptive names and thorough documentation explain replacement lookup, safe ranges, and performance optimizations. The compound escape condition and inverted empty-range bounds require slightly more attention. Code length: Implementation is concise, though constructor documentation repeats some explanations and adds reading overhead. Action granularity: Statements generally perform one action per line; the conventional loop header is appropriate. Reading flow: Consistent formatting and a natural progression from initialization to escaping make the class easy to navigate. Minor distractions include unusual nullable-array annotation syntax, sparse spacing between field declarations, and an unresolved naming TODO.
Run 2
Code Structure: Fields, constructors, public escaping logic, and the subclass extension point are logically organized. Nesting: Control flow is shallow, with early returns limiting complexity; only the replacement lookup uses two nested conditionals. Clarity of intent: Descriptive names and thorough documentation explain replacement precedence, safe ranges, and performance choices. The compound condition in escape(String) and unusual nullable-array syntax require slightly more attention. Code length: Implementation is concise, although constructor documentation repeats information and some field comments restate names. Action granularity: Each statement generally performs one action, with no compressed multi-statement lines. Reading flow: Initialization proceeds naturally into string scanning, character handling, and fallback escaping. Minor spacing inconsistencies and the unresolved naming TODO slightly reduce polish.
Run 3
Code Structure: Fields, constructors, and escaping methods are logically organized, with constructor delegation avoiding duplicated initialization. Nesting: Control flow is shallow, with at most two nested conditionals and early returns simplifying paths. Clarity of intent: Descriptive names and thorough documentation explain replacement lookup, safe ranges, and subclass responsibilities; the compound escape condition and empty-range normalization require some attention. Code length: Implementation is concise, although repeated constructor documentation adds length. Action granularity: Statements generally perform one action per line, and assignments and checks are clearly separated. Reading flow: The progression from configuration to string scanning, character lookup, and subclass handling is natural. Minor distractions include sparse spacing around imports, unusual type-use annotation syntax, and the unresolved naming TODO.