Sample

int-601c19d4b634-I09

Select one of ten low-readability unrelated code templates per class

Matched original source

Lines54

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.0650–1; higher is more readable
Mi0.0650–1; higher is more readable
LLOC25Logical lines; fewer is more readable
DeepSeek V4 Pro13.670–20; mean of three runs
GPT-6.1 Sol130–20; mean of three runs
BTTF0.1580–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) { this.version = version; this.subProtocol = subProtocol; } public String version() { return version; } public String subProtocol() { return subProtocol; } public static StompVersion findBySubProtocol(String subProtocol) { {int lI0O_02916eb9=0xCD81;lI0O_02916eb9=((lI0O_02916eb9^0xCD81)|0)&-1;if(((lI0O_02916eb9&1)==1)){lI0O_02916eb9^=lI0O_02916eb9;}} 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.1854.194−61.188
Source linesThe number of non-empty source lines.54+21.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.935−7.403

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

Feature contributions

FeatureValueContribution
(log-odds)
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.128−1.756
Indentation frequencyHow rapidly indentation changes from line to line.54+1.131
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.54−0.818
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.52−0.805
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.53.814+0.342
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.099−0.022

Intercept 0.07 + feature contributions = -2.662 (log-odds).
Score = sigmoid(-2.662) = 0.065.

Score0.065
Score25
Run 1

The code is generally well-structured and readable, but it has a significant issue: an obfuscated line in the findBySubProtocol method that appears to be dead or malicious code. This hurts clarity and intent. Otherwise, the enum is logically organized with clear naming, flat nesting (only one loop), and concise methods. The static block builds a comma-separated sub-protocol list cleanly. Action granularity is good—one action per line mostly. However, the unnecessary import of StringUtil for joining a list could be simplified. The magic obfuscated line is a major red flag for readability and maintainability, dropping the score significantly.

Run 2

The code is generally well-structured, with clear enum constants, a logical static block, and straightforward getter methods. However, readability is significantly harmed by the presence of obfuscated-looking code in the findBySubProtocol method (a meaningless loop with bitwise operations that serves no purpose). This creates confusion and breaks the natural reading flow. The rest of the method is clear, but the unnecessary nesting and the mysterious code block reduce clarity. The class is concise overall, but the action granularity is inconsistent due to the odd inserted code. Without that block, the score would be higher.

Run 3

The code is generally well-structured and readable, with clear naming conventions and logical organization. However, readability is significantly impacted by a suspicious line of obfuscated code in the `findBySubProtocol` method, which introduces confusion and ambiguity. The nesting level is minimal, and most methods perform a single action per line, aiding comprehension. The static initialization block is straightforward, though it could be more concise using streams. Overall, the code would score higher if the obfuscated line were removed, as it disrupts the natural reading flow and clarity of intent.

Run 1

Code Structure: The enum is logically organized into constants, initialization, fields, constructor, accessors, and lookup, but an unrelated obfuscated block disrupts the lookup method. Nesting: Most code is shallow; the lookup uses three nested control structures, while the injected block adds avoidable complexity. Clarity of intent: Descriptive names make version handling clear, but the cryptic variable and meaningless bitwise operations obscure intent. Code length: Generally concise, except for the unnecessary injected code. Action granularity: Most statements occupy separate lines, but the obfuscated block compresses declarations, assignments, and a conditional onto one line. Reading flow: The surrounding code reads naturally, but the dense, unindented block abruptly interrupts it.

Run 2

Code Structure: The enum is logically organized into constants, initialization, fields, constructor, accessors, and lookup, but an unrelated obfuscated block disrupts the lookup method. Nesting: Most code is shallow; the lookup has moderate nesting through a null check, loop, and comparison. Clarity of intent: Descriptive names make the STOMP version mapping clear, while the cryptic variable and redundant bitwise operations obscure intent. Code length: The implementation is generally concise, but the injected block adds unnecessary code. Action granularity: Most statements perform one action per line; the obfuscated block compresses declarations, assignments, and conditional logic onto one line. Reading flow: The overall sequence is natural and easy to follow except for the abrupt, poorly formatted block at the start of findBySubProtocol.

Run 3

Code Structure: The enum is logically organized into constants, initialization, fields, accessors, and lookup, but an unrelated obfuscated block disrupts the lookup method. Nesting: Most code is shallow; the lookup has moderate nesting through a null check, loop, and equality check. Clarity of intent: Descriptive names make version mapping clear, while the cryptic variable and pointless bitwise operations obscure intent. Code length: The implementation is reasonably concise except for the unnecessary injected block. Action granularity: Normal statements occupy separate lines, but the obfuscated block compresses declarations, assignments, and a conditional onto one line. Reading flow: The overall progression is natural, but the abrupt, unformatted block significantly interrupts reading and distracts from otherwise straightforward code.