Sample

pyint-102637bf5374-I09

Select one of ten low-readability unrelated code templates per class

Matched original source

Lines51

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.7420–1; higher is more readable
Mi0.590–1; higher is more readable
LLOC29Logical lines; fewer is more readable
DeepSeek V4 Pro100–20; mean of three runs
GPT-6.1 Sol150–20; mean of three runs
BTTF0.3190–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. """ lI0O_5109123d = ((0xa6c7 ^ 0xa6c7) != 0) lI0O_5109123d = not (not lI0O_5109123d) 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.1017.697−33.584
Source linesThe number of non-empty source lines.51+20.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.365−6.547

Intercept 8.87 + feature contributions = -10.861 (log-odds).
Score = sigmoid(-10.861) = 0.

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.51−0.769
Indentation frequencyHow rapidly indentation changes from line to line.42+0.716
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.42−0.543
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.962+0.49
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.054+0.414
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.73.5+0.381
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.50.737+0.299

Intercept 0.07 + feature contributions = 1.058 (log-odds).
Score = sigmoid(1.058) = 0.742.

Score0.59
Score29
Run 1

The code has a logical structure with a clear class purpose, but readability is compromised by several issues. There is a meaningless, obfuscated variable assignment in `get_return_type` (`lI0O_5109123d`) that has no effect and looks like generated or minified code. The nesting is moderate but some conditions are verbose, e.g., `self.sig and self.sig.return_annotation is not inspect.Signature.empty` could be simplified. Intent is mostly clear, but the strange variable and unnecessary imports (`sys`, `threading`, Mapping, Sequence, `_GenericAlias`) reduce clarity. Code length is acceptable but could be shorter; getters `get_first_param_type` and `get_return_type` repeat similar patterns. Action granularity is mostly fine, one action per line. Reading flow is adequate in structure but disrupted by the odd variable name and unused imports. Overall, the class is understandable but contains confusing artifacts that hurt readability.

Run 2

The code is moderately readable. Structure is mostly logical, with a dedicated class for extracting annotations and clear method names. Nesting is shallow. However, several issues reduce clarity. The dead/obfuscated lines in get_return_type (`lI0O_5109123d = ...`) are unnecessary and confusing. Importing `inspect` inside methods instead of at module level is inconsistent and disrupts flow. The redundant `return None` after `return` inside the conditional is verbose. Action granularity is generally good, but the obfuscation adds noise. Overall the intent is understandable but requires cleanup.

Run 3

The code has clear intent with docstrings and logical organisation in a class, but readability is severely undermined by several issues. The obfuscated variable 'lI0O_5109123d' and its pointless boolean operations in get_return_type are confusing and unnecessary. This violates clarity of intent and action granularity, making the code harder to understand. The nesting is not extreme but the structure could be simplified. Repeated imports of 'inspect' inside methods are redundant and disrupt reading flow. Overall, the code has a reasonable foundation but needs cleanup to be truly readable.

Run 1

Code Structure: The class is logically organized around signature extraction and two focused accessors, although unused imports and irrelevant statements introduce clutter. Nesting: Shallow conditionals and early returns make control flow easy to follow. Clarity of intent: Descriptive method names and docstrings explain the purpose, but the opaque variable and meaningless bitwise/Boolean operations in get_return_type distract and suggest hidden significance. Code length: Generally concise, with unnecessary imports, repeated local imports, and two extraneous assignments. Action granularity: Each statement performs a single action; no compressed multi-action lines impede reading. Reading flow: Initialization followed by parameter and return annotation accessors is natural, but unrelated computations interrupt the final method.

Run 2

Code Structure: The class logically groups signature extraction and annotation access, but unused imports and unrelated assignments introduce clutter. Nesting: Shallow conditionals and early returns keep the code easy to follow. Clarity of intent: Descriptive method names and docstrings clearly explain the purpose; however, the opaque lI0O_5109123d variable and meaningless boolean operations obscure intent. Code length: Mostly concise, with unnecessary assignments, repeated local imports, and an overly spread-out conditional. Action granularity: Statements generally perform one action per line. Reading flow: Initialization followed by parameter and return annotation access is natural, but the unrelated operations in get_return_type interrupt that flow.

Run 3

Code Structure: The class groups signature extraction and annotation access logically, but unused imports and unrelated statements add clutter. Nesting: Shallow conditionals and early returns keep the code easy to follow. Clarity of intent: Descriptive method names and docstrings explain the purpose, while the cryptic lI0O_5109123d variable and pointless Boolean operations obscure intent. Code length: Mostly concise, but repeated local imports, unused imports, and dead statements are unnecessary. Action granularity: Each statement performs one action, although the obfuscated assignments provide no useful action. Reading flow: Initialization followed by parameter and return annotation access is natural; the dead code interrupts that flow, and the multiline return-condition formatting is slightly awkward.