Sample
int-440989a2fa4e-I01
Remove line comments, block comments, and Javadoc
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.593 | 0–1; higher is more readable |
| Dorn | 0.043 | 0–1; higher is more readable |
| Mi | 0.685 | 0–1; higher is more readable |
| LLOC | 56 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 17.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs |
| BTTF | 0.459 | 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. | 5431.521 | −179.24 |
| Source linesThe number of non-empty source lines. | 171 | +68.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. | 5.101 | −7.652 |
Intercept 8.87 + feature contributions = -109.622 (log-odds).
Score = sigmoid(-109.622) = 0.
| Score | 0.593 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 171 | +5.178 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 172 | −5.054 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 171 | −3.503 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 170.832 | +1.978 |
| 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. | 105.948 | −0.822 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.111 | −0.14 |
Intercept 0.07 + feature contributions = -3.098 (log-odds).
Score = sigmoid(-3.098) = 0.043.
| Score | 0.685 |
|---|
| Score | 56 |
|---|
Run 1
The code is highly readable and follows clear structural patterns. The class has a single responsibility: making HttpHeaders read-only. Methods are short, flat, and use early returns in the caching checks, avoiding deep nesting. Intent is explicit—mutating methods throw UnsupportedOperationException, while read methods return unmodifiable views. The use of annotations and whitespace improves clarity. Action granularity is mostly one action per line, though the headerSet() method has a slightly complex stream chain that could be simplified for readability. The forEach method contains a ternary that is understandable but slightly dense. Overall, the code is concise, well-organized, and follows a natural reading flow typical of Spring Framework style.
Run 2
The code is highly readable with clear structure and purpose. It follows a consistent pattern: read-only overrides throw UnsupportedOperationException while getters return unmodifiable wrappers. The class is flat with minimal nesting, using simple if-else blocks for caching. Method names clearly communicate intent (clearContentHeaders, toSingleValueMap, etc.). The code is concise without unnecessary verbosity, though the headerSet() method could benefit from being split for clarity. The forEach method has slightly higher complexity with a conditional expression in one line, but still remains one action per line overall. Reading flow is natural, grouping related methods together and preserving the original HttpHeaders method order. The only minor drawback is the excessive blank lines in the imports section and the somewhat dense headerSet() stream operation. Overall, this is excellent production-quality code that balances immutability requirements with readability.
Run 3
The code is highly readable due to its clear structure, consistent formatting, and straightforward intent. Each method has a single responsibility, and the class purpose—providing an immutable view of HTTP headers—is evident. Nesting is minimal, with simple if-else blocks for caching and no deeply indented logic. The use of descriptive method names and standard Java collections aligns with typical readability expectations. While some methods (e.g., headerSet) use streams with multiple operations, the formatting keeps them understandable. The repetition of UnsupportedOperationException is intentional and clear for immutability. Overall, the code is concise, well-organized, and easy to follow, with only minor verbosity in deprecated overrides preventing a perfect score.
Run 1
Code Structure: Small, focused overrides logically implement a read-only headers wrapper, though accessors and mutators are somewhat interspersed. Nesting: Mostly flat, with only simple conditionals and one loop; the collector expression is slightly harder to scan. Clarity of intent: Descriptive names, unmodifiable wrappers, and consistent exceptions clearly communicate the purpose, but the empty clearContentHeaders override lacks an explanation. Code length: Reasonably concise given the required overrides, although repeated exception methods and excessive blank lines add visual bulk. Action granularity: Statements generally perform one action per line; stream chaining combines several transformations but remains manageable. Reading flow: Consistent formatting and straightforward methods support natural reading, while unnecessary else blocks after returns, uneven whitespace, and the dense headerSet pipeline introduce minor friction.
Run 2
Code Structure: The class is logically organized around read-only header access and blocked mutations, though related read and mutation methods could be grouped more consistently. Nesting: Mostly flat methods with only shallow conditionals and one loop; the collector expression is somewhat denser. Clarity of intent: The class name, descriptive methods, and unmodifiable wrappers communicate purpose clearly, but the unexplained empty clearContentHeaders override is ambiguous. Code length: Most methods are concise; repeated exception-throwing overrides are understandable API boilerplate, while excessive blank lines add unnecessary length. Action granularity: Statements generally perform one action per line, although stream chaining and the conditional argument in forEach require more parsing. Reading flow: Consistent formatting and override annotations make scanning easy, but scattered method categories, redundant else blocks after returns, and the compact headerSet pipeline slightly interrupt the flow.
Run 3
Code Structure: Clearly organized as a read-only HttpHeaders subclass, although read accessors and mutation overrides could be grouped more consistently. Nesting: Shallow conditionals and a single loop make control flow easy to follow; the headerSet collector is somewhat denser. Clarity of intent: Descriptive names, overrides, and unmodifiable wrappers communicate the purpose well, but the unexplained empty clearContentHeaders method is ambiguous. Code length: Most methods are concise; repeated exception-throwing overrides are understandable API boilerplate, while excessive blank lines add unnecessary length. Action granularity: Statements generally perform one action per line, with some complexity concentrated in chained stream operations. Reading flow: Consistent formatting and predictable methods support natural reading, though redundant else branches after returns, uneven spacing, and interspersed method categories slightly disrupt it.