Sample
int-5182c1a52b65-I05
Rewrite eligible decimal integer literals in hexadecimal notation
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.865 | 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 | 17.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs |
| BTTF | 0.303 | 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. | 2149.287 | −70.926 |
| 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.61 | −6.915 |
Intercept 8.87 + feature contributions = -15.372 (log-odds).
Score = sigmoid(-15.372) = 0.
| Score | 0.865 |
|---|
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.792 | +1.46 |
| 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 and well-structured. It has a clear class-level Javadoc explaining purpose and usage, followed by clean field declarations with concise comments. The constructors are logically organized, with proper validation and edge-case handling. Methods are short and focused, with one action per line and minimal nesting (only single-level if statements). The escape() and escape(char) methods clearly indicate their logic flow, and comments at key performance optimizations enhance understanding. Variable names like safeMin, safeMax, replacementsLength, and escapeUnsafe are descriptive. The use of early returns (e.g., returning null when no escaping is required) keeps control flow flat and natural. The only minor deductions are for slightly long Javadoc comments in places and a TODO for method naming, but overall the code exemplifies clean, maintainable Java.
Run 2
The code is highly readable, with a clear logical structure and well-documented purpose. The class is organized into fields, constructors, and overridden methods that flow naturally. Javadoc comments explain non-obvious design choices, such as the safe range inversion and performance optimizations. Nesting is minimal and controlled, with only simple conditional blocks. Each method performs a single, clear action, and lines are appropriately granular—no multiple actions per line. The reading flow is natural, moving from construction to the main escape logic to single-character handling. Minor deductions are due to the slightly dense conditional in the `escape` method and reliance on implicit knowledge about the `ArrayBasedEscaperMap` structure.
Run 3
The code is well-structured and readable due to clear separation of concerns, concise helper methods, and thorough Javadoc. Field declarations are organized with explanatory comments, and constructors delegate logically. Nesting is minimal; the escape methods use flat conditional checks and early returns, avoiding deep indentation. Intent is clear: the class efficiently escapes characters using a lookup array and a safe range. Action granularity is appropriate—most lines perform one operation, and conditions are broken into readable expressions. The reading flow is natural, with documentation preceding each method explaining purpose and edge cases. Minor deductions stem from the somewhat complex boolean expression in escape(String) and slight verbosity in comments, but overall readability is high.
Run 1
Code Structure: Fields, constructors, and escaping methods are logically organized with clear separation of responsibilities. Nesting: Control flow is shallow, with at most two nested conditional levels and effective early returns. Clarity of intent: Descriptive names and detailed documentation explain replacement lookup, safe ranges, and performance considerations; the inverted empty-range representation and compound escape condition require some attention. Code length: Implementation is concise, though constructor documentation repeats information and some field comments are redundant. 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 follow. Minor distractions include the unusual hexadecimal zero initializer, specialized nullable-array syntax, and an unresolved naming TODO.
Run 2
Code Structure: Fields, constructors, public behavior, and subclass extension points are logically organized. Nesting: Control flow is shallow, with early returns keeping character escaping straightforward. Clarity of intent: Descriptive names and detailed documentation explain replacement precedence, safe ranges, and performance optimizations; the compound escape condition and inverted empty-range representation require some attention. Code length: Implementation is concise, although constructor documentation repeats information and comments occasionally restate obvious fields. Action granularity: Statements generally perform one action per line; standard loop syntax is easy to follow. Reading flow: Consistent formatting and method ordering support natural reading. Minor distractions include the unusual hexadecimal zero initializer, specialized nullable-array syntax, and an unresolved naming TODO.
Run 3
Code Structure: Fields, constructors, public escaping logic, and the subclass extension point are logically organized. Nesting: Control flow is shallow, with at most two nested conditional levels and early returns. Clarity of intent: Descriptive names and thorough documentation explain replacement precedence, safe ranges, and performance optimizations; the compound escape condition and unusual 0x0 initializer slightly reduce clarity. Code length: Implementation is concise, although constructor documentation repeats information and some field comments restate names. Action granularity: Statements generally perform one action per line; the loop header and combined condition are conventional exceptions. Reading flow: Constructor delegation and the progression from explicit replacements to safe-range checks to fallback escaping are natural. Minor formatting issues, unusual array annotation syntax, and the unresolved naming TODO add small distractions.