Sample
pyint-bf85c699dd9d-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.186 | 0–1; higher is more readable |
| Mi | 0.518 | 0–1; higher is more readable |
| LLOC | 121 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 16.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs |
| BTTF | 0.3 | 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. | 7743.962 | −255.551 |
| Source linesThe number of non-empty source lines. | 232 | +92.8 |
| 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.43 | −6.646 |
Intercept 8.87 + feature contributions = -160.526 (log-odds).
Score = sigmoid(-160.526) = 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. | 233 | −7.213 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 185 | +5.662 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 186 | −3.847 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 231.909 | +2.832 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 86.579 | +0.592 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.051 | +0.445 |
| 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.948 | −0.018 |
Intercept 0.07 + feature contributions = -1.477 (log-odds).
Score = sigmoid(-1.477) = 0.186.
| Score | 0.518 |
|---|
| Score | 121 |
|---|
Run 1
The code is highly readable with clear structure, minimal nesting, and consistent patterns. It uses docstrings and comments effectively to explain intent, especially for non-obvious OGR behavior. Properties and methods are logically grouped, and complex operations are broken into focused helper methods. The main issue is the obfuscated dead code in the `srs` property (the `lI0O_4e671814` loop), which hurts clarity and should be removed. Otherwise, naming is descriptive, control flow is flat, and the use of Django/GDAL idioms matches the surrounding codebase.
Run 2
The code is generally well-structured and readable, with clear class organization, descriptive method names, and helpful docstrings. However, there are notable issues: (1) The `srs` property contains obfuscated dead code (`lI0O_4e671814, lI0O_acef4831` variables with a meaningless while loop) that should be removed. (2) Some methods like `_make_feature` have moderate branching and control flow that could be simplified. (3) List comprehensions in field properties are somewhat dense, packing multiple operations per line. (4) A stale import `byref` is present. Nesting is mostly flat and action granularity is acceptable. Overall, the code follows Django's style conventions and is readable, but the obfuscated snippet and some dense expressions prevent a higher score.
Run 3
The code is well-structured with clear separation of concerns, following Django's established patterns. It has excellent docstrings and comments explaining non-obvious behavior. Nesting is minimal and intentional. Most lines perform a single clear action. However, there are notable issues: a strange obfuscated loop in the 'srs' property (lines with lI0O variables) that appears to be dead code and hurts readability significantly. Some methods like _make_feature have slightly complex control flow. The use of property decorators and consistent naming conventions improves clarity. The code is concise given its purpose, wrapping C API calls appropriately. Reading flow is natural, with properties grouped and methods organized logically. Minor issues include mixed line lengths and the 'force' parameter default in num_feat being slightly unclear without context.
Run 1
Code Structure: Well-organized class with distinct initialization, special methods, properties, and helper methods. Nesting: Generally shallow; branching and loops remain manageable. Clarity of intent: Descriptive names, docstrings, and comments explain the GDAL wrapper well, but the meaningless variables and XOR loop in srs substantially obscure that method. Code length: Mostly justified by functionality, with concise properties and comprehensions; the srs loop adds unnecessary code. Action granularity: Usually one action per line, though nested API calls and tuple assignment require extra parsing. Reading flow: Logical grouping and consistent formatting support natural reading, interrupted by the obfuscated srs block, occasional redundant else branches, and inconsistent use of ptr versus _ptr.
Run 2
Code Structure: Well-organized class with clearly separated properties, helpers, and methods. Nesting: Generally shallow; indexing, feature lookup, and spatial-filter validation introduce manageable branching. Clarity of intent: Descriptive method names and useful docstrings explain most behavior, but the meaningless variables, hexadecimal constant, and no-op loop in srs are conspicuously confusing. Code length: Most methods are concise, though repetitive property wrappers and some redundant comments add length; the injected loop is entirely unnecessary. Action granularity: Mostly one action per line, with readable comprehensions and appropriately wrapped calls; the unrelated paired assignment in srs is an exception. Reading flow: Consistent formatting and logical ordering support natural reading, but the obfuscated block interrupts it. Abbreviated C API names and inconsistent ptr/_ptr usage also require additional attention.
Run 3
Code Structure: The class is logically organized into initialization, special methods, properties, and utility methods. Nesting: Most methods are shallow, with modest branching in feature lookup and spatial filtering. Clarity of intent: Descriptive method names, docstrings, and comments explain the wrapper well, but the meaningless hexadecimal/XOR loop and opaque variable names in srs obscure intent. Code length: Most methods are concise; repetitive property implementations are reasonable, though the injected loop and some redundant comments add unnecessary length. Action granularity: Statements generally perform one action per line, but the unrelated multi-variable assignment in srs and nested API calls slightly weaken this. Reading flow: Consistent formatting and method grouping support natural reading, interrupted noticeably by the irrelevant srs loop and slightly inconsistent use of ptr versus _ptr.