Sample
pyint-54e6088948c0-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.655 | 0–1; higher is more readable |
| Mi | 0.439 | 0–1; higher is more readable |
| LLOC | 26 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 12.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs |
| BTTF | 0.48 | 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. | 1275.511 | −42.092 |
| Source linesThe number of non-empty source lines. | 34 | +13.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.676 | −7.015 |
Intercept 8.87 + feature contributions = -26.637 (log-odds).
Score = sigmoid(-26.637) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| 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. | 69.943 | +0.703 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 27 | +0.197 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 33.563 | +0.059 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 28 | +0.045 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.1 | −0.025 |
Intercept 0.07 + feature contributions = 0.642 (log-odds).
Score = sigmoid(0.642) = 0.655.
| Score | 0.439 |
|---|
| Score | 26 |
|---|
Run 1
The code has a clear class structure and follows a consistent method pattern, but contains several readability issues. The most significant problem is in the `set` method, where irrelevant score calculations (`total_score`, `number_of_scores`, `average_score`) are included without connection to the method's purpose. Nesting is minimal and flat, which is positive, and action granularity is generally good. However, clarity of intent is compromised by the confusing variables in `set` and the dummy return values that lack explanatory comments. Reading flow is somewhat disrupted by the irrelevant calculations. The unused `host` parameter in `__init__` also raises ambiguity. Overall, while the code is structurally organized, the confusing elements significantly impact its readability.
Run 2
The code structure is organized with consistent method signatures, flat nesting, and clear class inheritance, which initially aids readability. However, critical issues undermine clarity and intent: several methods redefine local variables (total_score, number_of_scores, average_score) that are never used or returned, creating ambiguity about their purpose. The set method performs key validation but returns nothing, which is inconsistent with typical cache behavior. Reading flow is degraded by this dead code and the fact that methods do not perform their advertised actions beyond key validation. While each method is short and one action per line is mostly respected, the overall clarity suffers due to misleading variable names and incomplete implementations.
Run 3
The code is highly readable due to its clean structure, flat nesting, and clear method naming that matches Django's cache API. Each method is concise, typically containing one or two actions: validating the key and returning a value. The reading flow is logical and predictable, with methods organized in a standard order (add, get, set, touch, delete, has_key, clear). The only minor issue is the presence of irrelevant lines in the `set` method (total_score, number_of_scores, average_score), which appear to be leftover debug or example code and slightly obscure intent. Otherwise, action granularity is excellent, and the code length is appropriately minimal for a dummy cache implementation.
Run 1
Code Structure: Methods are logically organized within a small cache class, though unrelated score calculations disrupt set(). Nesting: Flat method bodies make the code easy to scan. Clarity of intent: DummyCache and conventional cache method names communicate purpose, but the unused average_score calculation is confusing, and no explanation clarifies the no-op behavior. Code length: Mostly concise, with three unnecessary lines in set(). Action granularity: Each line performs a single action. Reading flow: Consistent signatures and repeated key validation create a predictable flow, interrupted only by the unrelated arithmetic.
Run 2
Code Structure: Methods are logically organized within a single cache class, with consistent signatures and formatting. Nesting: Flat method bodies make the code easy to scan. Clarity of intent: The DummyCache name and predictable return values communicate a no-op cache, but unrelated score calculations in set() obscure its purpose. Code length: Mostly concise, though the unused scoring variables add unnecessary lines. Action granularity: Each statement performs one action per line. Reading flow: Consistent key validation followed by simple returns creates a natural flow, interrupted only by the irrelevant calculations in set().
Run 3
Code Structure: The class is logically organized into short, recognizable cache operations. Nesting: Methods are flat, with no nested control flow. Clarity of intent: DummyCache and standard method names convey a no-op cache implementation, but the unused score calculation in set is unrelated and confusing. Code length: Most methods are concise; the three arithmetic lines unnecessarily lengthen set. Action granularity: Each line performs one action, making individual steps easy to follow. Reading flow: Consistent signatures and repeated key validation create a predictable flow, interrupted only by the irrelevant arithmetic. Unused parameters are mostly understandable as interface requirements.