Sample
int-e64a0aab2068-I12
Inline all eligible single-use intermediate local variables
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.597 | 0–1; higher is more readable |
| Dorn | 0.194 | 0–1; higher is more readable |
| Mi | 0.749 | 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 | 18 | 0–20; mean of three runs |
| BTTF | 0.477 | 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.11 | −7.666 |
Intercept 8.87 + feature contributions = -109.636 (log-odds).
Score = sigmoid(-109.636) = 0.
| Score | 0.597 |
|---|
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. | 172 | −5.054 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 160 | +4.797 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 160 | −3.251 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 170.832 | +1.978 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 105.942 | +0.905 |
| 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 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.102 | −0.048 |
Intercept 0.07 + feature contributions = -1.425 (log-odds).
Score = sigmoid(-1.425) = 0.194.
| Score | 0.749 |
|---|
| Score | 56 |
|---|
Run 1
This code is highly readable. Structure is logical, grouping mutating methods that throw exceptions and read methods that return unmodifiable views. Nesting is minimal, with simple if-else caching blocks and a small lambda pipeline. Intent is clear: a read-only wrapper offering cached parsed headers and defensive copies. Code length is appropriate, with small focused methods. Action granularity is mostly one action per line; the headerSet lambda and forEach expression are slightly denser but still understandable. Reading flow is natural, following class declaration, caching methods, no-op overrides, mutators, accessors, and iteration helpers.
Run 2
The code is highly readable due to its clear structure, flat nesting, and consistent patterns. Each method has a single responsibility, following the 'one action per line' principle well. The class purpose is clearly documented, and method names/intents are self-evident. Error handling for immutable operations is concise and uniform. The caching logic in getContentType() and getAccept() is straightforward, though slightly verbose—could be compacted with ternary or helper method but remains clear. headerSet() introduces moderate complexity with streams but is well-commented for ordering rationale. Imports are logical and no unnecessary length is present. Overall, the code reads naturally from top to bottom, with minimal nesting (only one level) and no tangled logic.
Run 3
The code is highly readable, well-structured, and follows consistent patterns. The class has a clear single responsibility (immutable HttpHeaders wrapper), with methods logically grouped by mutating vs non-mutating operations. Nesting is minimal—only simple if/else blocks for caching. Intent is explicit throughout: mutating methods throw UnsupportedOperationException, while read methods wrap returned collections in unmodifiable views. Code length is justified by the API surface required. Each method performs one action clearly. The only slightly complex method is headerSet(), which uses a stream pipeline with a comment clarifying ordering intent, but it remains readable. The class-level Javadoc appropriately documents the caching caveat. Naming follows standard Java/Spring conventions. Overall, the code is maintainable and self-explanatory.
Run 1
Code Structure: Well-organized class with short, focused overrides, though grouping all mutators together would improve organization. Nesting: Shallow conditionals and a single loop keep complexity low; redundant else blocks could be removed. Clarity of intent: The class name, documentation, descriptive identifiers, and consistent exceptions clearly communicate read-only behavior and caching limitations. Code length: Most methods are concise; repetitive mutation-blocking overrides add length but serve the interface contract. Action granularity: Statements generally perform one action each, although the headerSet stream pipeline combines several transformations. Reading flow: Consistent formatting and familiar override patterns make scanning easy. The nested collectors in headerSet and scattered read/write methods slightly interrupt an otherwise natural flow.
Run 2
Code Structure: Well-organized class with focused overrides, though read methods and prohibited mutators are somewhat interleaved. Nesting: Shallow conditionals and a single loop keep complexity low; the nested collector expression is slightly harder to scan. Clarity of intent: The class name, documentation, unmodifiable wrappers, and explicit exceptions clearly communicate read-only behavior and caching limitations. Code length: Most methods are concise; repeated exception-only overrides add length but are justified by the inherited API. The cache getters could omit their else branches after early returns. Action granularity: Statements generally perform one action per line, although stream chaining and the conditional argument in forEach combine several operations. Reading flow: Consistent formatting, annotations, and descriptive names support natural reading, with minor friction from method ordering and the headerSet collector.
Run 3
Code Structure: Well-organized class with short overrides, though read operations and mutation-blocking methods are somewhat interspersed. Nesting: Shallow conditionals and a single loop make control flow easy to follow; caching methods could omit their redundant else branches. Clarity of intent: The class name, documentation, descriptive identifiers, and consistent exceptions clearly express read-only behavior and caching limitations. Code length: Mostly concise; repeated exception-throwing overrides add length but are justified by the inherited API. Action granularity: Statements generally perform one action each, although headerSet combines several transformations in a denser stream pipeline. Reading flow: Consistent formatting and predictable method implementations support smooth reading, with minor interruptions from annotations, repeated boilerplate, and the collector expression.