Sample

pyint-4976b30e68b0-SRC

Unmodified source class

Lines36

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.7820–1; higher is more readable
Mi0.7250–1; higher is more readable
LLOC25Logical lines; fewer is more readable
DeepSeek V4 Pro16.330–20; mean of three runs
GPT-6.1 Sol170–20; mean of three runs
BTTF0.5050–1; higher is more readable

Views

Source code

from __future__ import annotations import errno import json import os import types import typing as t from werkzeug.utils import import_string class ConfigAttribute(t.Generic[T]): """Makes an attribute forward to the config""" def __init__( self, name: str, get_converter: t.Callable[[t.Any], T] | None = None ) -> None: self.__name__ = name self.get_converter = get_converter @t.overload def __get__(self, obj: None, owner: None) -> te.Self: ... @t.overload def __get__(self, obj: App, owner: type[App]) -> T: ... def __get__(self, obj: App | None, owner: type[App] | None = None) -> T | te.Self: if obj is None: return self rv = obj.config[self.__name__] if self.get_converter is not None: rv = self.get_converter(rv) return rv # type: ignore[no-any-return] def __set__(self, obj: App, value: t.Any) -> None: obj.config[self.__name__] = value

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.1248.238−41.192
Source linesThe number of non-empty source lines.36+14.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.552−6.828

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

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.85.946+0.582
Indentation frequencyHow rapidly indentation changes from line to line.35+0.473
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.36−0.238
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.109−0.118
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.35.598+0.088
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.85.973+0.024

Intercept 0.07 + feature contributions = 1.279 (log-odds).
Score = sigmoid(1.279) = 0.782.

Score0.725
Score25
Run 1

The code is generally readable and well-structured. It follows common Python patterns for descriptors and uses type hints effectively. The class has a clear purpose (forwarding attribute access to a config dictionary) and the methods are concise, each performing a single logical action. The use of overloaded type signatures improves clarity for type checkers but adds some verbosity for human readers. The getter method is straightforward and handles the None-object case appropriately. Minor readability drawbacks include the slightly obscure use of 'te.Self' (which appears to be a typo for 'typing.Self') and the redundant type ignore comment. Overall, the structure is flat, the naming is clear, and the flow is logical, making it easy to understand for developers familiar with Python descriptors and configuration patterns.

Run 2

The code is generally readable with clear structure and intent. It defines a ConfigAttribute descriptor with type hints, overloads, and docstring. The class is small and logically organized. There are minor issues: the `te` module is referenced but not imported, and the return type annotation in `__get__` is slightly complex, reducing clarity. Nesting is minimal, and each method performs a single logical action. The overloads improve typing but add some verbosity. Overall, it is concise and well-structured, but the undefined `te` and type-annotation complexity prevent a higher score.

Run 3

The code is well-structured and readable. It uses type hints consistently, clear naming, and follows a logical layout. The class is focused and methods are short, with one action per line mostly. Overloads improve clarity for different usage contexts. Minor deductions: the presence of 'te.Self' likely a typo/import issue, and the ignore comment slightly reduces polish. Overall, the code demonstrates strong readability with only minor issues.

Run 1

Code Structure: The descriptor class is logically organized into initialization, overloaded access signatures, retrieval, and assignment. Nesting: Minimal nesting and an early return keep control flow flat. Clarity of intent: The docstring, method names, and type annotations communicate configuration forwarding and optional conversion, though the abbreviated variable 'rv' and undefined names T, te, and App reduce standalone clarity. Code length: Concise overall; overloads add length but provide useful typing information. Action granularity: Statements generally perform one action per line, with no compressed compound operations. Reading flow: Retrieval proceeds naturally from handling class access to looking up, converting, and returning the value. Blank lines separate logical steps well, although stronger spacing between imports and the class and removal of unused imports would improve presentation.

Run 2

Code Structure: The descriptor class is logically organized into initialization, overloaded access signatures, retrieval, and assignment. Nesting: Shallow conditionals and an early return keep control flow simple. Clarity of intent: The docstring, method names, and type annotations clearly convey configuration forwarding with optional conversion, although T, te, and App lack visible definitions, and rv is a vague variable name. Code length: The implementation is concise; overloads add useful typing detail, but several imports are unused in this snippet. Action granularity: Each statement performs a single action, with no compressed multi-action lines. Reading flow: Methods follow a natural order, and whitespace separates retrieval, conversion, and return steps. Missing typing context and limited spacing around top-level declarations slightly reduce standalone readability.

Run 3

Code Structure: The descriptor is logically organized into initialization, getter overloads, getter implementation, and setter. Nesting: Shallow conditionals and an early return keep complexity low. Clarity of intent: The docstring, descriptive member names, and type annotations clearly communicate config forwarding and optional conversion, though T, te, and App are undefined in the supplied snippet, and rv is a less descriptive name. Code length: The implementation is concise, but unused imports add clutter; overloads add length while providing useful typing information. Action granularity: Each executable line generally performs one action. Reading flow: Methods follow a natural sequence, with whitespace separating logical steps, although missing spacing around the class declaration and unresolved typing references slightly interrupt readability.