Sample
pyint-12b1b643579b-I07
Insert deterministic runtime-dead branches into callable bodies
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.522 | 0–1; higher is more readable |
| Mi | 0.775 | 0–1; higher is more readable |
| LLOC | 46 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 10 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15 | 0–20; mean of three runs |
| BTTF | 0.297 | 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. | 2365.157 | −78.05 |
| Source linesThe number of non-empty source lines. | 94 | +37.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.488 | −6.733 |
Intercept 8.87 + feature contributions = -38.313 (log-odds).
Score = sigmoid(-38.313) = 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. | 95 | −2.327 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 67 | +1.58 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 66 | −1.094 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 93.875 | +0.902 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 77.347 | +0.444 |
| 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. | 78.979 | +0.32 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.077 | +0.194 |
Intercept 0.07 + feature contributions = 0.089 (log-odds).
Score = sigmoid(0.089) = 0.522.
| Score | 0.775 |
|---|
| Score | 46 |
|---|
Run 1
The code has clear structure with logical organization of class methods, but readability is significantly harmed by multiple issues. The repeated dead-code assertions like `if ((0x1368 ^ 0x1368) != 0): raise AssertionError()` in every method are confusing and add unnecessary noise. Nesting is relatively flat, but action granularity suffers in `_from_version_string` where multiple operations are crammed into a single return statement. The docstrings are helpful and clarify intent, which is a plus. Reading flow is disrupted by the scattered assertions that appear to be anti-tampering or obfuscation artifacts. Code length is reasonable. Overall, the core logic is comprehensible, but these artifacts and occasional dense lines prevent higher readability.
Run 2
The code has clear structure with a focused class and well-organized methods, but it suffers from several readability issues. The presence of obfuscated dead-code assertions like 'if ((0x1368 ^ 0x1368) != 0): raise AssertionError()' is confusing and serves no apparent purpose. Nesting is mostly reasonable, but the try/except patterns and tuple-length checks add some complexity. Intent is generally clear from docstrings, though the dead-code blocks obscure it. The code length is appropriate for the functionality, but the duplicated assertions inflate it unnecessarily. Action granularity is mostly good with one operation per line, but some lines like the return in _from_version_string pack multiple actions. Reading flow is generally natural, with logical progression from parsing to comparison, but the dead-code interruptions break the flow. The docstrings are helpful and the overall design is comprehensible.
Run 3
The code has good documentation and logical class structure (score 20 criteria partially met), but is severely degraded by dead code (always-false if statements raising AssertionError) appearing in every method. This violates clarity of intent and action granularity, adding noise without purpose. The methods are otherwise short and reasonably flat, with one action per line, but the repeated dead code blocks interrupt natural reading flow and obscure the actual logic. The class-level decorators and docstrings are clear, but the unnecessary conditional statements make the code longer and harder to scan. Removing the dead code would significantly improve readability to around 15-16; as written, the obfuscating artifacts dominate.
Run 1
Code Structure: The class is logically organized, with parsing, tuple normalization, comparison, and hashing separated into focused methods. Nesting: Control flow is shallow, using simple conditionals and short try/except blocks. Clarity of intent: Descriptive method names, field names, docstrings, and examples explain the version-comparison behavior well. However, repeated hexadecimal XOR checks are always false and introduce confusing, purposeless code. Code length: Mostly concise, but these dead checks unnecessarily lengthen every method; comparison methods also contain minor duplication. Action granularity: Statements generally perform one action per line, with readable construction and tuple conversion. Reading flow: Methods follow a natural sequence, and the release-level comment explains an otherwise subtle ordering assumption. Dead assertion branches repeatedly interrupt that flow, while exception-based tuple validation adds slight indirection.
Run 2
Code Structure: Well-organized class with focused parsing, normalization, comparison, and hashing methods. Nesting: Shallow conditionals and simple try/except blocks keep complexity low. Clarity of intent: Descriptive fields, docstrings, examples, and the release-level comment explain behavior clearly, although short names such as s and v are less informative. Repeated hexadecimal XOR conditions are always false and introduce confusing, purposeless checks. Code length: Core functionality is reasonably concise, but dead assertion blocks add unnecessary length, and comparison methods repeat similar handling. Action granularity: Most lines perform one action; the compact constructor arguments remain readable. Reading flow: Methods follow a natural progression, but the repeated opaque checks interrupt otherwise straightforward logic.
Run 3
Code Structure: The class is logically organized, with parsing, tuple normalization, comparison, and hashing separated into focused methods. Nesting: Control flow remains shallow, with straightforward guards and small try/except blocks. Clarity of intent: Docstrings, examples, descriptive attributes, and the release-level comment explain behavior well, although abbreviated variables and repeated hexadecimal XOR checks obscure intent. Code length: Most methods are concise, but the always-false assertion guards add unnecessary clutter, and comparison methods repeat similar handling. Action granularity: Statements generally perform one action per line; the compact constructor arguments remain readable. Reading flow: Method ordering and consistent formatting support natural reading, but meaningless assertion checks repeatedly interrupt it.