Sample
int-692cf0837ed5-I03
Replace method, parameter, and local names with length-matched, meaningful but unrelated names
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.847 | 0–1; higher is more readable |
| Dorn | 0.272 | 0–1; higher is more readable |
| Mi | 0.462 | 0–1; higher is more readable |
| LLOC | 31 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 8 | 0–20; mean of three runs |
| GPT-6.1 Sol | 12 | 0–20; mean of three runs |
| BTTF | 0.505 | 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. | 2180.64 | −71.961 |
| 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.618 | −6.927 |
Intercept 8.87 + feature contributions = -16.418 (log-odds).
Score = sigmoid(-16.418) = 0.
| Score | 0.847 |
|---|
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.825 | +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. | 100.393 | +0.815 |
| 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. | 101.97 | −0.654 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.031 | +0.636 |
Intercept 0.07 + feature contributions = -0.986 (log-odds).
Score = sigmoid(-0.986) = 0.272.
| Score | 0.462 |
|---|
| Score | 31 |
|---|
Run 1
The code structure is logical with clear separation of fields, constructors, and methods, but it suffers from inconsistent and misleading variable naming (e.g., 'defaultMessage', 'invoice', 'feature', 'localToken', 'version', 'history', 'map', 'age', 'refreshEvent'). These obscure the actual purpose of parameters and methods, significantly reducing clarity. Nesting is shallow and action granularity is generally good, with one main operation per line. However, reading flow is disrupted by poorly named methods like 'handle' replacing 'escape' and 'refreshEvent' replacing 'escapeUnsafe'. The Javadoc is detailed and helpful, which aids understanding, but the obfuscated names create unnecessary cognitive load. The code length is appropriate and not overly verbose, but clarity of intent is compromised. Overall, it is maintainable but requires effort to map the confusing names to their intended meanings.
Run 2
The code is severely obfuscated through misleading naming, making it nearly unreadable. Method parameters like 'defaultMessage', 'invoice', 'feature', 'localToken', 'version', 'history', 'map', 'path', 'total', 'refreshEvent', and 'user' replace meaningful names such as 'replacementMap', 'safeMin', 'safeMax', 'escaperMap', 'string', 'c', and 'escapeUnsafe'. This destroys clarity of intent and makes the Javadoc contradictory to the code. While the structure is logical and nesting is moderate, the reading flow is broken by these names. The boolean condition in the 'handle(String)' method combines multiple checks on a single line, reducing action granularity. The class-specific logic (Character.MIN_VALUE/MAX_VALUE) appears inverted. Overall, the code requires significant mental mapping to understand, despite its underlying reasonable organization.
Run 3
The code's structure and general documentation are reasonable, but the heavily obfuscated variable and method names (e.g., 'defaultMessage', 'invoice', 'feature', 'localToken', 'version', 'history', 'refreshEvent', 'handle(String map)') make the intent highly ambiguous. This severely undermines clarity and readability. The constructors have confusing logic where the parameters representing safeMin and safeMax are swapped during assignment, which adds to the lack of clarity. Additionally, the code is unnecessarily long due to verbose and duplicated Javadoc comments, and some method and parameter names are misleading. Nesting is moderate but not deeply problematic. The reading flow is disorganized because of these naming issues, making it difficult to follow the purpose without significant mental mapping.
Run 1
Code Structure: Fields, constructors, optimized string processing, and character processing are logically organized. Nesting: Control flow is shallow, with at most a loop and conditional or two nested conditionals. Clarity of intent: This is the main weakness; unrelated names such as invoice, history, age, path, and refreshEvent obscure escaping semantics. Javadoc parameter names and references to escapeUnsafe do not match the declarations, creating misleading documentation. Code length: Implementation methods are concise, although extensive and partially repetitive documentation increases reading effort. Action granularity: Statements generally perform one action per line, with conventional loop syntax and a manageable compound condition. Reading flow: Consistent formatting, early returns, and clear field names support straightforward reading, but inconsistent terminology and documentation force readers to reconstruct the relationship between inputs, safe bounds, and escaping behavior.
Run 2
Code Structure: Fields, constructors, and escaping methods are logically organized with well-separated responsibilities. Nesting: Shallow loops and conditionals, plus early returns, keep control flow manageable. Clarity of intent: Severely weakened by misleading names such as invoice, history, age, path, and refreshEvent. Documentation references parameter and method names absent from the declarations, creating confusion. Code length: Implementation is reasonably concise, but extensive, partly repetitive documentation adds reading overhead. Action granularity: Most statements perform one action per line; the compound condition is somewhat dense but understandable. Reading flow: Constructor delegation and lookup-first escaping logic follow a natural sequence, though inconsistent terminology forces readers to repeatedly infer meaning.
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 branching manageable. Clarity of intent: The main weakness is misleading names such as invoice, history, age, path, and refreshEvent, which obscure escaping concepts. Documentation refers to parameter and method names absent from the actual declarations, further undermining clarity. Code length: Implementation methods are concise, but extensive, partly repetitive documentation increases reading effort. Action granularity: Most lines perform one action; the loop header and compound condition are conventional exceptions. Reading flow: Constructor delegation and lookup-to-safe-range-to-fallback processing follow a natural sequence, but inconsistent terminology forces readers to repeatedly infer meanings.