Sample
pyint-3e6802a08bd5-SRC
Unmodified source class
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 | 16.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 generally well-structured and readable. It uses clear naming conventions, type hints, and docstrings to explain the Converter class's purpose and parameters. The __init__ method's conditional logic for wrapping the converter is relatively flat and each branch performs a single assignment. The helper methods are concise and focused. Minor issues include the complex f-string expressions in _fmt_converter_call, which could benefit from being split into intermediate variables for clarity, and the somewhat magical use of lambda with placeholder underscores (_, __) that may obscure intent for readers unfamiliar with the pattern. Overall, the code is maintainable but has slightly reduced readability due to dense string formatting and subtle lambda conventions.
Run 3
The code is generally well-structured with clear classes, docstrings, and type hints. The Converter class has a logical organization with clear intent in method names. However, there are some readability challenges: the lambda assignments in __init__ create unnecessary complexity with underscore placeholder parameters, and the _fmt_converter_call method has deeply nested conditional returns and very long f-string lines. The __slots__ tuple mixes dunder methods with regular attributes in a way that could be confusing. While the docstrings are thorough and helpful, the conditional lambda logic would benefit from being refactored into named helper methods. Overall the code is maintainable and follows good Python practices, but has room for improvement in reducing nesting depth and line lengths.
Run 1
Code Structure: The class is logically organized into initialization, call formatting, and serialization methods, though numerous unused imports clutter this excerpt. Nesting: Shallow conditional branches and early returns keep complexity manageable. Clarity of intent: Descriptive method names and substantial docstrings explain converter behavior well; abbreviated names such as ex and rt, placeholder lambda parameters, and dynamic __call__ assignment require extra interpretation. The __getstate__ docstring also omits takes_field despite its inclusion in the returned state. Code length: Methods are reasonably concise, although argument-selection logic is repeated between initialization and call formatting, and some generated-call strings are long. Action granularity: Statements generally perform one action per line; multiline lambdas remain easy to follow. Reading flow: Methods follow a natural progression, and consistent formatting supports scanning, but runtime annotation modification and string-generated calls introduce some cognitive overhead.
Run 2
Code Structure: The class is logically organized into initialization, call formatting, and serialization methods, although many imports are unused in this snippet. 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, but abbreviated names such as ex and rt, placeholder lambda parameters, and dynamically assigned __call__ require extra thought. The __getstate__ docstring omits takes_field despite its inclusion in the returned state. Code length: Mostly concise, though repeated flag checks and long formatted strings introduce some verbosity. Action granularity: Statements generally perform one action per line, with multiline expressions formatted clearly. Reading flow: Methods progress naturally from setup to invocation formatting and persistence; annotation handling and generated-call strings add modest cognitive overhead.
Run 3
Code Structure: The class is logically organized into initialization, call formatting, and serialization methods, although many imports are unused in this snippet. Nesting: Shallow conditional branches and early returns make control flow easy to follow. Clarity of intent: Descriptive method names and detailed docstrings explain the converter wrapper well, but abbreviations such as ex and rt, placeholder lambda arguments, and dynamically assigned __call__ require extra interpretation. The __getstate__ docstring also omits takes_field despite its inclusion in the returned state. Code length: Generally concise, though repeated flag checks and generated-call expressions add some duplication. Action granularity: Statements typically perform one action per line; multiline lambdas remain understandable. Reading flow: Methods follow a natural progression, with consistent formatting, but long f-strings and dynamic annotation manipulation slightly interrupt readability.