Sample
pyint-2feb8ac53492-I02
Shorten method, parameter, and local names without collisions
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.191 | 0–1; higher is more readable |
| Mi | 0.536 | 0–1; higher is more readable |
| LLOC | 117 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 7.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 12 | 0–20; mean of three runs |
| BTTF | 0.301 | 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. | 7682.762 | −253.531 |
| Source linesThe number of non-empty source lines. | 228 | +91.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.414 | −6.621 |
Intercept 8.87 + feature contributions = -160.082 (log-odds).
Score = sigmoid(-160.082) = 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. | 229 | −7.072 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 181 | +5.523 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 181 | −3.733 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 227.932 | +2.776 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 85.86 | +0.581 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.053 | +0.428 |
| 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.961 | −0.018 |
Intercept 0.07 + feature contributions = -1.444 (log-odds).
Score = sigmoid(-1.444) = 0.191.
| Score | 0.536 |
|---|
| Score | 117 |
|---|
Run 1
The code suffers from severe readability issues. Most identifiers are obfuscated (e.g., 'nam', 'ext', 'num2', 'field2', 'fie') making the intent ambiguous. The 'make' method has a control flow issue: if random_read is true and GDALException occurs, it falls through to the IndexError without looping, which is confusing. The 'set' method references undefined functions (_get_spatial_filter, _set_spatial_filter) and 'get2' is a method instead of a property despite its naming. There is a logical segmentation of properties and methods, but the disorganized naming undermines structure. Deep nesting is moderate but comments don't compensate for unclear names. The code has multiple actions per line in list comprehensions and property getters, reducing granularity. Overall, the code is hard to follow and would require significant effort to understand without extensive documentation.
Run 2
The code is moderately readable, with clear structural organization and mostly consistent naming patterns, but suffers from several significant readability issues. The main problems are: (1) cryptic abbreviated names (e.g., 'nam', 'num', 'ext', 'fie', 'get2', 'test') that obscure intent; (2) inconsistent suffix numbering on methods/properties (num/num2, geom2, get2/get3/get4, field/field2/field3) suggesting incomplete refactoring; (3) missing method definitions referenced at the bottom (_get_spatial_filter, _set_spatial_filter); and (4) redundant loop variable names (i2, i3, i4). The code structure is logical, with clear separation between methods and properties, and nesting is mostly flat. Action granularity is generally good—one action per line—and reading flow is natural within each method, but abbreviations force the reader to mentally map short names to their purpose. The docstrings are helpful and explicit, which partially compensates for naming issues. Overall, the code is understandable but would benefit from a cleanup pass to improve naming consistency and clarity.
Run 3
This code is severely obfuscated and nearly unreadable. The naming conventions are extremely poor: properties like 'nam', 'ext', 'num2', 'geom2', 'fie', 'field2', 'field3', 'get2', 'get3', 'get4' are meaningless and actively obscure the code's intent. Variables like 'ds2', 'feat2', 'i2', 'i3', 'i4', 'for2', 'env2', 'cap', 'fil' follow a cryptic pattern that destroys semantic meaning. The original Django GDAL Layer class had clear names (name, extent, num_fields, geom_type, fields, field_widths, field_precisions, get_geoms, get_fields, test_capability), but these have been systematically replaced with nonsense. While the code structure retains logical organization with property decorators and method separation, the readability is destroyed by the naming. The code appears to be deliberately obfuscated, making it nearly impossible to understand without extensive effort. The docstrings sometimes help, but they contradict the terrible naming. Even the action granularity and flow are undermined because readers cannot follow what operations are being performed on what data.
Run 1
Code Structure: Logically organized into initialization, iteration, properties, and methods, but spatial_filter references undefined accessor names rather than get2 and set, creating a confusing inconsistency. Nesting: Mostly shallow, with manageable conditionals and loops. Clarity of intent: Docstrings and comments explain behavior, but abbreviated and numbered names such as nam, num2, field3, and get4 obscure purpose; str also shadows a built-in. Code length: Methods are generally concise, although repeated field-access expressions and some redundant comments add verbosity. Action granularity: Usually one action per statement, with comprehensions appropriately grouping related operations; nested API calls require extra parsing. Reading flow: Section headings and consistent formatting support navigation, but inconsistent pointer usage, ambiguous naming, and mismatched accessor references interrupt understanding.
Run 2
Code Structure: Logically organized into initialization, iteration, properties, and methods, with clear section markers. Nesting: Mostly shallow; feature lookup and spatial-filter handling add only moderate nesting. Clarity of intent: Docstrings explain behavior, but abbreviated and numbered names such as nam, num2, field3, and get4 obscure meaning. The spatial_filter declaration references undefined accessor names rather than get2 and set, making the intended connections confusing. Code length: Methods are generally concise, although repeated field-definition expressions and some verbose comments add bulk. Action granularity: Most lines perform one action; nested API calls and comprehensions occasionally combine several operations. Reading flow: Consistent formatting and grouping help navigation, but opaque naming, shadowing str, and inconsistent ptr/_ptr usage require extra mental effort.
Run 3
Code Structure: Logically organized into initialization, iteration, properties, filtering, and methods, with useful section markers. Nesting: Generally shallow; feature lookup and filter validation introduce only moderate nesting. Clarity of intent: Docstrings explain most operations, but cryptic names such as num2, field3, get4, and ds2 obscure meaning. The spatial_filter property references undefined accessor names rather than get2 and set, creating a confusing disconnect. Code length: Most methods are concise, although repetitive property implementations and some verbose comments add overhead. Action granularity: Statements generally perform one action per line; nested API calls and comprehensions occasionally combine several operations. Reading flow: Consistent formatting and method grouping help, but ambiguous naming, str shadowing a built-in, and inconsistent ptr/_ptr usage interrupt comprehension and require readers to consult documentation repeatedly.