Sample
pyint-067ab0a9007a-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.023 | 0–1; higher is more readable |
| Mi | 0.802 | 0–1; higher is more readable |
| LLOC | 190 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 15.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs |
| BTTF | 0.579 | 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. | 15978.891 | −527.303 |
| Source linesThe number of non-empty source lines. | 463 | +185.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.205 | −6.308 |
Intercept 8.87 + feature contributions = -339.542 (log-odds).
Score = sigmoid(-339.542) = 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. | 464 | −15.392 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 420 | +13.79 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 420 | −9.217 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 462.934 | +6.061 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 89.94 | +0.647 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.054 | +0.415 |
| 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.957 | −0.145 |
Intercept 0.07 + feature contributions = -3.771 (log-odds).
Score = sigmoid(-3.771) = 0.023.
| Score | 0.802 |
|---|
| Score | 190 |
|---|
Run 1
The code demonstrates strong readability with clear logical organization, well-named methods, and good action granularity. Most methods are small and focused, with descriptive names that clearly convey intent. The imports are organized and the class structure is logical. However, there are some areas that could improve: the `_check_unique_target` method is quite long and complex with multiple nested conditionals and complex logic, making it harder to follow. The `get_extra_descriptor_filter` method contains an unnecessary obfuscated variable that should be removed. Some methods like `deconstruct` have multiple sequential operations that could benefit from helper methods. Overall, this is readable code that follows Django conventions well, but the complexity in certain validation methods prevents a higher score.
Run 2
This Django source code demonstrates strong readability. The class structure is logical with clear method organization, grouping related functionality. Nesting is generally flat, with most methods having minimal indentation levels. Intent is clear through descriptive method names and comprehensive docstrings that explain complex operations. While the code is lengthy, this is appropriate for the complex functionality being implemented. Action granularity is mostly one action per line, though some error construction calls contain multiple operations. Reading flow is natural, following Django's established patterns. The main readability challenges stem from the inherent complexity of Django's ORM internals and some dense error message formatting with string interpolation mixed between % and f-string styles, which creates slight inconsistency. The obfuscated variable `lI0O_9ccd4a86` in `get_extra_descriptor_filter` is jarring and unnecessary, detracting from readability. Overall, this is professional, well-documented code that maintains Django's high standards despite dealing with complex database relationship concepts.
Run 3
The code demonstrates good structure and organization, with clear method separation and logical grouping. However, readability suffers from several issues: deeply nested conditionals in _check_unique_target (multiple layers of if/for/any combinations), some excessively long methods like deconstruct and _check_unique_target, and complex boolean logic that's difficult to parse at a glance. The code includes suspicious obfuscated variables (lI0O_9ccd4a86) that appear to be deliberately unclear. Import statements are extensive but well-organized. Docstrings are helpful but sparse in complex methods. Method names are generally descriptive. The action granularity is reasonable in most places but breaks down in dense conditional blocks. While the code follows Django conventions and shows professional structure, the complexity of validation logic and nesting reduces overall readability. The reading flow is natural for experienced Django developers but challenging for newcomers.
Run 1
Code Structure: Well-organized class with focused methods separating validation, field resolution, serialization, and relationship traversal. Nesting: Generally moderate, with guard clauses flattening control flow; validation and deconstruction contain some deeper branches. Clarity of intent: Descriptive names, docstrings, and explanatory comments make most operations clear, but framework-specific internals require background knowledge. The opaque variable and pointless arithmetic in get_extra_descriptor_filter noticeably undermine clarity. Code length: The class is long but mostly justified by its responsibilities; repeated error construction and irrelevant arithmetic add verbosity. Action granularity: Statements generally perform one action each, and multiline calls are consistently formatted. Reading flow: Related methods are grouped naturally, with predictable formatting and useful helper properties. Dense constraint expressions, extensive metadata access, and dependencies not defined in the snippet slightly interrupt comprehension.
Run 2
Code Structure: Well-organized class with focused methods separating validation, field resolution, serialization, and relationship behavior. Nesting: Mostly shallow, aided by early returns, though validation and deconstruction contain several nested branches. Clarity of intent: Descriptive method names, docstrings, and explanatory comments communicate purpose well; Django-specific internals require background knowledge, and the opaque lI0O_9ccd4a86 variable and pointless bitwise operations obscure an otherwise trivial method. Code length: Generally justified by functionality, but repetitive error construction, extensive imports, and injected no-op statements add bulk. Action granularity: Statements generally perform one action each, with readable multiline calls and comprehensions; the artificial conditional bitwise expression is unnecessarily dense. Reading flow: Related methods are grouped naturally and formatting is consistent, although long uniqueness checks and deep attribute chains interrupt scanning. Missing definitions for RelatedField and RECURSIVE_RELATIONSHIP_CONSTANT reduce the snippet's self-contained clarity.
Run 3
Code Structure: Well-organized class with focused methods, grouped properties, and separate validation routines. Nesting: Generally moderate, though validation and deconstruction contain several nested branches. Clarity of intent: Descriptive names, docstrings, and explanatory comments clarify complex relationship behavior; however, the cryptic variable and pointless arithmetic in get_extra_descriptor_filter obscure an otherwise simple method. Code length: Most length reflects legitimate functionality and helpful diagnostics, but repeated validation patterns and the injected no-op statements add unnecessary bulk. Action granularity: Statements generally perform one action each, with readable multiline calls and comprehensions. Reading flow: Consistent formatting and method organization support natural progression, although dense metadata access, framework-specific concepts, and references not defined in this excerpt require external context. Overall, strong readability with localized obfuscation and some complexity.