Sample
int-44b570968b1f-I02
Shorten method, parameter, and local names without collisions
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.498 | 0–1; higher is more readable |
| Dorn | 0.297 | 0–1; higher is more readable |
| Mi | 0.578 | 0–1; higher is more readable |
| LLOC | 36 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 6 | 0–20; mean of three runs |
| GPT-6.1 Sol | 12.33 | 0–20; mean of three runs |
| BTTF | 0.383 | 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. | 5054.447 | −166.797 |
| Source linesThe number of non-empty source lines. | 109 | +43.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. | 5.182 | −7.773 |
Intercept 8.87 + feature contributions = -122.1 (log-odds).
Score = sigmoid(-122.1) = 0.
| Score | 0.498 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 110 | −2.858 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 99 | +2.687 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 99 | −1.851 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 108.855 | +1.112 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 108.982 | +0.954 |
| 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. | 108.973 | −0.95 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.1 | −0.026 |
Intercept 0.07 + feature contributions = -0.862 (log-odds).
Score = sigmoid(-0.862) = 0.297.
| Score | 0.578 |
|---|
| Score | 36 |
|---|
Run 1
This code is extremely difficult to read due to terrible naming conventions. Methods are named 'get', 'get2', 'get3', and 'handle2'; parameters are 'req', 'req2', 'req3', 'req4', 'sock', 'ws2', etc. These opaque names destroy clarity of intent and reading flow. While the code is fairly flat and concise, the action granularity is mostly one per line, and the structure is okay, the naming makes it impossible to understand the purpose without extensive reverse-engineering. The 'get' methods are particularly confusing: one returns a MediaType, another a SockJsFrameFormat, and another a @Nullable String. This is a textbook case of unreadable code despite a logical package structure.
Run 2
The code suffers from severe readability issues. Generic, non-descriptive method names like 'handle2', 'get', 'get2', and 'get3' completely obscure the code's intent, violating the 'Clarity of intent' and 'Reading flow' criteria. Similarly, sequentially named parameters (req, req2, req3, sock2, res4) make the logic difficult to follow and are highly ambiguous. The class also violates the Single Responsibility Principle; it is a transport handler, session factory, and utility for parsing callback parameters, leading to a tangled 'Code structure'. While the use of early returns in the main flow avoids deep nesting, the confusing naming and mixed responsibilities negate that benefit. Consequently, the code is unnecessarily hard to parse, requiring constant mental mapping of variables and methods to their actual functions.
Run 3
The code is poorly readable due to vague method names (get, get2, get3), confusing sequential parameter names (req2, res2, sock2), and inconsistent return types (MediaType vs SockJsFrameFormat vs String). It has one method that combines multiple operations (validation, decoding, pattern matching), moderate nesting in conditionals, and poor reading flow. Positives include reasonable overall structure, single responsibility in some methods, and explanatory debug logs. However, the vague naming and unclear intent make the code difficult to understand without deep context.
Run 1
Code Structure: Methods separate request handling, frame writing, and callback validation logically. Nesting: The state-based conditional chain is straightforward, with only shallow nested logging checks. Clarity of intent: The main weakness is vague naming such as get, get2, get3, handle2, ws2, and res4, which obscures responsibilities and forces readers to infer meaning from types and usage. Code length: Generally concise, although repeated logging guards and obsolete commented-out code add noise. Action granularity: Most statements perform one action per line; the chained query-parsing expression is somewhat dense. Reading flow: The progression from entry point to state handling and helpers is natural, but numbered identifiers and minimally documented abstract methods interrupt comprehension.
Run 2
Code Structure: Methods logically separate request handling, frame writing, and callback validation, though generic method names obscure those boundaries. Nesting: Mostly shallow, with a manageable conditional chain and nested logging checks. Clarity of intent: The main weakness is ambiguous naming such as get, get2, get3, handle2, ws2, and res4; types and API calls provide context but require extra inference. Code length: Reasonably concise, although repeated logging guards and obsolete commented-out code add clutter. Action granularity: Most statements perform one action per line, but chained query parsing compresses several operations into one statement. Reading flow: Session-state branches follow a natural sequence, and formatting is consistent within methods; dense imports, numbered identifiers, and uneven blank-line spacing reduce scanability. Overall, the control flow is readable, but poor naming significantly weakens comprehension.
Run 3
Code Structure: Responsibilities are logically separated into request dispatch, session-state handling, frame writing, and callback extraction. Nesting: Mostly shallow, with logging checks adding only one level inside state branches. Clarity of intent: The principal weakness is ambiguous naming such as get, get2, get3, handle2, ws2, and res4; readers must inspect implementations or infer types to understand their roles. Code length: Reasonably concise, though repeated logging checks and obsolete commented-out code add noise. Action granularity: Statements generally perform one action per line, although callback parsing uses a long chained expression. Reading flow: Session-state branches follow a natural progression, and formatting is consistent, but numbered variable names and opaque helper methods interrupt comprehension. Overall, sound organization and limited nesting are undermined by poor naming.