Sample

pyint-97043e6fccbf-SRC

Unmodified source class

Lines49

Scores

MethodScoreScale
Posnett0.0010–1; higher is more readable
Dorn0.7550–1; higher is more readable
Mi0.5910–1; higher is more readable
LLOC27Logical lines; fewer is more readable
DeepSeek V4 Pro16.670–20; mean of three runs
GPT-6.1 Sol170–20; mean of three runs
BTTF0.5850–1; higher is more readable

Views

Source code

import sys import threading from collections.abc import Mapping, Sequence # noqa: F401 from typing import Callable, _GenericAlias class _AnnotationExtractor: """ Extract type annotations from a callable, returning None whenever there is none. """ __slots__ = ["sig"] def __init__(self, callable): import inspect try: self.sig = inspect.signature(callable) except (ValueError, TypeError): # inspect failed self.sig = None def get_first_param_type(self): """ Return the type annotation of the first argument if it's not empty. """ import inspect if not self.sig: return None params = list(self.sig.parameters.values()) if params and params[0].annotation is not inspect.Parameter.empty: return params[0].annotation return None def get_return_type(self): """ Return the return type if it's not empty. """ import inspect if ( self.sig and self.sig.return_annotation is not inspect.Signature.empty ): return self.sig.return_annotation return None

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(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

FeatureValueContribution
(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.

Score0.591
Score27
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.