Sample
pyint-7b384563d721-I08
Select one of ten high-readability unrelated code templates per class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.377 | 0–1; higher is more readable |
| Mi | 0.602 | 0–1; higher is more readable |
| LLOC | 56 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 12 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15 | 0–20; mean of three runs |
| BTTF | 0.524 | 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. | 2719.49 | −89.743 |
| Source linesThe number of non-empty source lines. | 131 | +52.4 |
| 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.397 | −6.596 |
Intercept 8.87 + feature contributions = -35.069 (log-odds).
Score = sigmoid(-35.069) = 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. | 131 | −3.602 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 101 | +2.756 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 101 | −1.897 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 130.833 | +1.419 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 100.977 | +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.955 | −0.611 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.042 | +0.537 |
Intercept 0.07 + feature contributions = -0.502 (log-odds).
Score = sigmoid(-0.502) = 0.377.
| Score | 0.602 |
|---|
| Score | 56 |
|---|
Run 1
The code is generally well-structured with clear docstrings, type hints, and logical organization into classes and methods. The Converter class has a clear purpose and its methods are mostly concise and focused. However, there are readability issues: the __init__ method uses lambda assignments with multiple underscores and conditional branching that makes the intent harder to follow at a glance. The _fmt_converter_call method has very long f-strings that exceed typical line-length expectations and mix logic with string formatting. The __setstate__ method contains dead code (unused score comparison) that adds confusion and suggests incomplete cleanup. Nesting is low, and most actions are granular, but the conditional lambda chains reduce clarity. Overall, the code is readable but suffers from some awkward constructs and dead code.
Run 2
The code has good structure with clear class, type hints, and docstrings, but the `Converter` class contains a confusing `__setstate__` method with unrelated scoring logic that severely damages clarity. The nested conditional lambdas in `__init__` reduce readability due to multiple layers of logic in one expression. The long conditional return in `_fmt_converter_call` is overly verbose and mixes formatting logic in a way that could be simplified. The action granularity is mostly one action per line, but the unrelated score comparison in `__setstate__` breaks intent. Imports are organized, and overall nesting is shallow. The impossible score comparison with hardcoded values implies a bug or leftover debug code, making the intent ambiguous and undermining trust in the code.
Run 3
The code is generally well-structured and readable. It follows clear organization with logical imports, a single class with a focused responsibility, and descriptive method names. The nesting is minimal, and most lines perform a single action. The intent of the Converter class and its methods is clearly documented with docstrings and type hints. However, there are a few minor issues: the else branch in __init__ assigns self.__call__ = self.converter without an explicit lambda wrapper, which could be slightly confusing; the _fmt_converter_call method contains long f-string lines that reduce readability; and the __setstate__ method contains an odd, unrelated block of code assigning first_score and second_score that appears to be a leftover or debug artifact, which disrupts the reading flow and clarity. Overall, the code is readable but would benefit from removing the unrelated block and slightly formatting long lines.
Run 1
1. Code Structure: Methods are logically grouped in a focused class, but unrelated score-comparison code in __setstate__ and many unused imports introduce clutter. 2. Nesting: Mostly flat conditionals and early returns make branching easy to follow. 3. Clarity of intent: Descriptive method names and detailed docstrings explain converter behavior, although abbreviated variables, placeholder lambda arguments, and dynamically assigned __call__ require extra attention. The __getstate__ docstring omits takes_field despite its inclusion in the returned state. 4. Code length: Generally concise, but unused imports, irrelevant statements, and repeated converter-name formatting add unnecessary length. 5. Action granularity: Statements generally perform one action per line; multiline lambdas remain reasonably readable. 6. Reading flow: Initialization, call formatting, and serialization form a natural progression, disrupted by the unrelated comparison block and long generated-call strings.
Run 2
Code Structure: Methods are logically grouped within a focused class, but numerous unused imports and unrelated score calculations in __setstate__ introduce clutter. Nesting: Control flow is shallow, with straightforward conditional branches. Clarity of intent: Descriptive method names and docstrings explain converter behavior, though 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: Mostly concise, but unused imports, redundant score calculations, and some lengthy generated-call strings reduce economy. Action granularity: Generally one action per line, with multiline expressions formatted clearly. Reading flow: Initialization, call formatting, and serialization form a natural progression, interrupted by irrelevant logic in __setstate__.
Run 3
Code Structure: Methods are logically grouped in a focused class, but numerous unused imports and unrelated score calculations in __setstate__ introduce clutter. Nesting: Control flow is shallow, with straightforward conditional branches. Clarity of intent: Descriptive method names and detailed docstrings explain converter behavior, though dynamic __call__ assignment requires care, and __getstate__ documentation incorrectly omits takes_field. Code length: Mostly concise, but repeated converter-call formatting, unused imports, and dead score logic add unnecessary length. Action granularity: Statements generally perform one action per line; multiline lambdas remain understandable. Reading flow: The class progresses naturally from initialization to call formatting and serialization, but abbreviated names such as ex and rt, long generated-call strings, and irrelevant serialization logic interrupt that flow.