Sample
pyint-c9dff64f4f97-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.421 | 0–1; higher is more readable |
| Mi | 0.463 | 0–1; higher is more readable |
| LLOC | 76 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 16.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16.67 | 0–20; mean of three runs |
| BTTF | 0.379 | 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. | 5681.044 | −187.474 |
| Source linesThe number of non-empty source lines. | 146 | +58.4 |
| 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.498 | −6.748 |
Intercept 8.87 + feature contributions = -126.952 (log-odds).
Score = sigmoid(-126.952) = 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. | 147 | −4.168 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 137 | +4.002 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 137 | −2.723 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 145.784 | +1.628 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 86.429 | +0.59 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.066 | +0.3 |
| 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.966 | −0.018 |
Intercept 0.07 + feature contributions = -0.32 (log-odds).
Score = sigmoid(-0.32) = 0.421.
| Score | 0.463 |
|---|
| Score | 76 |
|---|
Run 1
The code is generally well-structured and readable, with clear class and method definitions. The constructor logically organizes initialization with helpful comments, and methods are concise and focused. However, several issues reduce clarity: the `__deepcopy__` method contains obfuscated variable names (`lI0O_f3e0d1a3`) and nonsensical boolean operations, making it hard to understand intent. The `get_context` method imports inside the method (though acceptable for avoiding circular imports), and the `url_params` construction using a generator with tuple unpacking is slightly less intuitive. Deep nesting is minimal, action granularity is good, and reading flow is natural. Overall it is readable but the obfuscated deepcopy and some verbose conditional assignments prevent a higher score.
Run 2
The code is well-structured into logical methods with clear separation of concerns. It follows Django widget patterns consistently, with flat nesting and readable delegation methods. Naming is descriptive (e.g., get_related_url, value_from_datadict), and each method performs a single focused action, aiding clarity. However, the __deepcopy__ method contains an obfuscated variable name (lI0O_f3e0d1a3) with a meaningless boolean check, which is jarring and reduces readability. The url_params construction could be marginally clearer, but overall flow is natural. Length is moderate and justified by feature support. Minor issues prevent a perfect score.
Run 3
The code is generally well-structured, with logical class organization and mostly clear intent. The __init__ method initializes attributes in a straightforward manner, and helper methods like get_context are broken into readable steps. Nesting is minimal, and most lines perform a single action. However, the __deepcopy__ method contains obfuscated variable names (lI0O_f3e0d1a3) and meaningless boolean assignments, which significantly hurts clarity. Additionally, unused imports (json, URLValidator, smart_urlquote, urlencode, Truncator, get_language, UUIDField) suggest clutter. The get_context method is somewhat long but remains readable due to clear variable names and logical grouping. Overall, the code is solid but could improve by removing dead imports and clarifying the deepcopy logic.
Run 1
1. Code Structure: Methods are logically organized around widget initialization, delegation, URL generation, and context construction; several unused imports add clutter. 2. Nesting: Mostly flat, with simple conditionals and no deeply nested blocks. 3. Clarity of intent: Descriptive method names, permission flags, and comments explain the wrapper's purpose, but the cryptically named variable and pointless boolean operations in __deepcopy__ are distracting. 4. Code length: Generally appropriate, though unused imports and dead statements unnecessarily increase length; get_context is moderately long but cohesive. 5. Action granularity: Statements generally perform one action per line, with readable multiline expressions and dictionary construction. 6. Reading flow: Initialization and context-building follow a natural sequence, while framework-specific details and the obfuscated deepcopy statements interrupt otherwise clear flow.
Run 2
Code Structure: Well-organized class with focused methods, clearly grouped initialization, and straightforward widget delegation. Nesting: Shallow conditionals and no deeply nested control flow make execution easy to follow. Clarity of intent: Descriptive method names, permission flags, and explanatory comments communicate the wrapper's purpose, though abbreviated names such as rel and info require context. The meaningless, obfuscated assignments in __deepcopy__ noticeably undermine clarity. Code length: Mostly concise for its responsibilities, but unused imports and dead assignments add unnecessary noise. Action granularity: Statements generally perform one action per line, and multiline expressions and dictionaries are formatted clearly. Reading flow: Progresses naturally from setup to properties, URL/context construction, and delegation; the local import and framework-specific metadata access introduce minor interruptions.
Run 3
Code Structure: Well-organized class with distinct initialization, delegation, URL construction, and context-building methods; several unused imports add clutter. Nesting: Mostly flat, with simple conditionals and no deeply nested control flow. Clarity of intent: Descriptive method names, permission flags, and comments explain the widget wrapper clearly, but the opaque variable and pointless boolean operations in __deepcopy__ obscure intent. Code length: Generally appropriate, although redundant statements and unused imports unnecessarily increase length. Action granularity: Each statement generally performs one action, and multiline expressions are formatted cleanly. Reading flow: Methods follow a coherent progression, with readable context assembly and straightforward delegation; the unexplained obfuscated statements interrupt otherwise natural reading.