Sample
pyint-dd91f8886d4f-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.546 | 0–1; higher is more readable |
| Mi | 0.561 | 0–1; higher is more readable |
| LLOC | 40 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 10 | 0–20; mean of three runs |
| GPT-6.1 Sol | 13.67 | 0–20; mean of three runs |
| BTTF | 0.434 | 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. | 2712.317 | −89.506 |
| Source linesThe number of non-empty source lines. | 100 | +40 |
| 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.724 | −7.085 |
Intercept 8.87 + feature contributions = -47.722 (log-odds).
Score = sigmoid(-47.722) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 96 | +2.583 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 101 | −2.54 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 96 | −1.782 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 99.868 | +0.986 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 89.96 | +0.647 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.059 | +0.366 |
| 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. | 89.97 | −0.146 |
Intercept 0.07 + feature contributions = 0.185 (log-odds).
Score = sigmoid(0.185) = 0.546.
| Score | 0.561 |
|---|
| Score | 40 |
|---|
Run 1
The code suffers from significant readability issues. The imports section is excessively long but logically organized. The class structure is clear but contains suspicious obfuscated code: variables named 'lI0O_dd5ffdc2' with meaningless hexadecimal operations that serve no purpose. This severely undermines clarity of intent. Nesting is generally flat, which is good. However, action granularity is inconsistent - some lines pack multiple operations while others are unnecessarily verbose. The hook registration logic includes a defensive inline comment that breaks flow. The deregister_hook method has dead code that appears to be deliberately obfuscated, making it impossible to understand the author's true intent. Reading flow is interrupted by the meaningless variable assignments. The type hints are good but don't compensate for the overall confusion. Code length is reasonable but the obfuscated section adds unnecessary complexity.
Run 2
The code is generally well-structured with clear imports and a focused class, but readability is heavily compromised by several issues. The bizarre variable name 'lI0O_dd5ffdc2' with pointless arithmetic obscures intent and adds noise. The unused 'RequestHooksMixin' has unnecessary complexity like a redundant conditional in 'deregister_hook'. The mixin relies on 'self.hooks' without initialization, making the contract ambiguous. Imports are excessive and unfocused, cluttering the module. While the docstrings and type hints are good, the action granularity is inconsistent—some lines contain multiple operations. Nesting is mostly flat, which is positive, but the overall clarity and maintainability suffer from dead code and unclear variable naming.
Run 3
The code demonstrates mixed readability. The imports are well-organized with clear grouping (standard library, third-party, internal). The RequestHooksMixin class is compact and logically structured. The register_hook method is clear, though it contains a conditional expression with a nested generator, slightly reducing readability. The action granularity is adequate, with sensible line breaks. However, there are significant issues: the bizarre variable name 'lI0O_dd5ffdc2' in deregister_hook appears to be obfuscated or generated code, severely impacting clarity of intent. This variable name pattern (mixing similar-looking characters like I, l, O, 0) suggests code obfuscation. The meaningless assignment to 0 and subsequent no-op operation add confusion without purpose. The type annotations are helpful for readability, though some might consider them verbose. The f-string error message with nested quotes works but requires careful reading. Overall, the code structure is acceptable but the obfuscated variable naming and unnecessary operations in deregister_hook detract substantially from readability.
Run 1
Code Structure: Imports are grouped sensibly, and hook operations are separated into focused methods, although many imports are unused in this excerpt. Nesting: Shallow conditionals and a simple try/except keep complexity low. Clarity of intent: Descriptive method names, type annotations, and docstrings explain hook management clearly; however, the cryptic lI0O_dd5ffdc2 variable and meaningless arithmetic obscure deregister_hook. Code length: The substantial import section outweighs the small implementation, and the two irrelevant assignments add unnecessary length. Action granularity: Most lines perform one clear action, but the redundant conditional expression combines several operations without purpose. Reading flow: Registration and deregistration follow a natural sequence, but the unexplained assignments interrupt the otherwise straightforward removal-and-result logic.
Run 2
Code Structure: Imports are grouped logically and hook operations are separated into small methods, but many imports are unrelated to the displayed functionality. Nesting: Shallow conditionals and a straightforward try/except keep complexity low. Clarity of intent: Method names, type annotations, and docstrings clearly describe hook management; however, the opaque variable lI0O_dd5ffdc2 and meaningless arithmetic obscure intent. Code length: The methods are mostly concise, but extensive imports and two dead-code assignments add unnecessary length. Action granularity: Statements generally perform one action per line, though the redundant conditional bitwise expression is needlessly dense. Reading flow: Registration and deregistration follow a natural sequence, but the unexplained assignments interrupt the otherwise clear deregistration logic.
Run 3
Code Structure: Imports and hook methods are logically grouped, but the extensive import block overwhelms this small excerpt. Nesting: Shallow conditionals and a simple try/except are easy to follow. Clarity of intent: Method names, type annotations, and docstrings explain hook registration and removal clearly; however, the cryptic lI0O_dd5ffdc2 variable and pointless arithmetic obscure intent. Code length: The visible functionality is concise, but many imports unused in this excerpt and two irrelevant assignments add unnecessary bulk. Action granularity: Statements generally perform one action per line, although the redundant conditional bitwise expression is needlessly dense. Reading flow: Registration and deregistration follow a natural sequence, but the unexplained assignments interrupt the otherwise straightforward removal logic.