Sample
pyint-c6c6c61aa443-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.588 | 0–1; higher is more readable |
| Mi | 0.615 | 0–1; higher is more readable |
| LLOC | 48 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 15.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs |
| BTTF | 0.549 | 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. | 3049.884 | −100.646 |
| 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.654 | −6.981 |
Intercept 8.87 + feature contributions = -63.957 (log-odds).
Score = sigmoid(-63.957) = 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. | 88 | −2.079 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 80 | +2.03 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 80 | −1.415 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 86.918 | +0.805 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 83.955 | +0.55 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.067 | +0.287 |
| 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. | 83.932 | +0.11 |
Intercept 0.07 + feature contributions = 0.358 (log-odds).
Score = sigmoid(0.358) = 0.588.
| Score | 0.615 |
|---|
| Score | 48 |
|---|
Run 1
The code is generally well-structured with clear organization: imports are grouped, model fields are logically ordered, and methods are separated with clear purposes. Nesting is minimal, and readability benefits from Django's declarative field definitions. However, there is a significant clarity issue in the `get_short_name` method, which includes an unexplained even-number counting loop that seems unrelated to its purpose. This reduces clarity and indicates dead or confusing code. Most actions are one per line, and the reading flow is natural for a Django model. Overall, it is readable but would score higher if the irrelevant loop were removed and the method's intent were clearer.
Run 2
The code is well-structured and highly readable. It follows Django conventions, uses clear field definitions, and maintains a logical organization. The class has a single responsibility, and methods are concise with clear intent. There is minimal nesting, and actions are generally one per line. The only notable issue is the get_short_name method, which contains an unused loop that appears to be a placeholder or accidental code, slightly hurting clarity. Overall, the code is professional and maintainable.
Run 3
The code is generally well-structured with clear Django model fields, descriptive names, and helpful comments/docstrings. Imports are organized and field definitions are readable. However, a few issues hurt readability: the `get_short_name` method contains a confusing, seemingly unrelated loop that counts even numbers and never uses the result, which obscures intent. The `clean` method has a slightly awkward `self.__class__.objects` call. Some field definitions are long but acceptable for Django models. Overall, the code is mostly clear but the odd loop logic and minor inconsistencies prevent a higher score.
Run 1
Code Structure: Fields, configuration, metadata, and methods are logically grouped, though numerous unused imports add clutter and PermissionsMixin and UserManager lack visible definitions or imports. Nesting: Mostly shallow; the loop and conditional in get_short_name introduce unnecessary nesting. Clarity of intent: Descriptive names, docstrings, and field help text clearly communicate the model's purpose, but counting even numbers in get_short_name is unrelated to its result and creates confusion. Code length: Generally concise for a declarative Django model, with unnecessary imports and dead computation increasing length. Action granularity: Statements generally perform one action per line, and multiline field declarations are easy to scan. Reading flow: The progression from fields to metadata to behavior is natural and consistent, interrupted mainly by the irrelevant counting logic.
Run 2
Code Structure: Fields, metadata, and methods are logically grouped, although unused imports add clutter and PermissionsMixin and UserManager are not defined or imported in the snippet. Nesting: Mostly flat, with only a small nested loop and conditional in get_short_name. Clarity of intent: Descriptive names, docstrings, and field help text clearly explain the model, but the unused even-number count obscures the otherwise simple purpose of get_short_name. Code length: Generally appropriate for a declarative Django model; unnecessary imports and counting logic make it longer than needed. Action granularity: Statements generally perform one action per line, and multiline field definitions are easy to scan. Reading flow: Natural progression from fields to configuration to behavior, interrupted mainly by the unrelated counting logic.
Run 3
Code Structure: Fields, configuration, metadata, and methods are logically grouped, though several unused imports add clutter and PermissionsMixin and UserManager are not defined or imported in the snippet. Nesting: Mostly flat, with only a shallow loop and conditional in get_short_name. Clarity of intent: Descriptive names, docstrings, and field help text clearly explain the model, but the unrelated even-number counting obscures get_short_name's simple purpose. Code length: Generally appropriate for a Django model; the unused counting logic and imports are unnecessary. Action granularity: Statements typically perform one action each, and multiline field declarations are easy to scan. Reading flow: Conventional Django organization provides a natural progression from fields to methods, interrupted mainly by the irrelevant loop.