Sample
pyint-e6d396e773ea-I08
Select one of ten high-readability unrelated code templates per class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.901 | 0–1; higher is more readable |
| Mi | 0.335 | 0–1; higher is more readable |
| LLOC | 63 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 17 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs |
| BTTF | 0.36 | 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. | 3460.158 | −114.185 |
| Source linesThe number of non-empty source lines. | 87 | +34.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.373 | −6.559 |
Intercept 8.87 + feature contributions = -77.074 (log-odds).
Score = sigmoid(-77.074) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 85 | +2.203 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 87 | −2.044 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 86.701 | +0.802 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 85.852 | +0.581 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.079 | +0.17 |
| 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. | 85.955 | +0.025 |
Intercept 0.07 + feature contributions = 2.205 (log-odds).
Score = sigmoid(2.205) = 0.901.
| Score | 0.335 |
|---|
| Score | 63 |
|---|
Run 1
The code is well-structured with clear class and method separation, using descriptive names and type hints. Nesting is generally flat, except for a few nested loops and try/except blocks that remain manageable. Clarity of intent is strong, with methods like _get_source_explained and _get_source_fast conveying their purpose. Code length is appropriate, though the unexplained variables 'total_score', 'number_of_scores', and 'average_score' seem like dead code and reduce clarity. Action granularity is mostly one action per line, improving readability. Reading flow is natural, with helper methods logically ordered. Minor issues: the dead variables should be removed, and the 'rv' variable could be named more descriptively. Overall, the code is maintainable and readable, with only small improvements needed.
Run 2
The code is well-structured with clear separation of concerns: public methods dispatch to fast or explained paths, while private helpers handle core logic. Type hints improve clarity. Nesting is generally shallow, though _get_source_explained has some indentation depth. Intent is explicit—template loading with optional debugging. Minor issues: unused variables (average_score, number_of_scores) in _get_source_explained create noise; the _iter_loaders method uses an underscore prefix for srcobj without clear reason. Action granularity is mostly one action per line, and reading flow is natural. Overall, readable and maintainable with only small cleanup opportunities.
Run 3
The code is well-structured with clear separation of concerns, using descriptive method names that convey intent. Nesting is minimal, staying flat with small, single-purpose functions. The explained template loading path is logically isolated from the fast path, which aids readability. However, the unexplained presence of 'total_score', 'number_of_scores', and 'average_score' variables in _get_source_explained introduces ambiguity and likely dead code, hurting clarity. Type hints are used consistently, enhancing understanding. Action granularity is mostly good, though some lines combine iteration and assignment. Overall, the code is highly readable with a minor clarity issue from unused variables.
Run 1
Code Structure: Well-organized class with separate methods for loader iteration, fast lookup, diagnostic lookup, and template listing. Nesting: Mostly shallow, although diagnostic lookup and blueprint template listing introduce moderate nesting. Clarity of intent: Descriptive method names, a class docstring, and type annotations clarify behavior; however, rv and trv are cryptic, and unrelated score calculations distract from template loading. Code length: Generally concise, but unused calculations, unused imports, repeated verbose tuple annotations, and an avoidable inner loop add clutter. Action granularity: Each line generally performs one clear action. Reading flow: Methods follow a natural dispatch-and-helper pattern, with straightforward returns and exception handling; the inline import and irrelevant arithmetic interrupt that flow.
Run 2
Code Structure: Well-organized methods separate loader iteration, fast lookup, diagnostic lookup, and template listing. Nesting: Mostly shallow, although diagnostic lookup and template listing contain several nested levels. Clarity of intent: Descriptive method names, a class docstring, and type annotations communicate purpose; abbreviated variables such as rv, trv, and srcobj weaken clarity. The unrelated, unused score calculations are distracting, and App and Scaffold lack visible definitions or imports. Code length: Generally concise, but unused calculations, imports, repeated complex type annotations, and the template-listing loop add avoidable bulk. Action granularity: Statements consistently perform one action per line. Reading flow: Natural top-to-bottom organization and straightforward exception handling make execution easy to follow, though the local import and irrelevant calculations interrupt the diagnostic method.
Run 3
Code Structure: Well-organized class with separate methods for dispatch, diagnostic loading, fast loading, loader iteration, and template listing. Nesting: Mostly shallow, although template listing reaches three nested levels. Clarity of intent: Descriptive method names and type annotations clarify behavior, but abbreviations such as rv, trv, and srcobj obscure meaning. The unrelated, unused score calculations distract from template loading, and App and Scaffold lack visible definitions or imports. Code length: Generally concise, though repeated complex type annotations and the unnecessary calculations add clutter. Action granularity: Each line generally performs one action, making operations easy to follow. Reading flow: Public dispatch followed by helper implementations creates a logical progression; the mid-method import and unrelated calculations interrupt it.