Sample
pyint-7f51f58588e0-I11
Split eligible integer literals into pairs of short-named intermediate variables
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.178 | 0–1; higher is more readable |
| Mi | 0.518 | 0–1; higher is more readable |
| LLOC | 123 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 16.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs |
| BTTF | 0.17 | 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. | 7880.776 | −260.066 |
| Source linesThe number of non-empty source lines. | 234 | +93.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.392 | −6.587 |
Intercept 8.87 + feature contributions = -164.183 (log-odds).
Score = sigmoid(-164.183) = 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. | 235 | −7.284 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 187 | +5.731 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 188 | −3.893 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 233.909 | +2.86 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 85.489 | +0.575 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.053 | +0.432 |
| 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.957 | −0.018 |
Intercept 0.07 + feature contributions = -1.528 (log-odds).
Score = sigmoid(-1.528) = 0.178.
| Score | 0.518 |
|---|
| Score | 123 |
|---|
Run 1
The code is well-structured with clear separation of concerns, following Django's established patterns. The class is logically organized with properties and methods grouped together. Nesting is minimal and manageable, with early returns and clear conditional paths. Intent is generally clear through descriptive method names and docstrings. However, there are some readability issues: odd variable assignments like `a = 1; b = -1; c = 2; d = -1; e = 2; f = 2` that obscure their purpose and could be simplified to direct expressions. The `__getitem__` method's index checking logic is unnecessarily convoluted. Some type checking with `isinstance` is verbose. The extensive use of `force_str` wrapping in list comprehensions adds visual noise. The code maintains good action granularity with one main operation per line. Reading flow is natural from initialization through methods. Overall, this is professional-quality code that would benefit from minor cleanup of artificial variable assignments and simplification of boolean logic.
Run 2
The code is generally well-structured and readable, with clear class organization and consistent use of docstrings explaining intent. Methods are logically grouped (properties, helpers, public API) and follow Django's conventions. Nesting is moderate: the __getitem__ and _set_spatial_filter methods have conditional branching but remain understandable. However, several issues reduce readability: (1) some artificially obfuscated variable assignments like 'a = 1', 'b = -1', 'c = 2', 'd = -1', 'e = 2', 'f = 2' are confusing and appear deliberately unclear instead of using direct values; (2) the _make_feature method has a nested try/except with a fallback loop that could be clarified; (3) list comprehensions in field properties are slightly dense. Overall, the code is competently structured with clear naming and documentation, but these unusual variable assignments and some dense expressions prevent a higher score.
Run 3
The code is well-structured with clear separation of concerns. Class organization is logical, grouping properties and methods appropriately. Nesting is minimal - only a few conditional branches and try/except blocks, never exceeding 2-3 levels deep. Intent is clearly documented with docstrings on nearly every method and property. Code length is appropriate; each method is concise and focused. Action granularity is mostly good - one main action per line, though list comprehensions in field properties pack multiple operations into single lines, slightly reducing readability. Reading flow is natural, following a consistent pattern: init, dunder methods, properties, then public methods. The use of helper methods (_make_feature) and clear variable names enhances clarity. Some minor oddities exist (e.g., artificial expressions like `a + b` and `c + d` that compute to obvious values) but these don't significantly impact readability.
Run 1
Code Structure: Well-organized class with clear separation between initialization, collection operations, properties, and methods. Nesting: Generally shallow, with modest branching in feature lookup and spatial filtering. Clarity of intent: Descriptive method names, docstrings, and comments explain the GDAL wrapper well, but arbitrary variables a–f and arithmetic replacing constants obscure simple checks and arguments. Code length: Most methods are concise; repeated field-definition lookups and some verbose comments add minor overhead, while the artificial arithmetic adds unnecessary lines. Action granularity: Usually one action per line, although nested API calls and comprehensions require additional parsing. Reading flow: Logical ordering and consistent formatting support natural reading; inconsistent ptr/_ptr usage, indirect constants, and occasional awkward documentation interrupt it. Overall, readable and maintainable, with localized clarity issues.
Run 2
Code Structure: Logically organized into initialization, Python protocol methods, properties, and layer operations, with focused methods. Nesting: Generally shallow; feature retrieval and filter validation introduce only modest nesting. Clarity of intent: Descriptive method names, docstrings, and comments explain the wrapper well, but arbitrary variables and arithmetic such as a + b, c + d, and e + f obscure simple constants. Low-level API abbreviations and inconsistent ptr/_ptr usage add cognitive overhead. Code length: Mostly concise implementations, though redundant comments, repeated field-definition lookups, and artificial intermediate variables add unnecessary length. Action granularity: Statements generally perform one action per line; nested API calls and comprehensions occasionally combine several operations. Reading flow: Sections and consistent formatting make navigation natural, but needless arithmetic, redundant else branches after returns, and minor documentation errors interrupt an otherwise clear flow.
Run 3
Code Structure: Logically organized into initialization, collection operations, properties, and methods, with focused responsibilities. Nesting: Generally shallow; feature lookup and spatial-filter handling introduce only moderate branching. Clarity of intent: Descriptive method names and useful docstrings explain the wrapper well, but meaningless variables a–f and arithmetic disguising constants obscure simple checks. Low-level API abbreviations and inconsistent ptr/_ptr usage also require extra attention. Code length: Most methods are concise, though some comments repeat obvious operations and artificial constant calculations add unnecessary lines. Action granularity: Statements generally perform one action each; nested API calls in comprehensions slightly increase cognitive load. Reading flow: Consistent formatting and section markers support natural navigation, interrupted mainly by the contrived arithmetic and occasional redundant else branches.