Sample
pyint-6fd93630fd6c-I05
Rewrite eligible decimal integer literals in hexadecimal notation
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.49 | 0–1; higher is more readable |
| Mi | 0.403 | 0–1; higher is more readable |
| LLOC | 49 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 17 | 0–20; mean of three runs |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs |
| BTTF | 0.428 | 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. | 2677.348 | −88.352 |
| Source linesThe number of non-empty source lines. | 115 | +46 |
| 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.509 | −6.764 |
Intercept 8.87 + feature contributions = -40.246 (log-odds).
Score = sigmoid(-40.246) = 0.
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. | 116 | −3.071 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 74 | +1.822 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 74 | −1.277 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 114.909 | +1.196 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.031 | +0.639 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 86.871 | +0.597 |
| 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. | 86.974 | −0.019 |
Intercept 0.07 + feature contributions = -0.041 (log-odds).
Score = sigmoid(-0.041) = 0.49.
| Score | 0.403 |
|---|
| Score | 49 |
|---|
Run 1
The code is well-structured with clear class and method organization. Nesting is shallow, mostly two levels deep with early returns where appropriate. Intent is clearly documented via docstrings and comments, making the purpose of each method and conditional block evident. Code length is reasonable; methods are concise and focused. Each action is generally on its own line, enhancing readability. Reading flow is natural, with logical ordering and clear separation of concerns. Minor issues: the use of '0x194' instead of the more intuitive '404' slightly reduces clarity, and the conditional in process_response could be slightly more explicit, but these are trivial. Overall, this is highly readable production-quality code.
Run 2
The code is well-structured with clear separation of concerns into focused methods. Each method has a single responsibility, making the logic easy to follow. Nesting is minimal, with only one or two levels of indentation in the most complex sections. Intent is clearly documented through descriptive method names and docstrings that explain the purpose and behavior. Code length is appropriate for the functionality provided, with no significant redundancy. Action granularity is generally good, with one primary action per line, though a few lines combine multiple operations (e.g., the return statement building the redirect URL). Reading flow is natural, moving from request processing to response processing, and comments provide helpful context without being excessive. Minor deductions for slight complexity in the conditional logic and the use of a hexadecimal status code (0x194) which reduces immediate readability, but overall the code is very maintainable and understandable.
Run 3
The code is generally readable with clear class and method structure. It uses descriptive names, docstrings, and logical organization. Nesting is moderate—some conditional blocks contain nested logic, but it remains manageable. Clarity of intent is mostly strong, though using the hexadecimal status code 0x194 instead of 404 slightly hurts readability without a comment. Action granularity is good; most lines perform one clear action. Reading flow is natural, with comments and docstrings guiding the reader. Minor issues include a slightly long import block and some dense conditional expressions that could be broken up for clarity. Overall, the code is maintainable and understandable.
Run 1
Code Structure: Well-organized middleware class with focused methods separating request checks, redirect decisions, path construction, and response handling. Nesting: Generally manageable, although user-agent checks and slash validation reach three nested levels and could be flatter. Clarity of intent: Descriptive method names, docstrings, and explanatory comments make behavior clear; however, hexadecimal 0x194 obscures the familiar HTTP 404 status, and unused imports introduce distractions. Code length: Mostly appropriate for the functionality, though some comments repeat the code and documentation is somewhat verbose. Action granularity: Statements generally perform one action each, with complex expressions formatted clearly across lines. Reading flow: Methods follow a natural request-to-response progression, and helper extraction supports understanding without excessive jumping. Overall, readability is strong, with minor deductions for nesting, redundant documentation, unused imports, and the opaque status-code representation.
Run 2
Code Structure: Responsibilities are logically divided into request handling, response handling, and focused URL helpers. Nesting: Mostly moderate, but user-agent checks and slash validation reach three nested levels and could be flattened with guard clauses. Clarity of intent: Descriptive names, docstrings, and explanatory comments make behavior clear; however, hexadecimal 0x194 obscures the familiar HTTP 404 status. Code length: Reasonably concise for its functionality, though some comments repeat nearby code and several imports are unused. Action granularity: Statements generally perform one action per line, with readable multiline expressions. Reading flow: Methods follow a natural request-to-helper-to-response progression, and consistent formatting supports scanning. Minor distractions include mixed string-formatting styles and verbose error-message construction.
Run 3
Code Structure: Well-organized middleware methods separate request checks, redirect decisions, path construction, and response handling. Nesting: Generally manageable, though user-agent checking and slash validation reach three conditional/loop levels and could be flattened. Clarity of intent: Descriptive names, docstrings, and explanatory comments make behavior clear; however, hexadecimal 0x194 obscures the familiar HTTP 404 status, and unused imports add noise. Code length: Mostly proportionate to its responsibilities, although some comments repeat the code and the exception message is lengthy. Action granularity: Statements generally perform one action per line, with sensible wrapping for longer expressions. Reading flow: Methods follow a natural request-to-response progression, with helpers keeping major operations readable. Minor inconsistencies in string formatting and excessive documentation slightly reduce polish.