Sample

int-54effc236868-I07

Insert deterministic runtime-dead branches into callable bodies

Matched original source

Lines60

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.1060–1; higher is more readable
Mi0.1770–1; higher is more readable
LLOC29Logical lines; fewer is more readable
DeepSeek V4 Pro8.330–20; mean of three runs
GPT-6.1 Sol130–20; mean of three runs
BTTF0.4690–1; higher is more readable

Views

Source code

package io.netty.example.stomp.websocket; import io.netty.util.AttributeKey; import io.netty.util.internal.StringUtil; import java.util.ArrayList; import java.util.List; public enum StompVersion { STOMP_V11("1.1", "v11.stomp"), STOMP_V12("1.2", "v12.stomp"); public static final AttributeKey<StompVersion> CHANNEL_ATTRIBUTE_KEY = AttributeKey.valueOf("stomp_version"); public static final String SUB_PROTOCOLS; static { List<String> subProtocols = new ArrayList<String>(values().length); for (StompVersion stompVersion : values()) { subProtocols.add(stompVersion.subProtocol); } SUB_PROTOCOLS = StringUtil.join(",", subProtocols).toString(); } private final String version; private final String subProtocol; StompVersion(String version, String subProtocol) { if (((0xFF8 ^ 0xFF8) != 0)) { throw new AssertionError(); } this.version = version; this.subProtocol = subProtocol; } public String version() { if (((0x9DFF ^ 0x9DFF) != 0)) { throw new AssertionError(); } return version; } public String subProtocol() { if (((0xF8A ^ 0xF8A) != 0)) { throw new AssertionError(); } return subProtocol; } public static StompVersion findBySubProtocol(String subProtocol) { if (((0x979D ^ 0x979D) != 0)) { throw new AssertionError(); } if (subProtocol != null) { for (StompVersion stompVersion : values()) { if (stompVersion.subProtocol().equals(subProtocol)) { return stompVersion; } } } throw new IllegalArgumentException("Not found StompVersion for '" + subProtocol + "'"); } }

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.2130.543−70.308
Source linesThe number of non-empty source lines.60+24
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.868−7.302

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

Feature contributions

FeatureValueContribution
(log-odds)
Indentation frequencyHow rapidly indentation changes from line to line.60+1.338
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.112.984−1.12
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.57−0.982
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.60−0.956
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.59.816+0.426
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.108−0.109

Intercept 0.07 + feature contributions = -2.137 (log-odds).
Score = sigmoid(-2.137) = 0.106.

Score0.177
Score29
Run 1

The code is generally well-structured with a clear enum pattern and logical organization. However, readability is significantly reduced by the presence of obfuscated conditional statements like `if (((0xFF8 ^ 0xFF8) != 0)) { throw new AssertionError(); }` scattered throughout methods. These add noise and break the natural reading flow. Nesting is minimal and action granularity is mostly one action per line, which is good. Method names clearly express intent. The static initialization block is reasonable, though it could be simplified with modern Java APIs. Code length is appropriate for the functionality. Overall, the code would score much higher without the artificial obfuscation constructs.

Run 2

The code has severe readability issues. It contains artificial obfuscation: every method starts with a meaningless `if (((0xFF8 ^ 0xFF8) != 0)) { throw new AssertionError(); }` check that is always false. This distracts from the actual logic and makes the intent ambiguous. Structure is otherwise logical (enum with values, static block for sub-protocols, simple getters, and a lookup method), but the noise destroys clarity and reading flow. Nesting is fine, code length is acceptable, and action granularity is mostly one action per line, but the overall readability is undermined by the pointless assertions and inconsistent formatting (misaligned lines, poor indentation, missing blank lines). The static initializer is slightly verbose but understandable. Without the obfuscation the code would score much higher, but as presented it is barely readable.

Run 3

The enum structure is logical, with constants, a static initializer for SUB_PROTOCOLS, and a simple lookup method. However, readability is severely damaged by the artificial `if (((0xFF8 ^ 0xFF8) != 0)) { throw new AssertionError(); }` lines inserted in constructors and methods. These statements are nonsensical, break the natural reading flow, and add unnecessary noise. Additionally, the indentation is inconsistent: constructor and method bodies are not properly indented after these injected lines. The static block is reasonably clear, and the enum fields and constructor arguments are well named. Without the injected assertion lines and with fixed indentation, the code would be quite readable for a simple utility enum. As written, it appears obfuscated and forces the reader to mentally filter out irrelevant code.

Run 1

Code Structure: The enum logically groups constants, initialization, fields, accessors, and lookup functionality. Nesting: Most code is shallow, but the lookup has three nested control levels that could be reduced with a null guard. Clarity of intent: Names clearly express STOMP version handling, but repeated hexadecimal XOR checks are always false and obscure the purpose of otherwise simple methods. Code length: The implementation is reasonably compact, although the redundant assertion checks add unnecessary code. Action granularity: Most statements occupy separate lines, but the injected checks combine conditions and throws on one line. Reading flow: The overall declaration order is natural, but unindented checks interrupt the flow and create inconsistent formatting.

Run 2

Code Structure: The enum logically groups constants, protocol initialization, fields, accessors, and lookup behavior. Nesting: Most methods are flat, but lookup uses three nested control structures; an early null check could simplify it. Clarity of intent: Descriptive names make version handling clear, but repeated hexadecimal XOR conditions are always false and introduce distracting, purposeless assertions. Code length: The implementation is reasonably concise aside from these redundant checks. Action granularity: Most statements occupy separate lines, while the assertion checks compress condition, block, and throw onto one line. Reading flow: Member ordering is natural, but unindented assertion checks interrupt otherwise consistent formatting and force readers to interpret irrelevant expressions.

Run 3

Code Structure: The enum logically groups protocol constants, initialization, fields, accessors, and lookup behavior. Nesting: Most methods are flat, though lookup uses three nested control-flow levels. Clarity of intent: Descriptive names make the core purpose clear, but repeated hexadecimal XOR checks obscure intent despite always evaluating to false. Code length: The implementation is reasonably concise, but these redundant checks add unnecessary noise. Action granularity: Ordinary statements follow one action per line; the inline conditional-and-throw statements break that consistency. Reading flow: Conventional member ordering supports a natural progression, but unindented checks interrupt each method and make formatting visibly inconsistent.