Sample
int-e56909fff865-I02
Shorten method, parameter, and local names without collisions
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.11 | 0–1; higher is more readable |
| Mi | 0.238 | 0–1; higher is more readable |
| LLOC | 21 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 16 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15 | 0–20; mean of three runs |
| BTTF | 0.509 | 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. | 1550.709 | −51.173 |
| Source linesThe number of non-empty source lines. | 52 | +20.8 |
| 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.735 | −7.102 |
Intercept 8.87 + feature contributions = -28.605 (log-odds).
Score = sigmoid(-28.605) = 0.
Feature contributions
| Feature | Value | Contribution (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. | 113 | −1.121 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 52 | +1.061 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 53 | −0.84 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 52 | −0.772 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 51.781 | +0.314 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.097 | −0.002 |
Intercept 0.07 + feature contributions = -2.094 (log-odds).
Score = sigmoid(-2.094) = 0.11.
| Score | 0.238 |
|---|
| Score | 21 |
|---|
Run 1
The code is generally readable and well-structured. The enum constants and fields are clear, and the static initializer for SUB_PROTOCOLS is straightforward. However, several issues reduce readability: the variable names 'stomp2' and 'stomp3' are awkward and could be 'version' or 'stompVersion'; the constructor parameter names 'ver' and 'sub' are unnecessarily abbreviated; method names 'ver()' and 'sub()' are cryptic compared to 'version()' and 'subProtocol()'; the static block mixes collection building and string joining without a clear separation of concerns; and the find() method uses an imperative loop where a stream with filter/findFirst would be more concise. Overall, the code is maintainable but would benefit from better naming and slightly more modern idioms.
Run 2
The code is well-structured and generally readable. It follows a logical enum pattern with clear separation of constants, static initialization, fields, constructor, and methods. Nesting is minimal, with only one level inside the static block and find method. Intent is clear: defining STOMP protocol versions and providing a lookup mechanism. Code length is concise, though some variable names like 'stomp2', 'stomp3', 'sub2', and parameter names 'ver', 'sub' are less descriptive. Action granularity is good, with one operation per line. Reading flow is natural, moving from enum constants to static members, then to instance methods and static utility methods. The naming inconsistency in loop variables and abbreviated method parameters slightly reduces clarity compared to the otherwise clean implementation.
Run 3
The code is well-structured and readable. The enum pattern is clear, with constants, static initialization, instance fields, and methods logically organized. Nesting is minimal with only one level in the static block and find method. Variable names like 'stomp2', 'stomp3', 'sub', and 'ver' are unnecessarily abbreviated, reducing clarity. The static initializer is concise but could use a stream for better flow. Action granularity is generally good, though the loop in static initialization packs iteration and addition into one line. The find method's null check and loop flow naturally, and the exception message is clear. Overall, the code is concise and maintainable with minor naming improvements possible.
Run 1
Code Structure: The enum is logically organized into constants, initialization, fields, constructor, accessors, and lookup. Nesting: Most code is flat, but find has three nested control structures; an early null check could simplify it. Clarity of intent: Version-to-subprotocol mapping is clear, but abbreviated names such as ver, sub, sub2, stomp2, and stomp3 reduce precision. The call to subProtocol() has no corresponding method in the snippet, creating confusion and a compilation error. Code length: Compact overall, with little unnecessary code. Action granularity: Statements generally perform one action per line. Reading flow: Organization and spacing support a natural reading order, although inconsistent accessor naming and numbered variable names interrupt comprehension.
Run 2
Code Structure: The enum is logically organized into constants, static initialization, fields, constructor, accessors, and lookup. Nesting: Most code is flat, but find uses three nested control structures where a guard clause could simplify it. Clarity of intent: Version and subprotocol mapping is understandable, but abbreviated names (ver, sub) and numbered variables (stomp2, stomp3, sub2) reduce clarity. The call to subProtocol() has no corresponding accessor, creating an inconsistency that interrupts understanding. Code length: Compact overall, with little unnecessary code. Action granularity: Statements generally perform one action per line. Reading flow: Organization and spacing support natural reading, though inconsistent naming and the missing accessor weaken continuity.
Run 3
Code Structure: The enum is logically organized into constants, initialization, fields, constructor, and methods. Nesting: Most code is flat, but find() nests a loop and condition inside a null check. Clarity of intent: Version and subprotocol mapping is understandable, but abbreviated methods and parameters (ver, sub, sub2) and numbered variables (stomp2, stomp3) weaken clarity. The call to subProtocol() has no corresponding method; the defined accessor is sub(), creating confusion. Code length: Compact overall, with little unnecessary code. Action granularity: Statements generally perform one action per line. Reading flow: Declaration order and formatting are natural, though inconsistent accessor naming interrupts comprehension.