Sample
pyint-97043e6fccbf-SRC
Unmodified source class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0.001 | 0–1; higher is more readable |
| Dorn | 0.755 | 0–1; higher is more readable |
| Mi | 0.591 | 0–1; higher is more readable |
| LLOC | 27 | 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.585 | 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. | 896.111 | −29.572 |
| 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.211 | −6.317 |
Intercept 8.87 + feature contributions = -7.418 (log-odds).
Score = sigmoid(-7.418) = 0.001.
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. | 49 | −0.699 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 40 | +0.646 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 40 | −0.497 |
| 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. | 74.96 | +0.49 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.049 | +0.462 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 73.48 | +0.381 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 48.697 | +0.271 |
Intercept 0.07 + feature contributions = 1.125 (log-odds).
Score = sigmoid(1.125) = 0.755.
| Score | 0.591 |
|---|
| Score | 27 |
|---|
Run 1
The code is generally readable with clear class and method names, sensible docstrings, and consistent use of imports. Structure is logical, nesting is minimal, and actions are mostly one per line. Some issues slightly reduce clarity: the `__slots__` attribute is unnecessary for an extractor class, imports are scattered inside methods rather than centralized, and the `get_first_param_type` method creates a list unnecessarily. The conditional in `get_return_type` spans multiple lines and could be simplified for better flow. Overall, intent is clear but minor redundancies and import placement slightly hinder readability.
Run 2
The code is well-structured with a clear single-purpose class and focused methods. Docstrings explain intent clearly. Nesting is minimal and logic is flat, with early returns avoiding deep indentation. Lines are concise and each performs one logical action. Reading flow is natural: initialization, parameter extraction, then return type extraction. The repeated `import inspect` inside methods is slightly unusual but harmless; it could be centralized but doesn't severely impact readability. Overall, the code is easy to follow and maintain.
Run 3
The code is well-structured and readable. It uses a clear class with focused methods, shallow nesting, descriptive names, and concise logic. Imports inside methods are slightly unconventional; otherwise the code is clean and maintainable.
Run 1
Code Structure: A small, cohesive class separates signature extraction from parameter and return annotation lookup. Nesting: Shallow conditionals and early returns keep control flow easy to follow. Clarity of intent: Descriptive method names and docstrings explain the purpose, although 'sig' is abbreviated and 'callable' shadows a built-in name. Code length: Concise overall, but repeated local imports, unused module-level imports, and converting all parameters to a list add minor clutter. Action granularity: Each statement performs a distinct action, with no compressed multi-action lines. Reading flow: Initialization followed by two focused accessors is natural and consistent; the split return-annotation condition slightly interrupts an otherwise smooth presentation.
Run 2
Code Structure: A small, cohesive class cleanly separates signature extraction from annotation retrieval. Nesting: Shallow conditionals and early returns keep complexity low. Clarity of intent: Descriptive method names and docstrings make the purpose clear, though 'callable' shadows a built-in and 'sig' is abbreviated. Code length: Concise overall, but repeated local inspect imports, unused module imports, and converting all parameters to a list add minor clutter. Action granularity: Each statement generally performs one action, with no compressed multi-statement lines. Reading flow: Initialization followed by focused accessor methods is natural; the multiline return-annotation condition is slightly cumbersome but remains easy to follow.
Run 3
Code Structure: The class cleanly separates signature extraction from parameter and return annotation retrieval. Nesting: Shallow conditionals and an early return keep control flow easy to follow. Clarity of intent: Descriptive method names and docstrings explain the purpose, though `sig` is abbreviated and `callable` shadows a built-in. Code length: Concise overall, but repeated local `inspect` imports and unused top-level imports add clutter. Action granularity: Each statement performs a single clear action. Reading flow: Initialization followed by two related accessor methods creates a natural progression; the multiline return-annotation condition slightly interrupts otherwise straightforward reading.