Sample
pyint-6d38461c0fd0-I09
Select one of ten low-readability unrelated code templates per class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.225 | 0–1; higher is more readable |
| Mi | 0.464 | 0–1; higher is more readable |
| LLOC | 37 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 13.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs |
| BTTF | 0.412 | 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. | 1999.105 | −65.97 |
| Source linesThe number of non-empty source lines. | 128 | +51.2 |
| 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.563 | −6.845 |
Intercept 8.87 + feature contributions = -12.745 (log-odds).
Score = sigmoid(-12.745) = 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. | 129 | −3.531 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 127.874 | +1.378 |
| 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. | 109.984 | −0.993 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 109.992 | +0.97 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 48 | +0.923 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 48 | −0.681 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.032 | +0.63 |
Intercept 0.07 + feature contributions = -1.234 (log-odds).
Score = sigmoid(-1.234) = 0.225.
| Score | 0.464 |
|---|
| Score | 37 |
|---|
Run 1
The code has good documentation and clear class structure, but contains a concerning obfuscated section (lI0O_c98fde3d variables) that serves no purpose and reduces readability. The as_view method has moderate complexity with nested function definitions and conditional branches. While the docstrings are excellent and explain intent well, the code structure is somewhat tangled with the duplicate view function definitions. The type annotations are helpful, but the long lines and multiple operations per line in the return statements make it harder to follow. The obfuscated code appears to be suspicious or accidental, which is a significant red flag for code quality. Overall, the code is readable but has notable issues that prevent it from being highly readable.
Run 2
The code shows mixed readability. The class structure and docstrings are excellent - clear intent, well-organized, and informative. However, there are significant issues. The 'dispatch_request' method contains obfuscated dead code with meaningless variable names (lI0O_c98fde3d) that serves no purpose and severely harms clarity. The 'as_view' method has moderate nesting with conditional branches creating different view functions, making flow harder to follow. Some lines are excessively long (100+ characters), combining multiple actions like type ignores with function calls. The decorator application loop is flat and readable, but the branching logic could be extracted for clarity. Magic comments like 'pyright: ignore' and 'type: ignore' add noise. The class-level type annotations are clear, but the conditional function definition pattern reduces action granularity and reading flow. Overall, the code is maintainable but has notable readability defects that prevent a higher score.
Run 3
The code is generally well-structured with clear class-level documentation and readable type hints. The View class and as_view method follow a logical organization, with section comments explaining the view function attachment logic. Nesting is mostly flat except for the as_view conditional branches, which remain at two levels. Most lines perform one action, though a few lines are long and combine multiple operations like the `return current_app.ensure_sync(...)` calls. The main readability issue is the suspicious `lI0O_c98fde3d` obfuscated code in `dispatch_request`, which appears to be dead code and harms clarity of intent. Otherwise, naming, flow, and comments support good comprehension. Minor deductions for long combined expressions and the obfuscated block.
Run 1
Code Structure: The class is logically organized into configuration attributes, an abstract dispatch method, and a view factory. Nesting: Mostly shallow; conditional branches containing nested functions are manageable, although the nested ternary is difficult to parse. Clarity of intent: Descriptive names, type annotations, and extensive documentation explain the framework behavior, but the cryptically named variable and pointless bitwise calculations obscure dispatch_request. Code length: Functional code is reasonably concise, though documentation is lengthy and the injected calculations are unnecessary. Action granularity: Most lines perform one clear action; the compound conditional expression is a notable exception. Reading flow: Configuration, dispatch, construction, decoration, and metadata assignment follow a natural progression. Closure behavior and repeated type-ignore comments add some cognitive overhead.
Run 2
Code Structure: The class is logically organized into configuration attributes, dispatch behavior, and view creation. Nesting: Mostly shallow, with understandable nested functions and a decorator loop; the nested conditional expression in dispatch_request is unnecessarily complex. Clarity of intent: Descriptive names, type hints, and thorough documentation clarify most behavior, but the cryptic variable and pointless bitwise assignments obscure the otherwise simple abstract-method implementation. Code length: Executable code is reasonably concise, although extensive documentation and duplicated dispatch calls add reading overhead. Action granularity: Most lines perform one action; the obfuscated assignment packs multiple operations and conditions into one long line. Reading flow: Configuration followed by methods and metadata setup provides a natural progression, interrupted by dead code, inline type-checker suppressions, and dynamic function attributes.
Run 3
Code Structure: Logically organized into class configuration, request dispatch, and view creation. Nesting: Generally shallow, though conditional nested function definitions and a nested ternary add complexity. Clarity of intent: Descriptive names, type hints, and thorough documentation explain most behavior; the obfuscated variable and pointless bitwise calculations in dispatch_request obscure an otherwise simple abstract-method placeholder. Code length: Implementation is reasonably concise, but extensive documentation, duplicated dispatch calls, and unnecessary calculations increase reading effort. Action granularity: Most lines perform one clear action; the long nested conditional assignment is a notable exception. Reading flow: Configuration followed by behavior and factory logic is natural, with helpful explanatory comments. Dynamic function attributes and frequent type-ignore annotations introduce some friction.