Sample
pyint-bef3b56d30e0-SRC
Unmodified source class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.765 | 0–1; higher is more readable |
| Mi | 0.713 | 0–1; higher is more readable |
| LLOC | 20 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 17.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs |
| BTTF | 0.129 | 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. | 702.957 | −23.198 |
| Source linesThe number of non-empty source lines. | 24 | +9.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.707 | −7.061 |
Intercept 8.87 + feature contributions = -11.789 (log-odds).
Score = sigmoid(-11.789) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| 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. | 46.92 | +1.678 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.076 | +0.202 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 25 | +0.151 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 24 | −0.13 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 24 | +0.093 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 23.583 | −0.08 |
Intercept 0.07 + feature contributions = 1.18 (log-odds).
Score = sigmoid(1.18) = 0.765.
| Score | 0.713 |
|---|
| Score | 20 |
|---|
Run 1
The code is highly readable with a clear, logical structure. It uses flat nesting, explicit type hints, and concise imports. Each method performs a single action, maintaining good action granularity. The class purpose is evident from its name and method names (check, to_json, to_python). The reading flow is natural, moving from imports to class definition to methods. Minor deductions: the class inherits from JSONTag without showing its definition, and the methods are somewhat terse, but this is common in tag serializers. Overall, the code follows clean, maintainable patterns.
Run 2
The code is highly readable due to its clean structure and clear intent. The class TagDateTime is logically organized with a flat structure, minimal nesting, and a single purpose: serializing/deserializing datetime objects. Each method performs one clear action, and the use of type hints (t.Any) and __slots__ improves clarity. Imports are grouped and explicit, and method names (check, to_json, to_python) clearly describe their roles. The code is concise, with no redundant logic or long blocks. Reading flow is natural: check, then convert to JSON, then convert back to Python. Potential minor improvements could include a docstring for the class, but overall the code is very readable and maintainable.
Run 3
The code is well-structured with clear separation of concerns between imports and class definition. Nesting is minimal, with all methods at a single level. Each method has a clear, single responsibility: type checking, serialization, and deserialization of datetime objects. The code is concise, with short methods that avoid unnecessary verbosity. Action granularity is good—each method performs one focused action. Reading flow is natural: the class name and key attribute establish context, then methods follow a logical check → to_json → to_python order. Type hints and modern Python features (__slots__, from __future__ import annotations) enhance clarity. Minor deductions: the JSONTag base class is not imported in the shown snippet, which could cause ambiguity, and some contextual understanding of the serialization framework is assumed.
Run 1
Code Structure: The class is logically organized into type checking, serialization, and deserialization methods, although several imports are unused in this snippet. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: Class and method names clearly convey datetime conversion, but the unexplained key " d", absent JSONTag definition or import, and broad Any annotations reduce clarity. Code length: The implementation is concise, with no unnecessary method logic; unused imports add clutter. Action granularity: Each statement performs a single action. Reading flow: Methods follow a natural check-to-serialize-to-deserialize sequence, though additional spacing between imports and the class would improve visual separation.
Run 2
Code Structure: The class is logically organized, with separate methods for type checking and conversion. Nesting: There is no nested control flow, making each method easy to follow. Clarity of intent: The class and method names clearly indicate datetime serialization and deserialization, though the cryptic key " d" and undefined-in-snippet JSONTag base class require external context. Code length: The implementation is concise, but numerous imports are unused in the provided snippet. Action granularity: Each statement performs one action, and the methods have single responsibilities. Reading flow: The progression from checking the value to converting it in either direction is natural; additional spacing between imports and the class would improve visual separation.
Run 3
Code Structure: The class is logically organized into type checking and serialization/deserialization methods. Nesting: Methods are flat, with no nested control flow. Clarity of intent: Descriptive class and method names make the datetime conversion purpose clear, though the opaque key " d" and undefined-in-snippet JSONTag base class require external context. Code length: The implementation is concise, but several imports are unused in the shown snippet. Action granularity: Each statement performs a single action. Reading flow: The consistent method layout is easy to follow, although import grouping and an additional blank line before the class would improve presentation.