Sample
pyint-88a4e0553833-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.391 | 0–1; higher is more readable |
| Mi | 0.602 | 0–1; higher is more readable |
| LLOC | 51 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 17.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs |
| BTTF | 0.602 | 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. | 2560.102 | −84.483 |
| Source linesThe number of non-empty source lines. | 125 | +50 |
| 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.411 | −6.617 |
Intercept 8.87 + feature contributions = -32.23 (log-odds).
Score = sigmoid(-32.23) = 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. | 125 | −3.39 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 95 | +2.549 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 95 | −1.759 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 124.873 | +1.336 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 100.976 | +0.825 |
| 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. | 100.96 | −0.611 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.042 | +0.536 |
Intercept 0.07 + feature contributions = -0.444 (log-odds).
Score = sigmoid(-0.444) = 0.391.
| Score | 0.602 |
|---|
| Score | 51 |
|---|
Run 1
The code is well-structured and readable. It uses clear class design with slots, docstrings, and named parameters. The Converter class has a logical flow, and methods are concise with single responsibilities. Nesting is flat, intent is clear, and action granularity is appropriate. Minor issues include the lambda assignments in __init__ which slightly reduce clarity, and the long f-string lines in _fmt_converter_call could be reformatted for better readability.
Run 2
The code is highly readable with clear class structure, descriptive docstrings, and logical organization. The Converter class has a well-defined single responsibility, with methods grouped logically (construction, string formatting, serialization). Nesting is minimal—only simple conditional branches at one level. Intent is explicit through comprehensive docstrings explaining parameters and behavior. Code length is appropriate: the `__init__` method uses a clean if/elif chain to handle different converter signatures, avoiding unnecessary abstraction. Action granularity is good—each line performs one conceptual action, though a few f-strings in `_fmt_converter_call` are slightly long but still readable. Reading flow is natural, moving from initialization logic to helper methods to serialization. The use of type hints, `__slots__`, and `cached_property` imports indicates modern Python practices. Minor deductions: some lambda assignments could be slightly clearer with named functions, and the `__setstate__` docstring could expand on behavior, but these are negligible overall.
Run 3
The code is well-structured, organized logically into a single class with clear separation of concerns. The class docstring is thorough, explaining parameters and behavior. Methods are concise and each performs a single responsibility, with clear naming that communicates intent. Nesting is minimal—only one level in the conditional converter assignment, which is appropriate and readable. The use of lambdas and conditional branches for different converter signatures slightly reduces clarity but is handled cleanly. Line length is generally reasonable, though one f-string line exceeds typical style guides, impacting reading flow. Overall, the code is highly readable with strong documentation, flat structure, and clear intent.
Run 1
Code Structure: The class is logically organized into initialization, call formatting, and serialization methods, with clear separation of responsibilities. Nesting: Shallow conditionals and early returns keep control flow easy to follow. Clarity of intent: Descriptive method names and detailed docstrings explain the converter's purpose, although abbreviated variables such as ex and rt, placeholder lambda arguments, and dynamic __call__ assignment require extra interpretation. The __getstate__ docstring omits takes_field despite including it in the returned state. Code length: Methods are concise, but repeated flag combinations, long formatted strings, and numerous imports unused in this excerpt add clutter. Action granularity: Statements generally perform one action per line, and multiline expressions are formatted clearly. Reading flow: The progression from configuration to invocation formatting to persistence is natural, though metaprogramming details and annotation mutation briefly interrupt straightforward reading.
Run 2
Code Structure: Well-organized class with focused methods and helpful docstrings, though numerous unused imports distract in this snippet. Nesting: Mostly flat conditionals and early returns keep complexity low. Clarity of intent: Descriptive method names and documentation explain converter behavior; dynamic __call__ assignment, placeholder lambda parameters, and abbreviations such as ex and rt require extra interpretation. The __getstate__ docstring also omits takes_field despite including it in the returned state. Code length: Generally concise, although repeated flag checks and long formatted strings add some verbosity. Action granularity: Statements generally perform one action each, with no compressed multi-statement lines. Reading flow: Initialization, call formatting, and serialization follow a natural progression, but metaprogramming details and long return lines modestly interrupt readability.
Run 3
Code Structure: The class is logically organized into initialization, call formatting, and serialization methods, although many imports are unused in this excerpt. Nesting: Branches remain shallow, and early returns keep formatting logic flat. Clarity of intent: Descriptive method names and detailed docstrings explain the converter's purpose; abbreviated names such as ex and rt, placeholder lambda arguments, and dynamic __call__ assignment require extra attention. The __getstate__ docstring omits takes_field despite its inclusion in the returned state. Code length: Methods are reasonably concise, but repeated flag combinations and generated-call expressions add some duplication. Action granularity: Statements generally perform one action per line, with cleanly separated assignments and returns. Reading flow: The progression from setup to invocation formatting to state handling is natural, though long f-strings and annotation manipulation interrupt otherwise straightforward reading.