Sample
pyint-a105113268e3-I04
Replace names with deterministic minifier-style shortest identifiers
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.572 | 0–1; higher is more readable |
| Mi | 0.48 | 0–1; higher is more readable |
| LLOC | 17 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 11 | 0–20; mean of three runs |
| GPT-6.1 Sol | 12.33 | 0–20; mean of three runs |
| BTTF | 0.695 | 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. | 909.931 | −30.028 |
| Source linesThe number of non-empty source lines. | 24 | +9.6 |
| 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.552 | −6.828 |
Intercept 8.87 + feature contributions = -18.385 (log-odds).
Score = sigmoid(-18.385) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.061 | +0.347 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 25 | +0.151 |
| 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. | 83.92 | +0.111 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 24 | +0.093 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 23.918 | −0.076 |
Intercept 0.07 + feature contributions = 0.29 (log-odds).
Score = sigmoid(0.29) = 0.572.
| Score | 0.48 |
|---|
| Score | 17 |
|---|
Run 1
The code structure is somewhat organized but fails to follow Python naming conventions and Django best practices. The method 'a' with parameters 'b', 'c', and 'd' severely lacks clarity of intent - these names provide no information about their purpose. The method appears to be implementing a permission lookup but the implementation is cryptic. While the nesting is relatively flat and the action granularity is reasonable (one action per line), the overall readability is compromised by poor naming choices. The import structure is clear but could be organized better. The code would benefit from descriptive method and parameter names like 'get_permission' and 'codename', 'app_label', 'model' respectively. The reading flow is disrupted by having to decode what the abbreviated names might represent. The method's purpose isn't immediately clear without analyzing the implementation details.
Run 2
The code has some readability strengths: logical import organization, flat structure, and reasonable line length. However, it suffers significantly from poor naming. The method 'a' and parameters 'b', 'c', 'd' are cryptic, making the intent unclear. The method appears to retrieve a Permission by codename and content type, but the names obscure this. Parameter 'd' likely represents an app label. The nested ContentType lookup adds some nesting but remains manageable. The method body is concise, but the abstraction is poor. The code reads acceptably until the method definition, which breaks the flow. With meaningful names like 'get_by_codename_and_natural_key', this would score much higher. The issue is not complexity but opaque identifiers, violating the 'clarity of intent' criterion. The action granularity is acceptable, though the ContentType lookup could be extracted for clarity. Overall, the code is functional but unfriendly to readers unfamiliar with the surrounding context, highlighting the importance of self-documenting names over comments or brevity.
Run 3
The code imports many unused modules, adding clutter. The class PermissionManager is concise, but the method name 'a' is completely ambiguous and violates clarity of intent. Parameters b, c, and d are also nondescript, making the method's purpose unclear. The structure is flat and the action granularity is acceptable, but the nested get_by_natural_key call inside get() slightly reduces reading flow. Overall, poor naming and unused imports significantly hurt readability.
Run 1
Code Structure: Imports and the manager class are logically organized, but many unused imports distract from the small implementation. Nesting: Control flow is flat; the nested content-type lookup adds only modest complexity. Clarity of intent: Django API names and keyword arguments provide context, but the method name 'a' and parameters 'b', 'c', and 'd' obscure the operation and its inputs. Code length: The method is concise, although the import block is disproportionately long. Action granularity: The return expression combines two database lookups; separating the content-type lookup could clarify their relationship. Reading flow: Conventional indentation and layout help, but generic identifiers and the fragmented 'c, d' argument formatting interrupt comprehension.
Run 2
Code Structure: Imports and the manager class are logically organized, although most imports are unused in this snippet. Nesting: Shallow control structure, with only a nested method call, makes the code easy to scan. Clarity of intent: Django APIs and keyword arguments provide some context, but names such as a, b, c, and d obscure the method's purpose and parameter meanings. Code length: The implementation is concise, though excessive imports and splitting the short inner argument list across lines add clutter. Action granularity: Each statement performs a focused task; the nested lookup is reasonably cohesive. Reading flow: The layout is conventional and consistent, but cryptic identifiers interrupt comprehension and force readers to infer intent from implementation.
Run 3
Code Structure: Imports and the manager class are logically organized, but many imports are unused in this snippet and add clutter. Nesting: Control flow is flat; the nested lookup is shallow and manageable. Clarity of intent: PermissionManager and the ORM keywords suggest a permission lookup, but the method name 'a' and parameters 'b', 'c', and 'd' obscure its purpose and expected inputs. Code length: The implementation is concise, although the import block is disproportionate to the functionality shown. Action granularity: Statements are clearly separated; composing two ORM lookups in one return expression is reasonable but requires some unpacking. Reading flow: Conventional formatting helps, while cryptic names and the split 'c, d' arguments interrupt otherwise straightforward reading.