Sample
pyint-44b21b4902ed-I02
Shorten method, parameter, and local names without collisions
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.538 | 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 | 10 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15 | 0–20; mean of three runs |
| BTTF | 0.624 | 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. | 1824.035 | −60.193 |
| 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.617 | −6.926 |
Intercept 8.87 + feature contributions = -17.449 (log-odds).
Score = sigmoid(-17.449) = 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.825 | +1.013 |
| 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.034 | +0.614 |
| 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.961 | +0.321 |
Intercept 0.07 + feature contributions = 0.154 (log-odds).
Score = sigmoid(0.154) = 0.538.
| Score | 0.224 |
|---|
| Score | 38 |
|---|
Run 1
The code has clear intent and good documentation, but several readability issues reduce its score. The structure is mostly logical, with clear class attributes and methods. However, nesting is shallow but present in the conditional in `res()`. Variable naming is inconsistent and confusing: `dum`, `loa`, `res`, `obj2`, `kwa`, `s2`, `kwa2`, `obj3`, `kwa3`, `dump`—these abbreviations obscure meaning and require mental mapping. Action granularity is mostly reasonable, but the conditional block with `setdefault` calls could be more explicit. Reading flow is hampered by poor naming and the `dump` variable, which shadows a conceptual action rather than describing content. While the docstrings are thorough and clarify intent, the method names fail to convey purpose at a glance. The code is maintainable if one reads the documentation, but not immediately readable from names alone.
Run 2
The code has clear class-level documentation and logical organization, but several readability issues reduce the score. The method names are severely abbreviated ('dum', 'loa', 'res'), making intent ambiguous despite docstrings. Parameter names are mangled with numeric suffixes ('obj2', 's2', 'kwa2', 'kwa3', 'arg', 'dump'), which suggests variable shadowing or conflicts and hurts reading flow. The action granularity is mostly good with one action per line, and nesting is minimal. However, the boolean condition in the response method is dense and requires careful parsing. The structure is logical but the abbreviations and parameter naming make the code feel terse and cryptic rather than concise. Overall, it is maintainable with effort but not naturally readable.
Run 3
The code has good documentation but poor naming and organization. Methods are cryptically abbreviated ('dum', 'loa', 'res') making intent unclear without reading docs. Parameters use non-semantic names ('obj2', 's2', 'kwa', 'kwa2', 'kwa3') that obscure purpose and force unnecessary renaming. The class attributes are well-documented with clear docstrings, but method implementations mix configuration logic (dump defaults, response formatting) in ways that bloat 'res' beyond its serialization purpose. Nesting is mostly flat, which is good, but action granularity suffers in 'res' where response construction packs multiple concerns. Reading flow is disrupted by scattered parameter numbering and abbreviations that don't reflect their actual usage context. The code would benefit from descriptive method names like 'dumps' vs 'dum', meaningful parameter names, and extracting response preparation into a separate helper to improve clarity and maintainability.
Run 1
Code Structure: Logically organized into configuration attributes and focused serialization, deserialization, and response methods, although missing definitions and unused imports reduce self-contained clarity. Nesting: Minimal, with only one straightforward if/else block. Clarity of intent: Detailed docstrings and type annotations explain behavior, but abbreviated names such as dum, loa, res, kwa3, and obj3 obscure meaning; documented parameter names also differ from actual signatures. Code length: Implementations are concise, though extensive documentation dominates the snippet. Action granularity: Each statement generally performs one action, making execution easy to follow. Reading flow: Configuration precedes operations naturally, and response preparation follows a clear sequence, but inconsistent naming interrupts comprehension.
Run 2
Code Structure: Logically organized into configuration attributes and small serialization, deserialization, and response methods, although several dependencies are not defined in the snippet. Nesting: Shallow, with only one simple conditional. Clarity of intent: Detailed docstrings and type annotations explain the purpose, but abbreviated names such as dum, loa, res, and numbered variables obscure meaning; documented parameter and method names also differ from actual names. Code length: Implementation is concise, though extensive documentation and unused imports add reading overhead. Action granularity: Statements generally perform one action per line. Reading flow: Configuration followed by related methods creates a natural progression, but inconsistent naming and documentation references interrupt comprehension.
Run 3
Code Structure: Logically organized into configuration attributes and serialization, deserialization, and response methods, though several dependencies are undefined in the snippet. Nesting: Shallow, with only one straightforward conditional. Clarity of intent: Detailed docstrings and type annotations explain behavior, but abbreviated names such as dum, loa, res, obj2, and kwa3 obscure intent; documented parameter and method names also differ from actual names. Code length: Implementation is concise, although extensive documentation makes the snippet longer and unused imports add clutter. Action granularity: Each statement performs a single clear action. Reading flow: Configuration followed by related methods creates a natural progression, but inconsistent naming and references to missing definitions interrupt comprehension.