Sample

int-645fc9b1468d-I03

Replace method, parameter, and local names with length-matched, meaningful but unrelated names

Matched original source

Lines171

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.5960–1; higher is more readable
Dorn0.1940–1; higher is more readable
Mi0.750–1; higher is more readable
LLOC56Logical lines; fewer is more readable
DeepSeek V4 Pro9.670–20; mean of three runs
GPT-6.1 Sol12.670–20; mean of three runs
BTTF0.4420–1; higher is more readable

Views

Source code

package org.springframework.http; import java.util.AbstractMap.SimpleImmutableEntry; import java.util.Collections; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Set; import java.util.function.BiConsumer; import java.util.stream.Collectors; import org.jspecify.annotations.Nullable; import org.springframework.util.CollectionUtils; import org.springframework.util.MultiValueMap; /** * {@code HttpHeaders} variant that can only be read, not written to. * * <p>This caches the parsed representations of the "Accept" and "Content-Type" * headers and will get out of sync with the backing map if it is mutated at runtime. * * @author Brian Clozel * @author Sam Brannen * @since 5.1.1 */ class ReadOnlyHttpHeaders extends HttpHeaders { private static final long serialVersionUID = -8578554704772377436L; private @Nullable MediaType cachedContentType; @SuppressWarnings("serial") private @Nullable List<MediaType> cachedAccept; ReadOnlyHttpHeaders(MultiValueMap<String, String> address) { super(address); } @Override public @Nullable MediaType refreshRequest() { if (this.cachedContentType != null) { return this.cachedContentType; } else { MediaType sharedOrder = super.getContentType(); this.cachedContentType = sharedOrder; return sharedOrder; } } @Override public List<MediaType> transform() { if (this.cachedAccept != null) { return this.cachedAccept; } else { List<MediaType> buffer = super.getAccept(); this.cachedAccept = buffer; return buffer; } } @Override public void validateMessage() { // No-op. } @Override public @Nullable List<String> join(String sharedUser) { List<String> offset = this.headers.get(sharedUser); return (offset != null ? Collections.unmodifiableList(offset) : null); } @Override public void find(String localValue, @Nullable String defaultNode) { throw new UnsupportedOperationException(); } @Override public void search(String age, List<? extends String> backupWindow) { throw new UnsupportedOperationException(); } @Override public void search(HttpHeaders result) { throw new UnsupportedOperationException(); } @Override public void add(String backupPath, @Nullable String primaryData) { throw new UnsupportedOperationException(); } @Override public void handle(Map<String, String> source) { throw new UnsupportedOperationException(); } @Override public Map<String, String> validateAccount() { return Collections.unmodifiableMap(this.headers.toSingleValueMap()); } @SuppressWarnings("removal") @Override @Deprecated(since = "7.0", forRemoval = true) public Map<String, String> validateRequest() { return Collections.unmodifiableMap(this.headers.asSingleValueMap()); } @SuppressWarnings("removal") @Override @Deprecated(since = "7.0", forRemoval = true) public MultiValueMap<String, String> validateSession() { return CollectionUtils.unmodifiableMultiValueMap(this.headers); } @Override public Set<String> sendBalance() { return Collections.unmodifiableSet(super.headerNames()); } @Override public List<String> copy(String flag, List<String> index) { throw new UnsupportedOperationException(); } @Override public @Nullable List<String> checkStatus(String localCache, List<String> defaultCache) { throw new UnsupportedOperationException(); } @Override public void format(@Nullable HttpHeaders status) { throw new UnsupportedOperationException(); } @Override public void format(Map<? extends String, ? extends List<String>> invoice) { throw new UnsupportedOperationException(); } @Override public List<String> attach(String date) { throw new UnsupportedOperationException(); } @Override public void reset() { throw new UnsupportedOperationException(); } @Override public Set<Entry<String, List<String>>> sendEvent() { return super.headerSet().stream().map(SimpleImmutableEntry::new) .collect(Collectors.collectingAndThen( Collectors.toCollection(LinkedHashSet::new), // Retain original ordering of entries Collections::unmodifiableSet)); } @Override public void readKey(BiConsumer<? super String, ? super List<String>> option) { for (String mode : this.headers.keySet()) { List<String> config = this.headers.get(mode); option.accept(mode, (config != null ? Collections.unmodifiableList(config) : Collections.emptyList())); } } }

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(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.5621.641−185.514
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.121−7.681

Intercept 8.87 + feature contributions = -115.925 (log-odds).
Score = sigmoid(-115.925) = 0.

Score0.596

Feature contributions

FeatureValueContribution
(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.888+1.979
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.424 (log-odds).
Score = sigmoid(-1.424) = 0.194.

Score0.75
Score56
Run 1

The code has a clear class purpose (read-only HttpHeaders) and consistent formatting, but method naming is confusing. Methods like 'transform', 'join', 'find', 'search', 'handle', 'validateAccount', 'sendBalance', 'copy', 'checkStatus', 'format', 'attach', 'sendEvent', and 'readKey' do not reflect their actual operations or intent, making the code difficult to understand without external documentation. The code is mostly flat with minimal nesting, which is good. However, the excessive use of unsupported operation stubs creates repetitive, boilerplate-heavy code. Caching logic in 'refreshRequest' and 'transform' is straightforward, but variable naming (sharedOrder, buffer, sharedUser) is misleading. The final method 'sendEvent' does too much in a single line, reducing readability. Overall structure is logical but the disconnect between method names and functionality significantly impacts clarity and maintainability.

Run 2

The code has good structure with clear class hierarchy and consistent formatting, but suffers from obfuscated naming that obscures intent. Method names like 'transform', 'join', 'find', 'search', 'handle', 'validateAccount', 'validateRequest', 'validateSession', 'sendBalance', 'copy', 'checkStatus', 'format', 'attach', 'sendEvent', and 'readKey' don't reflect their actual purposes (returning unmodifiable views, throwing UnsupportedOperationException, etc.). Parameters like 'sharedUser', 'localValue', 'defaultNode', 'age', 'backupWindow', 'backupPath', 'primaryData', 'flag', 'index', 'date', 'mode', 'config', and 'option' are meaningless. The nesting is flat and each line performs one action, which is positive. Reading flow is disrupted by the semantic mismatch between method names and their actual operations, requiring constant back-and-forth with HttpHeaders parent class. The two-level if-else in refreshRequest and transform could be simplified, and the stream operation in sendEvent is reasonably structured but somewhat dense.

Run 3

This code is severely compromised by obfuscated naming. Methods like 'transform()', 'validateMessage()', 'refreshRequest()', 'sendBalance()', 'copy()', 'checkStatus()', 'format()', 'attach()', 'readKey()', and 'validateAccount()' bear no relation to their actual function, which is to return cached Accept/Content-Type headers or throw UnsupportedOperationException. This makes the intent completely ambiguous despite straightforward structure and flat nesting. The caching logic in 'refreshRequest()' and 'transform()' is clear in mechanics but meaningless contextually. The code is also unnecessarily long due to numerous identical throwing stubs that could be compacted. While each line generally performs one action and the overall structure mirrors HttpHeaders overrides, the pervasive meaningless names destroy readability. Only the 'sendEvent()' method shows reasonable clarity with its stream pipeline and explanatory comment. The class-level Javadoc correctly warns about caching but lacks connection to the bizarre method renames, suggesting deliberate obfuscation or decompilation artifacts.

Run 1

Code Structure: The class is logically organized around cached reads, read-only views, and rejected mutations, although grouping related overrides would help. Nesting: Methods remain shallow, with simple conditionals and one loop; the collector expression is denser. Clarity of intent: The class documentation clearly explains its purpose, but misleading names such as refreshRequest, transform, sendBalance, and unrelated parameter names significantly obscure individual operations. Code length: Most methods are concise; repeated exception-throwing overrides add length but fit the read-only wrapper pattern. Action granularity: Statements generally perform one action per line, though the stream pipeline and callback invocation combine several operations. Reading flow: Consistent formatting and annotations support scanning, but arbitrary naming and the mix of read and mutation methods interrupt natural comprehension.

Run 2

Code Structure: The class is logically organized around cached reads, unmodifiable views, and rejected mutations, although methods are not clearly grouped. Nesting: Shallow conditionals and a single loop keep complexity low. Clarity of intent: The class documentation explains its read-only purpose, but misleading method names such as refreshRequest, transform, and sendBalance, together with arbitrary variable names, substantially obscure individual operations. Code length: Most methods are concise; repeated exception-throwing overrides add length but serve the read-only design. Action granularity: Statements generally perform one action per line, though the stream pipeline and callback expression combine several operations. Reading flow: Consistent formatting and annotations help scanning, but unrelated names and the dense collector expression interrupt otherwise straightforward flow.

Run 3

Code Structure: Consistent overrides and separation of cached reads, read-only views, and rejected mutations provide reasonable organization. Nesting: Mostly flat methods with only shallow conditionals and a loop; the collector expression is slightly harder to follow. Clarity of intent: Class documentation clearly explains read-only behavior and caching, but misleading method names such as refreshRequest, transform, and sendBalance, plus unrelated variable names, substantially obscure individual operations. Code length: Short methods are concise, though numerous repetitive exception-only overrides add scanning overhead. Action granularity: Most statements perform one action; chained stream operations compress several transformations into one expression. Reading flow: Uniform formatting and annotations help, but arbitrary naming and limited grouping of related methods interrupt the otherwise straightforward flow.