Sample
pyint-ebc9a7c1a5fd-I05
Rewrite eligible decimal integer literals in hexadecimal notation
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0.002 | 0–1; higher is more readable |
| Dorn | 0.459 | 0–1; higher is more readable |
| Mi | 0.464 | 0–1; higher is more readable |
| LLOC | 35 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 17 | 0–20; mean of three runs |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs |
| BTTF | 0.653 | 0–1; higher is more readable |
Views
Loading feature diagnosis…
Source regions
Feature contributions
Feature contributions
| Feature | Value | Contribution (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. | 1777.581 | −58.66 |
| Source linesThe number of non-empty source lines. | 126 | +50.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.517 | −6.775 |
Intercept 8.87 + feature contributions = -6.165 (log-odds).
Score = sigmoid(-6.165) = 0.002.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 127 | −3.46 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 125.856 | +1.349 |
| 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. | 110 | −0.994 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 109.976 | +0.97 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 46 | +0.854 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.03 | +0.649 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
Intercept 0.07 + feature contributions = -0.164 (log-odds).
Score = sigmoid(-0.164) = 0.459.
| Score | 0.464 |
|---|
| Score | 35 |
|---|
Run 1
The code is highly readable due to its clear class-based structure, comprehensive docstrings, and logical organization. The View class is well-documented with examples and version notes, making intent explicit. Function definitions are straightforward, and type hints improve clarity. Nesting is minimal—only one level in the as_view method's conditional blocks. The code is moderately concise, with some verbose type ignores and long lines that slightly reduce readability. Action granularity is generally good, though a few lines combine multiple operations (e.g., function calls with type ignores). Overall reading flow is natural, progressing logically from class attributes to methods. Minor deductions for occasional line length and type-ignore clutter.
Run 2
The code is well-structured with clear class and method organization, type hints, and descriptive docstrings. The nesting is shallow, primarily using one conditional branch in as_view. Intent is clear, especially with explanatory comments. Length is reasonable given the need for detailed documentation. Action granularity is mostly one action per line, though a few lines combine multiple operations (e.g., self assignment inside view function, type ignores). Reading flow is logical: class docstring, class-level attributes, dispatch_request, then as_view. Minor readability issues include inline type ignores, a nested function with internal comment clutter, and the repeated view metadata setup at the end. Overall highly readable.
Run 3
The code is generally clear and well-organized. The View class has a logical structure with class-level attributes documented and methods separated by purpose. Docstrings are thorough and provide helpful context. Nesting is shallow, with only one level inside the as_view method. The action granularity is mostly appropriate—each line performs a single operation, though a few lines (e.g., calling ensure_sync and dispatch_request together) combine multiple actions. Reading flow is natural due to consistent formatting and documentation. The main deductions come from slightly dense type annotations and long lines in the as_view method that could be split for clarity, along with some repetitive logic between the two branches of the init_every_request conditional. Overall, the code is readable but could be marginally improved by extracting the branching logic into a helper method or simplifying the view function creation.
Run 1
Code Structure: Logically organized into configuration attributes, an override hook, and a view factory. Nesting: Moderate and purposeful; conditional nested functions and a decorator loop remain easy to follow. Clarity of intent: Descriptive names, type annotations, and detailed documentation clearly explain behavior, including instance reuse and attached metadata. Dynamic function attributes and repeated type-ignore comments add some complexity. Code length: Implementation is concise, though extensive documentation and duplicated dispatch calls increase reading length. Action granularity: Each statement generally performs one action; chained ensure_sync invocation is compact but slightly denser. Reading flow: Natural progression from configuration to construction, decoration, and metadata assignment, with minor friction from defining view separately in each branch.
Run 2
Code Structure: Imports, configuration attributes, and methods are logically organized with clear responsibilities. Nesting: Limited to straightforward conditionals, nested view functions, and a decorator loop; depth remains manageable. Clarity of intent: Descriptive names, type annotations, and thorough documentation explain instance lifecycle, dispatch, and decorator behavior. Dynamic function attributes and closure-based instantiation require some extra attention. Code length: Executable code is concise, although extensive documentation and duplicated dispatch wrappers make the snippet longer to scan. Action granularity: Statements generally perform one action per line, with no compressed multi-statement lines. Reading flow: Progresses naturally from configuration to dispatch and view generation; inline type-ignore annotations and repeated metadata assignments slightly interrupt the flow.
Run 3
Code Structure: Imports, class configuration, dispatch contract, and view factory are logically organized. Nesting: Mostly shallow; conditional nested functions and the decorator loop add modest complexity. Clarity of intent: Descriptive names, type annotations, and thorough documentation clearly explain lifecycle choices and metadata handling, although dynamic function attributes and type-ignore comments require extra interpretation. Code length: Executable code is concise, but extensive documentation and duplicated dispatch wrappers increase scanning effort. Action granularity: Statements generally perform one action per line; chained synchronization and dispatch calls are slightly denser. Reading flow: Progression from configuration to implementation is natural, with clear branches and explanatory comments. Minor distractions include long lines, repeated metadata assignments, and defining the same closure name in separate branches.