Sample
pyint-9970de029cb8-I03
Replace names with length-matched meaningful but unrelated identifiers
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.54 | 0–1; higher is more readable |
| Mi | 0.224 | 0–1; higher is more readable |
| LLOC | 38 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 11.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 14 | 0–20; mean of three runs |
| BTTF | 0.589 | 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. | 1819.85 | −60.055 |
| Source linesThe number of non-empty source lines. | 102 | +40.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.597 | −6.895 |
Intercept 8.87 + feature contributions = -17.28 (log-odds).
Score = sigmoid(-17.28) = 0.
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. | 103 | −2.611 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 52 | +1.061 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 101.875 | +1.014 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 52 | −0.772 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.033 | +0.619 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 78.184 | +0.457 |
| 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. | 78.951 | +0.321 |
Intercept 0.07 + feature contributions = 0.16 (log-odds).
Score = sigmoid(0.16) = 0.54.
| Score | 0.224 |
|---|
| Score | 38 |
|---|
Run 1
The code has clear structure with dataclasses and type hints, but suffers from confusing naming that obscures intent. Methods named `close`, `apply`, and `sendNode` don't reflect their actual purposes (serialize, deserialize, create response) — this breaks clarity of intent. Parameter names like `map`, `client`, `key`, `target`, `buffer`, and `user` are misleading; `map` likely means 'obj' and `client` means 'kwargs'. The docstrings describe correct behavior but conflict with actual parameter names, creating cognitive dissonance. Action granularity is mostly good with one operation per line, and nesting is minimal. Reading flow suffers from the naming choices and some inconsistent style (e.g., `finalMode` uses camelCase while `ensure_ascii` uses snake_case). The `sendNode` method has reasonable logic flow but could be flattened slightly. Overall structure is acceptable but the pervasive naming inconsistencies and mismatched documentation-to-code alignment significantly reduce readability.
Run 2
The code has good documentation and clear intent, but suffers from confusing naming conventions that severely hurt readability. Methods are named 'close', 'apply', and 'sendNode' instead of conventional names like 'dumps', 'loads', and 'response', which obscures their purpose. Parameter names are similarly misleading: 'map' receives serialization data, 'key' receives JSON strings, 'client' receives serialization options, and 'buffer' receives keyword arguments. The docstrings use correct parameter names ('obj', 's', 'kwargs', 'args') that don't match actual parameter names, creating confusion. Structure is flat and length is reasonable, but the semantic mismatch between names and their actual roles makes the code significantly harder to follow than it should be.
Run 3
The code shows moderate readability but suffers from confusing naming choices that obscure intent. The class structure and docstrings are adequate, with flat nesting and reasonable action granularity. However, method names like 'close', 'apply', and 'sendNode' do not match their actual operations (serialize, deserialize, and create response), while parameter names such as 'map', 'key', 'user', 'buffer', 'target', and 'client' are misleading. These naming issues significantly reduce clarity. The compact conditional logic in sendNode is concise but could be clearer, and the string formatting operation combines multiple actions. Reading flow is disrupted by the semantic mismatch between names and behavior, though the overall structure and organization remain comprehensible.
Run 1
Code Structure: Configuration attributes and serialization methods are logically grouped, although several imports are unused and referenced helpers are absent from the snippet. Nesting: Methods are flat, with only one simple conditional. Clarity of intent: Detailed docstrings explain behavior, but misleading names such as close, apply, sendNode, map, and client obscure JSON operations; documented parameter names also differ from actual signatures. Code length: Implementation is concise, though extensive documentation increases scanning effort. Action granularity: Statements generally perform one action per line, and the multiline response construction is readable. Reading flow: Configuration flows naturally into serialization, deserialization, and response generation, but inconsistent naming conventions and documentation-signature mismatches interrupt comprehension.
Run 2
Code Structure: Well-organized class with configuration attributes and separate serialization, deserialization, and response methods. Nesting: Minimal, with only a single if/else branch. Clarity of intent: Detailed docstrings explain behavior, but misleading names such as close, apply, sendNode, map, client, and finalMode obscure purpose; documented parameter names also differ from actual signatures. Code length: Implementation is concise, although extensive documentation and unused imports add reading overhead. Action granularity: Each statement generally performs one clear action. Reading flow: Configuration followed by methods creates a natural progression, but inconsistent naming conventions and externally defined symbols such as JSONProvider and _default interrupt understanding of the standalone snippet.
Run 3
Code Structure: The class logically groups configuration and JSON operations, although external dependencies such as JSONProvider and _default are not shown. Nesting: Methods are flat, with only one simple conditional. Clarity of intent: Detailed docstrings explain behavior, but misleading names such as close, apply, sendNode, map, and client obscure JSON serialization roles. Docstring parameter names also disagree with actual signatures, and naming conventions are inconsistent. Code length: Implementations are concise; extensive documentation adds length but mostly provides useful context. Several unused imports create clutter. Action granularity: Each statement performs one clear action, with no compressed multi-statement lines. Reading flow: Configuration followed by serialization, deserialization, and response generation is natural, but mismatched terminology and camelCase names interrupt comprehension.