Sample
pyint-7ed9c516731e-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.786 | 0–1; higher is more readable |
| Mi | 0.137 | 0–1; higher is more readable |
| LLOC | 41 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 14 | 0–20; mean of three runs |
| GPT-6.1 Sol | 14.33 | 0–20; mean of three runs |
| BTTF | 0.418 | 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. | 1788.22 | −59.011 |
| Source linesThe number of non-empty source lines. | 62 | +24.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.637 | −6.955 |
Intercept 8.87 + feature contributions = -32.296 (log-odds).
Score = sigmoid(-32.296) = 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. | 63 | −1.194 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 48 | +0.923 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 98.921 | +0.792 |
| 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. | 98.952 | −0.526 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 61.79 | +0.454 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.058 | +0.383 |
Intercept 0.07 + feature contributions = 1.299 (log-odds).
Score = sigmoid(1.299) = 0.786.
| Score | 0.137 |
|---|
| Score | 41 |
|---|
Run 1
The code follows a logical class structure and maintains good type annotations, but several issues reduce readability. The nested 'decorator' function and the unrelated scoring variables ('first_score', 'second_score', 'higher_score') inserted inside the 'command' method disrupt clarity and indicate a confused or bloated implementation. Nesting is moderate but noticeable, with multiple layers inside the method (decorator inside command, conditional inside decorator). The intent of the 'command' method is reasonably clear, but the extra score-related block is ambiguous and unnecessary. Code length is modest, but some lines are long due to type comments and chained calls. Action granularity is mixed: the conditional block is well-spaced, but the return statement combines a call, type comment, and nested call in one line. The reading flow is interrupted by the unexpected score variables, making the code feel like it contains leftover debug or example logic, pulling the score down despite otherwise clean structure and documentation.
Run 2
The code is generally readable with clear docstrings, type hints, and a logical class structure. However, several issues reduce its score. The nesting is moderate—the decorator inside command() adds a level, though it's not excessive. The primary problem is the unrelated and confusing block comparing 'first_score' and 'second_score', which has no apparent purpose and disrupts the flow. This is an example of ambiguous intent and unnecessary code length. Additionally, the use of type: ignore comments and long function signatures slightly hamper readability. Reading flow is natural in most places but abruptly interrupted by the score-comparison code. Action granularity is mostly good, but some lines combine multiple operations (e.g., kwargs.pop and conditional wrapping). Overall, the code is understandable but would be much clearer without the extraneous score block and with slightly less dense type annotations.
Run 3
The code is generally readable and well-structured, with clear imports, type hints, and docstrings. The AppGroup class follows a logical order and methods are concise. However, there are a few readability issues: an irrelevant and unexplained score-comparison block (first_score, second_score, higher_score) is inserted inside the decorator, breaking clarity and adding dead code. This artificial nesting slightly increases complexity and obscures intent. The use of `# type: ignore` comments is acceptable but adds minor noise. Overall, the code demonstrates good use of flat structure, clear naming, and natural reading flow, but the unrelated score block and some redundancy prevent a higher score.
Run 1
Code Structure: The class and its two methods are logically organized, but numerous unused imports and an unrelated score comparison introduce clutter. Nesting: The inner decorator and conditional branches create moderate, manageable nesting; the score comparison adds an unnecessary level. Clarity of intent: Descriptive names, type annotations, and docstrings clearly explain the Click wrapper behavior, but the unused higher_score calculation distracts from that purpose. Code length: The core implementation is concise, while the import list and irrelevant calculation make the snippet unnecessarily long. Action granularity: Statements generally perform one action per line, although the chained superclass command invocation is relatively dense. Reading flow: Method ordering and documentation support a natural flow, interrupted by unrelated scoring logic and reduced spacing around imports and the class definition.
Run 2
Code Structure: The class and methods are logically organized, but numerous unused imports and unrelated score-comparison logic add clutter. Nesting: The nested decorator is appropriate, and conditional nesting remains shallow. Clarity of intent: Descriptive method names, type annotations, and docstrings explain the Click behavior well; however, the unused higher_score calculation obscures the decorator's purpose. Code length: The functional implementation is compact, but irrelevant calculations and imports make the snippet unnecessarily long. Action granularity: Statements generally perform one action per line, although the final decorator return combines command creation and application. Reading flow: The progression from command wrapping to group configuration is natural, but the arbitrary score comparison interrupts the main logic.
Run 3
Code Structure: The class and methods are logically organized, but numerous unused imports and unrelated score-comparison logic clutter the implementation. Nesting: The nested decorator is appropriate, and conditional nesting remains shallow. Clarity of intent: Descriptive names, type annotations, and docstrings explain the Click customization clearly; however, the unused higher_score calculation obscures the decorator's purpose. Code length: The functional implementation is compact, but unnecessary imports and dead code make the snippet longer than needed. Action granularity: Statements generally perform one action per line, although the chained superclass command invocation requires some unpacking. Reading flow: The command and group methods follow a natural progression, but irrelevant score handling interrupts the main logic.