Sample

pyint-16eb76b2e83a-I03

Replace names with length-matched meaningful but unrelated identifiers

Matched original source

Lines36

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.7830–1; higher is more readable
Mi0.7220–1; higher is more readable
LLOC25Logical lines; fewer is more readable
DeepSeek V4 Pro12.330–20; mean of three runs
GPT-6.1 Sol140–20; mean of three runs
BTTF0.470–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, node: str, sharedSession: t.Callable[[t.Any], T] | None = None ) -> None: self.__name__ = node self.get_converter = sharedSession @t.overload def __get__(self, map: None, group: None) -> te.Self: ... @t.overload def __get__(self, key: App, group: type[App]) -> T: ... def __get__(self, key: App | None, value: type[App] | None = None) -> T | te.Self: if key is None: return self map = key.config[self.__name__] if self.get_converter is not None: map = self.get_converter(map) return map # type: ignore[no-any-return] def __set__(self, key: App, state: t.Any) -> None: key.config[self.__name__] = state

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.1258.886−41.543
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.554−6.831

Intercept 8.87 + feature contributions = -25.104 (log-odds).
Score = sigmoid(-25.104) = 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.109−0.114
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.35.678+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.973+0.024

Intercept 0.07 + feature contributions = 1.285 (log-odds).
Score = sigmoid(1.285) = 0.783.

Score0.722
Score25
Run 1

The code has reasonable structure and uses modern Python features, but readability suffers from several issues. Variable names are misleading: 'map' is used where 'value' or 'config_value' would be clearer, 'sharedSession' for a converter function, and 'group'/'value' for the class parameter. The overloads add complexity without clear benefit for readability. The __get__ method has multiple responsibilities and unclear naming. The flow is somewhat natural but the semantic mismatch between names and purposes creates cognitive overhead. Type hints are good but not enough to offset confusing naming. The code is concise but at the cost of clarity, making it harder to understand intent at first read.

Run 2

The code has several readability problems. The variable names are misleading: 'map' and 'group' are used where 'obj' and 'owner' would be standard descriptors, 'sharedSession' is used for a type converter, and 'node' is used for the attribute name. Type hints reference undefined names like 'te.Self' and 'App', suggesting incomplete code. The __get__ method mixes return types (Self or T) with overloads that add complexity without clarity. 'key.config[self.__name__]' is reused instead of extracting a variable, and converting via 'get_converter' then returning 'map' obscures the data flow. The reading flow is disrupted by generic parameter T and the overload decorators, making the intent harder to grasp. While the class structure itself is flat and reasonably organized, the unclear naming and ambiguous types significantly reduce readability.

Run 3

The code is well-structured, uses modern Python typing, and has clear intent. It follows a clean class design with overloads for type clarity. The nesting is minimal, and most lines perform a single action. However, readability is slightly reduced by inconsistent naming (`sharedSession` instead of `get_converter`, `map`, `key`, `value` instead of more descriptive terms like `instance`, `owner`), which creates ambiguity. The `__get__` method mixes descriptor access and config retrieval logic, slightly affecting reading flow. Overall it is concise and maintainable, but naming improvements would push it closer to 20.

Run 1

Code Structure: The descriptor is logically organized into initialization, getter overloads, getter implementation, and setter, though several imports appear unused and T, te, and App are not defined in the snippet. Nesting: Shallow conditional blocks keep the code easy to follow. Clarity of intent: The class name and docstring explain configuration forwarding, but inconsistent parameter names such as node, sharedSession, key, map, group, and value obscure their roles; map also shadows a built-in. Code length: Compact and mostly purposeful, with some annotation overhead. Action granularity: Statements generally perform one action per line. Reading flow: The getter follows a natural progression from instance checking to lookup, optional conversion, and return, but inconsistent naming across overloads and implementation interrupts comprehension.

Run 2

Code Structure: The descriptor is logically organized into initialization, getter overloads, getter implementation, and setter. Nesting: Shallow conditionals and an early return keep control flow simple. Clarity of intent: The docstring and config access reveal the purpose, but inconsistent names such as node, sharedSession, key, map, group, and state obscure parameter roles; map also shadows a built-in. T, te, and App are not defined in the snippet, making type annotations harder to interpret. Code length: The implementation is concise, although several imports are unused and add clutter. Action granularity: Each statement performs a single clear action; compact overload declarations remain understandable. Reading flow: Method order and spacing support natural reading, but mismatched parameter names across overloads and implementation interrupt comprehension.

Run 3

Code Structure: The descriptor is logically organized into initialization, overloaded access, and assignment, but unused imports and undefined names (T, te, App) weaken its self-contained readability. Nesting: Shallow conditionals and an early return make control flow easy to follow. Clarity of intent: The docstring and descriptor methods communicate configuration forwarding, but names such as sharedSession, key, map, group, and state obscure converter, instance, owner, and value roles. Code length: Compact overall, although unused imports add clutter. Action granularity: Each statement performs one clear action, with no compressed multi-action lines. Reading flow: The method order is natural, but inconsistent parameter names across overloads, shadowing the built-in map, and unexplained type dependencies interrupt comprehension.