Sample
pyint-e4dd2048c2c8-SRC
Unmodified source class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.764 | 0–1; higher is more readable |
| Mi | 0.138 | 0–1; higher is more readable |
| LLOC | 36 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 16.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs |
| BTTF | 0.722 | 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. | 1634.205 | −53.929 |
| Source linesThe number of non-empty source lines. | 56 | +22.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.701 | −7.052 |
Intercept 8.87 + feature contributions = -29.71 (log-odds).
Score = sigmoid(-29.71) = 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. | 57 | −0.982 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 97.333 | +0.766 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 42 | +0.716 |
| 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.93 | −0.525 |
| 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. | 55.84 | +0.371 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.06 | +0.361 |
Intercept 0.07 + feature contributions = 1.174 (log-odds).
Score = sigmoid(1.174) = 0.764.
| Score | 0.138 |
|---|
| Score | 36 |
|---|
Run 1
The code is well-structured and readable. It has a clear class definition with two methods that are logically separated, minimal nesting, and concise docstrings explaining purpose. Imports are organized, type hints are used consistently, and each method has a single responsibility returning decorators. The use of `kwargs.pop` and `setdefault` is clear. Minor deductions: type-ignore comments and the long method signatures slightly reduce flow, but overall clarity and maintainability are high.
Run 2
The code is well-structured and readable, with clear class and method definitions. It uses type hints consistently and docstrings to explain purpose. Nesting is minimal—only a single nested function decorator inside the command method. Each action (popping kwargs, wrapping with app context, delegating to super) is on its own line, aiding clarity. The group method is very concise, setdefault and super call are clean. Import organization follows conventional grouping, though some imports like 'os' and 'sys' appear unused, slightly reducing clarity. The no-any-return type ignores are minor clutter but common in real-world code. Overall, the reading flow is natural and the intent is unambiguous for someone familiar with Click and Flask patterns.
Run 3
The code is well-structured, with clear class and method organization, flat nesting, and concise, purpose-driven methods. Type hints and docstrings clarify intent and usage. The command and group methods use a decorator pattern that is readable, though the double-nested decorator in command() adds slight complexity. Lines are short and actions are generally one per line, supporting a natural reading flow. The use of `# type: ignore` comments is minor clutter but standard for compatibility. Overall, this is highly readable code, slightly reduced from a perfect score due to decorator nesting and type-ignore noise.
Run 1
Code Structure: The class cleanly separates command and group customization, although the extensive import block distracts from the small implementation. Nesting: Limited to one inner decorator and a simple conditional, making control flow easy to follow. Clarity of intent: Descriptive method names, type annotations, and explanatory docstrings clearly communicate the application-context behavior; with_appcontext is not defined in the excerpt. Code length: Methods are concise, but many imports are unused in the shown code and verbose typing adds visual weight. Action granularity: Statements generally perform one action each, though the chained superclass command invocation combines creation and application of a decorator. Reading flow: Both methods follow a natural setup-and-return sequence; long signatures, type-ignore comments, and minimal spacing around top-level sections slightly interrupt readability.
Run 2
Code Structure: The class is logically organized into two focused methods, with helpful docstrings, although many imports are unused in this excerpt. Nesting: Shallow nesting; the inner decorator and single conditional are easy to follow. Clarity of intent: Descriptive method names, type annotations, and documentation clearly explain application-context wrapping and the default group class. The external with_appcontext dependency is not defined here. Code length: Methods are concise, but the extensive import block adds noise relative to the small implementation. Action granularity: Statements generally perform one action per line; the chained superclass call and decorator application require slightly more attention. Reading flow: The progression from configuration to wrapping to returning the decorator is natural. Long type signatures, type-ignore comments, and the explicit super(AppGroup, self) call introduce minor visual and conceptual friction.
Run 3
Code Structure: The class cleanly separates command and group customization, although numerous imports are unused in this snippet. Nesting: Shallow overall; the nested decorator and single conditional are appropriate. Clarity of intent: Descriptive method names, type hints, and informative docstrings clearly explain application-context wrapping and the default group class. The external with_appcontext helper requires surrounding context. Code length: Methods are concise, though imports and verbose annotations add visual overhead. Action granularity: Most lines perform one action; the chained super().command(...)(f) expression combines command creation and decorator application. Reading flow: Documentation precedes implementation consistently, and execution is easy to follow, with minor interruptions from type-ignore comments and densely formatted signatures.