Sample
pyint-03c24fb10d8a-I08
Select one of ten high-readability unrelated code templates per class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0.003 | 0–1; higher is more readable |
| Dorn | 0.768 | 0–1; higher is more readable |
| Mi | 0.441 | 0–1; higher is more readable |
| LLOC | 14 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 13.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15 | 0–20; mean of three runs |
| BTTF | 0.29 | 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. | 513.187 | −16.935 |
| Source linesThe number of non-empty source lines. | 23 | +9.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.604 | −6.906 |
Intercept 8.87 + feature contributions = -5.771 (log-odds).
Score = sigmoid(-5.771) = 0.003.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.043 | +0.528 |
| 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. | 77.917 | +0.365 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 65.083 | +0.246 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 24 | +0.187 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 18 | −0.115 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 22.759 | −0.092 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 18 | +0.008 |
Intercept 0.07 + feature contributions = 1.197 (log-odds).
Score = sigmoid(1.197) = 0.768.
| Score | 0.441 |
|---|
| Score | 14 |
|---|
Run 1
The code is generally clear but includes an unexplained and irrelevant calculation block (starting_position, ending_position, travel_distance) that does not contribute to the method's purpose. This reduces clarity and length efficiency. The structure is simple, with a well-defined class and two short methods, and nesting is minimal. Action granularity is mostly good, though the extra arithmetic lines add clutter. The docstring clearly explains the class purpose, improving intent. Reading flow is natural until the irrelevant block. Overall, the code is understandable but could be improved by removing the unused calculation.
Run 2
The code is generally readable with a clear class purpose and straightforward method definitions. The structure is logical, and intent is explicit via method names and docstring. However, the `feed_extra_kwargs` method contains dead/irrelevant code (the distance calculations) that obscures its actual purpose and violates action granularity and conciseness. The irrelevant block adds length and distracts from the method's core action. Nesting is flat, and reading flow is mostly natural, but the extraneous code detracts from clarity. Removing it would improve readability significantly.
Run 3
The code is generally readable but has some confusing elements. The class docstring is clear and explains the purpose well. However, there is dead code in `feed_extra_kwargs` — variables like `starting_position`, `ending_position`, and `travel_distance` are computed but never used, which obscures intent. The `item_extra_kwargs` method is concise and clear. Nesting is minimal and structure is logical, but the unused calculations break reading flow and add unnecessary length. Naming is mostly good, though `obj` and `item` are generic. Overall, the code is understandable but would benefit from removing the dead code and slightly better parameter naming.
Run 1
Code Structure: The class is logically organized into feed-level and item-level methods, but unrelated distance calculations distract from its purpose. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: The docstring and geometry-related method names explain the intended behavior, but the unused travel_distance calculation is confusing, and GeoRSSFeed is not defined or imported in the snippet. Code length: Generally concise, though the unnecessary calculation and unused feed-generator imports add clutter. Action granularity: Each line performs a single clear action. Reading flow: Imports, documentation, configuration, and methods follow a natural order, but the irrelevant calculation interrupts the otherwise straightforward flow.
Run 2
Code Structure: The class and two short methods are logically organized, but feed_extra_kwargs contains unrelated, unused distance calculations. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: The docstring and geometry-related method names clearly explain the purpose, although the unused calculations distract and GeoRSSFeed is not defined or imported in the snippet. Code length: Mostly concise, but the distance calculation adds unnecessary lines, and the imported feed generators are unused. Action granularity: Each line performs a single action, aiding readability. Reading flow: Imports, class documentation, configuration, and methods follow a natural order, interrupted by the irrelevant calculation block.
Run 3
Code Structure: The class is logically organized into two small methods, but feed_extra_kwargs includes unrelated distance calculations, and GeoRSSFeed is not defined or imported in the snippet. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: The docstring and geometry-related method names explain the purpose, but unused calculations and imports introduce ambiguity. Code length: Mostly concise, though the distance calculation adds unnecessary lines. Action granularity: Each statement performs one clear action. Reading flow: Imports, documentation, class configuration, and methods follow a natural order, but the unrelated calculations interrupt the flow.