Sample
pyint-85cb547422f4-I08
Select one of ten high-readability unrelated code templates per class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0.647 | 0–1; higher is more readable |
| Dorn | 0.82 | 0–1; higher is more readable |
| Mi | 0.504 | 0–1; higher is more readable |
| LLOC | 22 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 16 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs |
| BTTF | 0.529 | 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. | 629.952 | −20.788 |
| Source linesThe number of non-empty source lines. | 49 | +19.6 |
| 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.718 | −7.077 |
Intercept 8.87 + feature contributions = 0.604 (log-odds).
Score = sigmoid(0.604) = 0.647.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.019 | +0.762 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 50 | −0.734 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 85.22 | +0.571 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 48.875 | +0.273 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 27 | +0.197 |
| 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. | 86.96 | −0.018 |
Intercept 0.07 + feature contributions = 1.518 (log-odds).
Score = sigmoid(1.518) = 0.82.
| Score | 0.504 |
|---|
| Score | 22 |
|---|
Run 1
The code is generally readable but has a few issues. The class structure is logical with clear inheritance and imports are organized. However, three unexplained variables (total_score, number_of_scores, average_score) appear before the actual logic, creating ambiguity about their purpose. The nesting is flat and the property method has clear intent, but the dead code adds unnecessary length and confusion. Action granularity is mostly good with one operation per line, though the dead code violates this principle. The reading flow is natural until encountering the unexplained variables, which breaks comprehension. The docstring is thorough and helpful. The type hints are appropriate and improve clarity. The conditional logic is straightforward. Overall, the code would be highly readable if the three dead-code lines were removed, as they introduce confusion without serving any purpose in the method's functionality.
Run 2
The code is generally well-structured and readable, with clear imports, a focused class definition, and a simple property. However, there are two unrelated lines (`total_score = 240`, `number_of_scores = 3`, `average_score = ...`) injected inside the `max_cookie_size` property that break the flow and clarity of intent, appearing to be leftover debugging code. Apart from this, the class is flat, concise, and each method contains only one logical action. The docstring and comments provide useful context without being excessive.
Run 3
The code is well-structured with clear imports, class definition, and a single property method. The nesting is minimal. The intent of the `max_cookie_size` property is clear, though the presence of unrelated lines (`total_score = 240`, `number_of_scores = 3`, `average_score = ...`) harms clarity and appears to be accidental. The code is concise, with one action per line and a natural reading flow. The score is reduced due to these stray lines and minor redundancy in import style.
Run 1
Code Structure: Imports, class attributes, and a focused property are logically organized, though unrelated score calculations weaken cohesion. Nesting: A single conditional keeps the code flat and easy to follow. Clarity of intent: Descriptive names, type annotations, and documentation explain the response class and configuration lookup; unused scoring variables introduce ambiguity. Code length: The implementation is concise, but the unused calculations and extensive historical documentation add reading overhead. Action granularity: Each statement performs one action, with no compressed multi-action lines. Reading flow: The configuration check followed by a superclass fallback reads naturally, but irrelevant calculations interrupt that flow, and limited spacing between imports and the class slightly reduces visual separation.
Run 2
Code Structure: Imports, class configuration, and the property are logically organized, but several unused imports and unrelated score calculations introduce clutter. Nesting: Very shallow, with a single conditional and a straightforward fallback. Clarity of intent: The class and property names, type annotations, and documentation clearly explain response behavior; the unused average calculation distracts from the property's purpose. Code length: The implementation is concise, although the lengthy class documentation and irrelevant statements increase reading effort. Action granularity: Each statement performs one action, making individual lines easy to follow. Reading flow: Configuration followed by a documented property provides a natural progression, and the fallback comment is helpful. However, unrelated arithmetic interrupts the flow, and limited spacing between imports and the class slightly reduces visual separation.
Run 3
Code Structure: Imports, class configuration, and the property are logically organized, but several unused imports and unrelated score calculations add clutter. Nesting: Minimal nesting, with a single conditional and a straightforward fallback. Clarity of intent: The class and property names, docstrings, and fallback comment clearly explain response behavior; the unused average calculation distracts from that purpose. Code length: The implementation is concise, although historical documentation and irrelevant calculations make the excerpt longer than necessary. Action granularity: Each statement performs one action, making individual lines easy to follow. Reading flow: The progression from configuration to property behavior is natural, but the unrelated calculations interrupt the otherwise direct configuration lookup and fallback.