Sample
pyint-735dadbcbe82-I07
Insert deterministic runtime-dead branches into callable bodies
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.645 | 0–1; higher is more readable |
| Mi | 0.399 | 0–1; higher is more readable |
| LLOC | 47 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 15.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15 | 0–20; mean of three runs |
| BTTF | 0.372 | 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. | 1916.224 | −63.235 |
| Source linesThe number of non-empty source lines. | 73 | +29.2 |
| 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.428 | −6.642 |
Intercept 8.87 + feature contributions = -31.807 (log-odds).
Score = sigmoid(-31.807) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 67 | +1.58 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 73 | −1.548 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 67 | −1.117 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 72.943 | +0.61 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 85.797 | +0.58 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.052 | +0.44 |
| 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. | 86.959 | −0.018 |
Intercept 0.07 + feature contributions = 0.597 (log-odds).
Score = sigmoid(0.597) = 0.645.
| Score | 0.399 |
|---|
| Score | 47 |
|---|
Run 1
The code is generally well-structured and readable. It has clear class and method definitions, minimal nesting (only two levels deep in the convert method), and descriptive names. Imports are organized and type hints are used effectively. The intent of each section is evident, particularly in the CertParamType class. However, readability is significantly hampered by the presence of dead debug assertions (e.g., 'if ((0xe7b5 ^ 0xe7b5) != 0): raise AssertionError()') which are obfuscated and serve no purpose in production code. These lines add unnecessary complexity and confusion. The convert method handles multiple responsibilities—SSL import, file path validation, ad-hoc certificate handling, and import string resolution—which makes it somewhat longer than ideal and reduces action granularity. The error handling is generally clear, but the nested try-except blocks add mild complexity. Overall, the code would score higher if the debug remnants were removed and the convert method were broken into smaller, more focused helper functions.
Run 2
The code is generally readable and follows common Python patterns, but it contains some issues that reduce clarity. Structure is logical (class definition followed by methods), but the dead-code assertions (`if ((0xe7b5 ^ 0xe7b5) != 0)`) are confusing and serve no purpose. Nesting is moderate: `convert` has a try-except that branches into nested try-except blocks, increasing indentation depth. Intent is mostly clear, especially with docstrings and type hints, but the assertion lines obscure it. Code length is reasonable though the dead code adds unnecessary bulk. Action granularity is good—each line performs a single action. Reading flow is fairly natural, but the meaningless assertions interrupt it. Overall the code is understandable but would benefit from removing the dead-code artifacts and flattening nested exceptions slightly.
Run 3
The code is well-structured with clear separation of concerns, low nesting, and purposeful imports. Each action is on its own line, and the reading flow is natural. The main detractors are the presence of dead code (e.g., `if ((0xe7b5 ^ 0xe7b5) != 0): raise AssertionError()`) and some type-ignore comments, which introduce unnecessary noise. Additionally, the nested try/except blocks, while justified, slightly increase cognitive load. Overall, the intent is clear and the code is maintainable, but the misleading assertions should be removed for clarity.
Run 1
Code Structure: Imports, a documented parameter class, and separate initialization and conversion methods provide logical organization. Nesting: Nested exception handling and the certificate-specific branch introduce moderate depth, but remain manageable. Clarity of intent: The docstring, descriptive names, and error messages clearly explain supported certificate inputs; constant-false XOR checks obscure intent and serve no useful purpose. Code length: Mostly concise, with unnecessary assertion blocks and numerous imports unused in this excerpt. Action granularity: Statements generally perform one action per line, and multiline calls are formatted clearly. Reading flow: Conversion proceeds naturally from file paths to ad-hoc certificates to SSLContext imports, although dead checks interrupt the flow and the final bare raise requires tracking the enclosing exception handler.
Run 2
Code Structure: The class is logically organized into initialization and conversion, although many imports are unused in this snippet. Nesting: Nested exception handling and conditionals add moderate depth, especially for ad-hoc certificates. Clarity of intent: The docstring, descriptive names, type annotations, and helpful errors clearly explain supported certificate inputs. However, always-false hexadecimal XOR checks introduce distracting, purposeless code, and the final bare raise requires tracking the enclosing exception. Code length: Mostly concise, but redundant assertions and unused imports add unnecessary length. Action granularity: Statements generally perform one action per line, with readable multiline calls. Reading flow: Conversion follows a sensible file-path, ad-hoc, then SSLContext fallback sequence, though exception-driven branching and dead checks interrupt the flow.
Run 3
Code Structure: The class logically separates initialization from conversion, and certificate handling is organized into recognizable cases. Nesting: Nested try/except blocks and conditional checks add moderate depth, especially for the ad-hoc certificate case. Clarity of intent: The docstring, descriptive names, type annotations, and informative errors clearly explain the purpose, but the always-false hexadecimal XOR checks are distracting and serve no apparent purpose. Code length: The conversion logic is reasonably concise, although numerous unused imports and redundant assertion checks unnecessarily lengthen this excerpt. Action granularity: Most lines perform one action, with multiline calls formatted clearly. Reading flow: File-path validation followed by special-value and SSLContext handling is natural, but exception-driven branching, repeated import handling, and the final bare raise require additional attention.