Sample

pyint-f2aaeb771b00-I02

Shorten method, parameter, and local names without collisions

Matched original source

Lines36

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.7790–1; higher is more readable
Mi0.7180–1; higher is more readable
LLOC25Logical lines; fewer is more readable
DeepSeek V4 Pro110–20; mean of three runs
GPT-6.1 Sol14.330–20; mean of three runs
BTTF0.4770–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, nam: str, get: t.Callable[[t.Any], T] | None = None ) -> None: self.__name__ = nam self.get_converter = get @t.overload def __get__(self, obj2: None, own: None) -> te.Self: ... @t.overload def __get__(self, obj3: App, own2: type[App]) -> T: ... def __get__(self, obj4: App | None, own3: type[App] | None = None) -> T | te.Self: if obj4 is None: return self rv2 = obj4.config[self.__name__] if self.get_converter is not None: rv2 = self.get_converter(rv2) return rv2 # type: ignore[no-any-return] def __set__(self, obj5: App, val: t.Any) -> None: obj5.config[self.__name__] = val

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.1279.138−42.212
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.619−6.928

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

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.85.973+0.583
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.111−0.14
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.35.713+0.089
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.946+0.025

Intercept 0.07 + feature contributions = 1.26 (log-odds).
Score = sigmoid(1.26) = 0.779.

Score0.718
Score25
Run 1

The code has a clear purpose but suffers from readability issues. The ConfigAttribute class is logically structured, but the method signatures use confusing parameter names (obj2, obj3, obj4, obj5, own, own2, own3) that obscure intent and hurt reading flow. The overload decorators add complexity, and the type annotations are verbose, making the code feel longer than necessary. While nesting is minimal and action granularity is reasonable, the inconsistent naming pattern and dense type hints reduce clarity. The implementation logic itself is straightforward, but the naming choices make it harder to follow than it should be.

Run 2

The code shows a basic structure but has poor readability. Variable names like obj2, obj3, obj4, obj5, nam, get, and te.Self are ambiguous, making it difficult to understand the intent without deep Flask context. The naming lacks semantic meaning. The overloads create repetition and confusion. The code length is acceptable but could be more concise. Reading flow is disrupted by unclear type hints and inconsistent variable naming. The nesting is flat, which is good, but the overall clarity suffers significantly from cryptic naming. The action granularity is mostly one action per line, which is positive. However, the lack of descriptive names and the use of single-letter/abbreviated variables make the code hard to follow and maintain.

Run 3

The code is a descriptor class for Flask-style config access, with clear intent and logical flow. It uses type hints and overloads to document behavior, which aids clarity. However, readability is hindered by poorly named variables (nam, obj2, obj3, obj4, obj5, own2, own3, rv2), which obscure purpose despite the overload annotations. The structure is mostly flat and concise, but the multiple overloads with non-descriptive names make the code harder to follow than necessary. The `te` module appears inconsistent (likely a typo for `typing` or `Self`), and the inline type ignore adds minor noise. Overall, the code is maintainable but would benefit significantly from clearer variable naming and minor cleanup.

Run 1

Code Structure: The descriptor class is logically organized into initialization, overloaded access, and assignment methods, though unused imports and undefined typing names distract. Nesting: Control flow is shallow, with two simple conditionals and an early return. Clarity of intent: The docstring and config access reveal the purpose, but names such as nam, obj2–obj5, own2, and rv2 are cryptic and inconsistent. T, te, and App lack definitions or imports in the snippet, reducing self-contained clarity. Code length: The implementation is concise; overloads add useful typing information, although unrelated imports create clutter. Action granularity: Statements generally perform one action per line. Reading flow: Method ordering and whitespace support natural reading, but numbered parameter names, dense annotations, and the type-ignore comment interrupt an otherwise straightforward flow.

Run 2

Code Structure: The descriptor is logically organized into initialization, getter overloads, retrieval, and assignment. Nesting: Shallow conditionals and an early return keep control flow simple. Clarity of intent: The docstring and config access communicate the purpose, but names such as nam, obj2–obj5, own2, and rv2 are unnecessarily vague. T, te, and App are undefined in the shown snippet, and several imports are unused, adding confusion. Code length: The implementation is concise, although overloads and annotations introduce some visual overhead. Action granularity: Each statement performs a single action, making operations easy to follow. Reading flow: The methods follow a natural sequence, but inconsistent parameter naming and unexplained typing dependencies interrupt otherwise smooth reading.

Run 3

Code Structure: The descriptor is logically organized into initialization, getter overloads, retrieval, and assignment, but unrelated imports and undefined typing names (T, te, App) make the snippet less self-contained. Nesting: Shallow conditionals and an early return keep complexity low. Clarity of intent: The docstring and config access communicate the purpose, but names such as nam, obj2–obj5, own2, and rv2 are vague and inconsistent. Code length: The implementation is concise; overloads add useful typing detail, though unused imports create clutter. Action granularity: Each statement generally performs one action, making operations easy to distinguish. Reading flow: Methods follow a natural descriptor lifecycle, with helpful spacing, but inconsistent parameter names and unresolved type references interrupt comprehension.