Sample
pyint-e0b49cae9964-I03
Replace names with length-matched meaningful but unrelated identifiers
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 | 0–20; mean of three runs |
| GPT-6.1 Sol | 14 | 0–20; mean of three runs |
| BTTF | 0.126 | 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. | 707.016 | −23.332 |
| 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.67 | −7.005 |
Intercept 8.87 + feature contributions = -11.866 (log-odds).
Score = sigmoid(-11.866) = 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 demonstrates good readability with a clear structure, flat hierarchy, and concise methods. Each method has a single responsibility, and the use of type hints enhances clarity. The naming is mostly intuitive (`route`, `connect`, `summarize`), though these are slightly abstract without context. Imports are organized, and the class is minimal with `__slots__` usage. The main drawback is the ambiguous method names, which may require domain knowledge to fully understand. Overall, the code is well-structured, easy to follow, and maintains a natural reading flow.
Run 2
The code is highly readable due to clean structure, flat nesting, and clear intent. Each method performs one action, following a logical flow with concise, self-explanatory names like 'route', 'connect', and 'summarize' (though these names are slightly unconventional—'serialize' and 'deserialize' might be clearer). Type hints are used consistently, improving clarity. The class is minimal and avoids unnecessary complexity, with no deep nesting or redundant code. The only minor issue is the non-intuitive method naming, which slightly obscures purpose.
Run 3
The code is generally readable with clear imports, logical structure, and concise methods. The class has a clear single responsibility (serializing datetime objects), and each method performs one action. However, there are some ambiguities: the parameter names ('index', 'count') don't clearly convey their purpose (they appear to be the value being serialized/deserialized), and the method names 'route', 'connect', and 'summarize' are unusual for serialization logic—'check', 'serialize', and 'deserialize' would be more intuitive. The code is flat with no nesting, which aids readability. Minor improvements could include type hints on the class and more descriptive parameter names.
Run 1
Code Structure: The class is logically organized, but numerous unused imports add clutter, and JSONTag is not defined or imported in the snippet. Nesting: Methods are flat, with no unnecessary nesting. Clarity of intent: TagDateTime and the datetime check suggest date serialization, but route, connect, summarize, index, and count poorly communicate their roles. The key value is unexplained, and broad Any annotations provide little guidance. Code length: The class is concise, though the import section is disproportionately long. Action granularity: Each statement performs one action, making individual lines easy to read. Reading flow: The progression from type checking to formatting and parsing is sensible, but misleading names and unrelated imports interrupt comprehension.
Run 2
Code Structure: Imports and a small class are logically organized, though JSONTag is not defined or imported in the snippet and several imports are unused. Nesting: There is no unnecessary nesting; methods are flat and easy to scan. Clarity of intent: Datetime checking and HTTP-date conversion are recognizable, but route, connect, summarize, index, and count poorly describe their roles. The opaque key also lacks explanation. Code length: The class is concise, but unused imports add clutter. Action granularity: Each line performs one clear action. Reading flow: Consistent formatting and short methods support smooth reading, although missing context and misleading names require readers to infer the serialization purpose.
Run 3
Code Structure: Imports and a small class are logically organized, but several imports are unused and JSONTag is not defined or imported in the snippet. Nesting: Methods are flat, with no nested control flow. Clarity of intent: TagDateTime and the datetime utilities suggest datetime serialization, but route, connect, summarize, index, and count are misleading names that obscure checking, encoding, and decoding roles. The key string is unexplained, and broad Any annotations provide little guidance. Code length: The class is concise, though unused imports add clutter. Action granularity: Each statement performs one action, making individual lines easy to parse. Reading flow: The check-to-conversion sequence is natural, but ambiguous naming and missing context interrupt comprehension.