Sample
pyint-84663f94d90d-I04
Replace names with deterministic minifier-style shortest identifiers
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.523 | 0–1; higher is more readable |
| Mi | 0.443 | 0–1; higher is more readable |
| LLOC | 49 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 6.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 12 | 0–20; mean of three runs |
| BTTF | 0.174 | 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. | 2691.438 | −88.817 |
| 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.461 | −6.692 |
Intercept 8.87 + feature contributions = -40.639 (log-odds).
Score = sigmoid(-40.639) = 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.912 | +1.196 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.035 | +0.606 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 76.224 | +0.425 |
| 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. | 78.966 | +0.321 |
Intercept 0.07 + feature contributions = 0.093 (log-odds).
Score = sigmoid(0.093) = 0.523.
| Score | 0.443 |
|---|
| Score | 49 |
|---|
Run 1
The code structure is intact but readability is severely undermined by obfuscated naming. Methods and variables are named 'a', 'b', 'c', 'd', 'e', 'f', 'g', etc., completely hiding their intent (e.g., detecting user agents or appending slashes). This violates Clarity of intent. Nesting is shallow and reading flow is functional, but the meaningless names force the reader to reverse-engineer the logic from the code. Action granularity is acceptable, though some lines are dense (regex search, ternary-like if/else). The docstrings are the only thing preventing total unreadability, but they fight against the vague identifiers. Overall, the code appears to be intentionally obfuscated.
Run 2
This code has been deliberately obfuscated, making it nearly unreadable despite its mostly logical structure. The function names (a, b, c, d) and variable names (e, f, g, h, i, j, k, l, m, n, o, p, q) are completely meaningless, destroying clarity of intent. While the code structure and nesting are reasonable—there are no deeply nested blocks, and each line performs one main action—the lack of descriptive naming makes it impossible to understand the purpose without reading every line carefully. The docstrings are the only clue to functionality, but they use different descriptions than the actual code. The reading flow is disrupted because readers must constantly map meaningless names to concepts. Code length is appropriate for the operations performed. This would normally be a well-structured Django middleware class, but the obfuscated identifiers drop the score dramatically. A version with clear names would score 16-18.
Run 3
The original Django middleware pattern is recognizable, but obfuscated variable names (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) make the code extremely difficult to follow. The class-level docstring is well-written, but method-level docstrings are paired with meaningless names, forcing readers to constantly map letters to actual concepts. This severely damages clarity of intent and reading flow. Code structure follows a logical middleware flow, but nesting is moderate due to conditionals. Action granularity is acceptable, with roughly one action per line. Code length is reasonable for the functionality. While the underlying logic is not tangled, the naming choices make it read like minified or obfuscated code rather than maintainable source, hence a low score despite correct structure and moderate length.
Run 1
Code Structure: Responsibilities are logically separated into methods for request checks, slash validation, URL construction, and response handling. Nesting: Mostly moderate, but user-agent checks and slash validation reach three nested levels. Clarity of intent: Detailed docstrings and comments explain behavior, but single-letter method and variable names severely obscure meaning and require constant cross-referencing. Docstrings also reference descriptive method names absent from the implementation. Code length: Generally reasonable, though extensive documentation, unused imports, and an unnecessarily split redirect assignment add clutter. Action granularity: Statements generally perform one action per line, with readable multiline error construction. Reading flow: Methods follow a sensible request-to-response progression, but opaque helper calls interrupt comprehension. Overall, strong organization and documentation partially compensate for poor naming.
Run 2
Code Structure: Responsibilities are logically separated into methods for request checks, slash validation, path construction, and response processing. Nesting: Mostly manageable, but user-agent checks and slash validation reach three nested levels. Clarity of intent: Detailed docstrings and comments explain behavior, but single-letter method and variable names obscure roles and make cross-method calls difficult to follow; documentation also references names absent from the code. Code length: Generally proportionate to functionality, though lengthy documentation, an error message, unused imports, and an unnecessarily split redirect call add reading overhead. Action granularity: Most lines perform one clear action, with sensible separation of validation and transformation steps. Reading flow: The request-to-response sequence is natural, but opaque identifiers force readers to repeatedly consult documentation and trace values.
Run 3
Code Structure: Responsibilities are logically separated into methods within a middleware class. Nesting: Mostly moderate, but user-agent checks and slash validation use several nested branches. Clarity of intent: Docstrings and comments explain behavior well, but single-letter method and variable names obscure roles and make cross-method calls difficult to follow; documentation also references names absent from the code. Code length: Generally reasonable, although lengthy documentation, an unnecessarily multiline redirect call, and unused imports add clutter. Action granularity: Statements generally perform one action per line, with readable formatting for conditions and error construction. Reading flow: The request-check, path-validation, redirect-construction, and response-handling sequence is coherent, but opaque identifiers require repeatedly consulting documentation to understand data flow.