Sample
int-8ab022c591e3-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.88 | 0–1; higher is more readable |
| Dorn | 0.271 | 0–1; higher is more readable |
| Mi | 0.468 | 0–1; higher is more readable |
| LLOC | 33 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 16.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs |
| BTTF | 0.381 | 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. | 2269.361 | −74.889 |
| Source linesThe number of non-empty source lines. | 136 | +54.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.611 | −6.916 |
Intercept 8.87 + feature contributions = -18.535 (log-odds).
Score = sigmoid(-18.535) = 0.
| Score | 0.88 |
|---|
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. | 137 | −3.814 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 66 | +1.546 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 135.752 | +1.488 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 66 | −1.094 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 97.029 | +0.761 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.033 | +0.622 |
| 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.985 | −0.57 |
Intercept 0.07 + feature contributions = -0.991 (log-odds).
Score = sigmoid(-0.991) = 0.271.
| Score | 0.468 |
|---|
| Score | 33 |
|---|
Run 1
The code is very readable for a utility class. It has a clear, logical structure with concise Javadoc explaining intent and edge cases. Methods are short and focused, with one primary action per line. Nesting is minimal, mostly limited to simple if-statements. Naming is descriptive. Minor issues include a slightly cryptic optimized expression 'int a = 1; int b = -1;' instead of just 'int i = 0;', and some inherent complexity around the safe range inversion logic. Overall, it demonstrates good organization and flow.
Run 2
The code is highly readable due to its clear structure, extensive Javadoc, and logical organization. Methods are small and focused, with flat nesting and a natural reading flow. The constructors and escape methods separate concerns well, and comments clarify non-obvious logic. Minor issues include a slightly awkward loop initialization in escape() using `(a + b)` and some dense conditional expressions, but these are short and well-explained.
Run 3
The code is well-structured with clear class-level documentation, meaningful field names, and logically organized constructors. However, the escape(String s) method introduces confusing unnecessary variables (a and b) that obscure the loop's start index, reducing clarity. There is also some repetitive constructor documentation. Nesting is generally flat, and action granularity is fine, but the conditional in escape() mixes array bounds checking with null and range checks, slightly affecting readability. Overall, the code is maintainable but could be improved by removing the odd a/b variables and simplifying some method comments.
Run 1
Code Structure: Fields, constructors, and escaping methods are logically organized with clear responsibilities. Nesting: Control flow is shallow, with at most two nested conditionals and straightforward early returns. Clarity of intent: Descriptive names and detailed documentation explain replacement lookup and safe-range behavior; however, the arbitrary constants a and b obscure the simple zero initialization of the loop. Code length: Implementation is compact, though constructor documentation repeats information and the unnecessary constants add clutter. Action granularity: Statements generally perform one action per line, making assignments and decisions easy to follow. Reading flow: The progression from initialization to string scanning, character handling, and subclass customization is natural. The compound scanning condition requires some attention, and minor formatting inconsistencies slightly reduce readability.
Run 2
Code Structure: Fields, constructors, and escaping methods are logically organized, with clear separation of responsibilities. Nesting: Control flow is shallow, and early returns keep the character-escaping logic straightforward. Clarity of intent: Descriptive names and thorough documentation explain replacement lookup and safe-range handling; however, a and b obscure an otherwise simple zero initialization. Code length: Implementation methods are concise, but repeated constructor documentation and unnecessary constants add avoidable length. Action granularity: Statements generally perform one action per line, making assignments and checks easy to follow. Reading flow: Constructor delegation and lookup-before-range-check ordering are natural. The compound condition in escape(String) requires some attention, and initializing i with (a + b) unnecessarily interrupts an otherwise clear flow.
Run 3
Code Structure: Fields, constructors, and escaping methods are logically organized, with clear separation of responsibilities. Nesting: Control flow is shallow, and early returns keep both escape methods easy to follow. Clarity of intent: Descriptive names and detailed documentation explain replacement lookup, safe ranges, and subclass behavior. However, the arbitrary a and b constants and (a + b) loop initialization obscure a simple zero starting index. Code length: Implementation is compact, but constructor documentation repeats information and some field comments merely restate names. Action granularity: Statements generally perform one action per line, with no compressed multi-statement lines. Reading flow: Constructor delegation and lookup-first escaping produce a natural progression; the compound condition in escape(String) requires some attention, and the unnecessary arithmetic interrupts otherwise straightforward reading.