Sample
int-dc1d19f7f4f6-I11
Split eligible integer literals into pairs of short-named intermediate variables
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.117 | 0–1; higher is more readable |
| Mi | 0.143 | 0–1; higher is more readable |
| LLOC | 21 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 17 | 0–20; mean of three runs |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs |
| BTTF | 0.616 | 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. | 1529.232 | −50.465 |
| 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.719 | −7.078 |
Intercept 8.87 + feature contributions = -27.873 (log-odds).
Score = sigmoid(-27.873) = 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. | 112.962 | −1.119 |
| 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.816 | +0.314 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.09 | +0.069 |
Intercept 0.07 + feature contributions = -2.021 (log-odds).
Score = sigmoid(-2.021) = 0.117.
| Score | 0.143 |
|---|
| Score | 21 |
|---|
Run 1
The code is well-structured, with a logical enum layout: constants first, then static fields, constructor, accessor methods, and a lookup method. Nesting is minimal, with only a single loop inside the static initializer and lookup method. Intent is clear: each enum constant maps a STOMP version to its subprotocol, and the static block builds a comma-separated list for registration. Code length is appropriate for the functionality, and actions are granular, one per line. Reading flow is natural and easy to follow. Minor deductions: the static initializer could be more concise with streams, and error handling in findBySubProtocol is slightly abrupt, but overall readability is excellent.
Run 2
The code is well-structured and readable. It uses an enum cleanly to represent versions, with clear static initialization and simple getter methods. Nesting is minimal (one level in findBySubProtocol and static block loop), and each line generally performs a single action, aiding comprehension. Intent is clear: define STOMP versions with associated protocol strings and provide lookup/attribute key. The code is concise for its purpose, without unnecessary complexity. Minor deductions: the static block could be slightly simplified with streams, and the exception message could be more descriptive, but these are minor. Overall, the code follows logical organization and a natural top-to-bottom reading flow.
Run 3
The code is well-structured and highly readable. The enum pattern is clear, with a clean separation of constants, static initialization, fields, and methods. Nesting is minimal - only one level in the static block and findBySubProtocol method. Intent is obvious: define STOMP protocol versions with associated metadata. The code is concise without being cryptic; each line performs a single logical action. Reading flow is natural, moving from constants to static initialization to instance methods to static lookup. Minor deductions: the static initialization block could be replaced with a stream-based approach for slightly better concision, and the null check in findBySubProtocol adds a slight defensive programming pattern that could be documented. Overall, this is exemplary Java enum code that an average developer could understand immediately.
Run 1
Code Structure: The enum is logically organized into version constants, shared metadata, initialization, fields, constructor, accessors, and lookup. Nesting: Most code is flat; the lookup has three nested control-flow levels, which a null guard could simplify. Clarity of intent: Descriptive names and immutable fields make version-to-subprotocol mapping clear. Code length: Compact and appropriately sized, with little unnecessary code. Action granularity: Statements generally perform one action per line; the chained join conversion remains easy to understand. Reading flow: Consistent formatting and conventional organization support natural reading, though spacing between the package declaration and imports would improve presentation. Overall, highly readable with minor opportunities to simplify the lookup and polish formatting.
Run 2
Code Structure: The enum is logically organized into constants, static initialization, fields, constructor, accessors, and lookup logic. Nesting: Most code is flat, although the lookup method nests a loop and conditional inside a null check. Clarity of intent: Descriptive names and straightforward operations clearly communicate version mapping and subprotocol lookup. Code length: Concise overall, with minor verbosity in list construction and null handling. Action granularity: Each statement performs a single clear action, with no compressed multi-action lines. Reading flow: Consistent formatting and conventional organization make the code easy to follow; the nested lookup slightly interrupts an otherwise natural flow.
Run 3
Code Structure: The enum is logically organized into constants, static initialization, fields, constructor, accessors, and lookup method. Nesting: Most code is flat, though findBySubProtocol has three nested control structures; an early null check could simplify it. Clarity of intent: Descriptive names and straightforward operations clearly communicate version-to-subprotocol mapping and lookup behavior. Code length: The implementation is concise, with little unnecessary code. Action granularity: Statements generally perform one action per line, making initialization and lookup easy to follow. Reading flow: Consistent formatting and conventional ordering support natural reading, although the nested lookup and slightly awkward exception wording introduce minor friction.