Sample
pyint-72b67f997500-I01
Remove comments and docstrings
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.619 | 0–1; higher is more readable |
| Mi | 0.771 | 0–1; higher is more readable |
| LLOC | 53 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 15 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16.67 | 0–20; mean of three runs |
| BTTF | 0.625 | 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. | 2129.347 | −70.268 |
| Source linesThe number of non-empty source lines. | 115 | +46 |
| 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.489 | −6.734 |
Intercept 8.87 + feature contributions = -22.132 (log-odds).
Score = sigmoid(-22.132) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 115 | +3.241 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 116 | −3.071 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 115 | −2.218 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 114.89 | +1.196 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.043 | +0.528 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 80.983 | +0.502 |
| 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. | 80.966 | +0.236 |
Intercept 0.07 + feature contributions = 0.484 (log-odds).
Score = sigmoid(0.484) = 0.619.
| Score | 0.771 |
|---|
| Score | 53 |
|---|
Run 1
The code is highly readable with a clear, logical structure and flat nesting. It uses enums to encapsulate related constants and documents each enum member with docstrings. The ClassProps class organizes related metadata with a clear __slots__ declaration and an explicit constructor assigning each parameter to an attribute. Property logic is straightforward. Minor deductions are due to the verbose constructor, which could be simplified (e.g., using dataclasses or kwargs), and an unused import (sys) that suggests minor cleanup. Overall, intent is clear, actions are well-granulated, and the flow is natural.
Run 2
The code is well-structured with clear imports, type hints, and organized classes. It uses enums with descriptive names and docstrings (albeit sparse). The ClassProps class is flat with minimal nesting and methods are straightforward. However, readability suffers from the very long __init__ with 16 parameters, which creates a large cognitive load and makes the constructor harder to scan. The __slots__ tuple and parameter list mirror each other but are verbose. Action granularity is good—each attribute assignment is on its own line. Reading flow is natural but interrupted by the large parameter block. Missing docstrings on ClassProps and __init__ reduce clarity of intent. Overall, the code is maintainable and clear but could be improved by grouping related parameters or using a dataclass-like pattern to reduce redundancy.
Run 3
The code is moderately readable but has significant issues. The structure is mostly logical with clear class organization, but the ClassProps class has a very long __init__ with 15 parameters creating cognitive load. Nesting is acceptable with only two levels. Clarity of intent is mixed: imported names are reasonably descriptive but the purpose of ClassProps remains somewhat ambiguous without context. Code length is excessive - the 15-parameter constructor and slot definitions could be consolidated. Action granularity is good initially but assignments could be grouped. The reading flow is disrupted by parameter overload and repetitive self-assignment patterns. The enum classes with docstrings are clear, but the overall design lacks sufficient abstraction to make the configuration object approachable.
Run 1
1. Code Structure: Logically organized into configuration enums, slots, initialization, and a derived property; the many imports add clutter to this excerpt. 2. Nesting: Shallow and easy to follow; nested enums appropriately group related concepts. 3. Clarity of intent: Descriptive field names and enum documentation communicate configuration behavior, though ClassProps lacks a class description and constructor type annotations. 4. Code length: Straightforward but repetitive; the same 16 fields appear in slots, parameters, and assignments. Excess blank lines reduce compactness. 5. Action granularity: Each assignment performs one action per line, and the property expression is neatly split. 6. Reading flow: Natural progression from definitions to initialization and behavior, slightly disrupted by whitespace and the lengthy field lists.
Run 2
Code Structure: Imports, related enums, slots, initialization, and a derived property are logically organized. Nesting: Shallow and appropriate; nested enums group related concepts without complicating control flow. Clarity of intent: Descriptive attribute names and enum documentation make the class's purpose mostly clear, but the class and constructor lack explanatory docstrings and parameter type annotations. Code length: The long constructor and repetitive assignments add boilerplate, although they are straightforward and consistent with explicit slot initialization. Action granularity: Each assignment performs one action per line, and the property expression is cleanly formatted. Reading flow: Predictable ordering and matching slot, parameter, and assignment sequences aid navigation. Excessive blank lines, trailing whitespace, and numerous imports not used in this excerpt introduce minor visual noise.
Run 3
Code Structure: Imports, related enums, slots, initialization, and the derived property are logically organized. Nesting: Shallow and appropriate; nested enums clearly belong to ClassProps. Clarity of intent: Descriptive names and enum documentation communicate purpose, although the class and constructor lack explanatory documentation and parameter annotations. Code length: Mostly concise, but the large constructor and repeated slot names and assignments introduce boilerplate. Action granularity: Each assignment performs one action per line, and the property expression is cleanly split. Reading flow: Consistent ordering between slots, parameters, and assignments aids navigation; excessive blank lines, trailing whitespace, and the lengthy import section slightly disrupt flow.