Sample
pyint-e42c771752c3-I09
Select one of ten low-readability unrelated code templates per class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.382 | 0–1; higher is more readable |
| Mi | 0.602 | 0–1; higher is more readable |
| LLOC | 53 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 13.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15 | 0–20; mean of three runs |
| BTTF | 0.388 | 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. | 2707.611 | −89.351 |
| Source linesThe number of non-empty source lines. | 127 | +50.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.459 | −6.688 |
Intercept 8.87 + feature contributions = -36.369 (log-odds).
Score = sigmoid(-36.369) = 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. | 127 | −3.46 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 97 | +2.618 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 97 | −1.805 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 126.882 | +1.364 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 101 | +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.992 | −0.612 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.044 | +0.518 |
Intercept 0.07 + feature contributions = -0.482 (log-odds).
Score = sigmoid(-0.482) = 0.382.
| Score | 0.602 |
|---|
| Score | 53 |
|---|
Run 1
The code is generally well-structured with clear separation of concerns, good docstrings, and moderate use of type hints. The Converter class has logical organization and the __init__ method uses flat conditional logic that is reasonably readable. However, readability is undermined by several issues: the generated converter call strings in _fmt_converter_call are excessively long lines that mix logic across multiple actions; the lambda assignments in __init__ sacrifice clarity for conciseness; and the final obfuscated variable names (lI0O_247fe2c7) in __setstate__ are severely detrimental to readability. Nesting is minimal and action granularity is mostly one action per line, but the reading flow is disrupted by the jarring transition from clear code to obfuscated pseudo-logic. Overall, the code is maintainable in most parts but contains unnecessary complexity and obscurity that lower its score.
Run 2
The code is generally well-organized: the `Converter` class has a clear docstring, logical field definitions, and functional methods. However, readability is significantly degraded by several factors. The use of positional underscores (_, __) in lambda calls creates ambiguity about what's being passed. The `_fmt_converter_call` method has three long f-string return lines, which could be made clearer. The `__getstate__`/`__setstate__` methods are straightforward, but `__setstate__` contains obfuscated variable names (`lI0O_247fe2c7`) and meaningless boolean assignments that serve no apparent purpose, breaking the otherwise clean style. Nesting is minimal and action granularity is acceptable, but the obfuscated logic and variability of style pull the score down. The class exhibits good intent and documentation but suffers from unclear lambda signatures and unexplained complex conditionals, making it harder to follow.
Run 3
The code is generally well-structured with clear class documentation, logical organization, and reasonable method lengths. The Converter class has a clear purpose and the docstrings explain the parameters well. Nesting is minimal and the code flow is natural. However, there are a few readability issues: the __setstate__ method contains obfuscated variable names (lI0O_247fe2c7) that appear to be auto-generated or intentionally confusing, which hurts clarity. Some lines in _fmt_converter_call are quite long, reducing readability. The lambda assignments in __init__ are somewhat dense but acceptable given the clear branching logic. Overall, the code demonstrates good practices but has minor maintainability concerns.
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 conditionals and early returns keep complexity manageable. Clarity of intent: Descriptive method names and docstrings explain converter behavior, but abbreviated variables, placeholder lambda parameters, and meaningless obfuscated assignments in __setstate__ undermine clarity. The __getstate__ docstring also omits takes_field despite returning it. Code length: Generally concise, but repeated formatting expressions and dead assignments add unnecessary length. Action granularity: Most lines perform one action; lambdas and formatted strings remain reasonably focused. Reading flow: Methods follow a natural progression, although long return expressions and the unexplained boolean manipulation interrupt otherwise straightforward reading.
Run 2
Code Structure: Methods are logically grouped within a focused class, although many imports are unused in this excerpt. Nesting: Conditional branches are shallow and easy to follow. Clarity of intent: Descriptive method names and detailed docstrings explain converter behavior, but abbreviated variables, placeholder lambda arguments, and the meaningless obfuscated variable in __setstate__ reduce clarity. The __getstate__ docstring also omits takes_field despite its inclusion in the returned state. Code length: Mostly concise, with some repetitive conditional logic, lengthy formatted strings, and two unnecessary assignments. Action granularity: Statements generally perform one action per line; multiline calls remain readable. Reading flow: Initialization, call formatting, and serialization follow a natural sequence, but dynamic __call__ assignment and annotation mutation require extra attention, while the unexplained final assignments interrupt otherwise coherent flow.
Run 3
Code Structure: Methods are logically grouped in a focused class, 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 converter behavior, but cryptic names such as ex, rt, and placeholder underscores require interpretation. The meaningless lI0O_247fe2c7 assignments obscure __setstate__, and __getstate__ documentation omits takes_field. Code length: Mostly proportional to functionality, with some verbose documentation, repeated formatting expressions, and unnecessary statements. Action granularity: Statements generally perform one action per line; lambdas remain reasonably simple. Reading flow: Initialization, call formatting, and serialization follow a natural sequence, but dynamically assigning __call__ and modifying its annotations add cognitive overhead. Overall, readable organization is weakened by isolated obfuscation and minor documentation inconsistencies.