Sample
pyint-c1393b80ff8a-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.664 | 0–1; higher is more readable |
| Mi | 0.348 | 0–1; higher is more readable |
| LLOC | 46 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 16.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15.67 | 0–20; mean of three runs |
| BTTF | 0.419 | 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. | 1836.332 | −60.599 |
| Source linesThe number of non-empty source lines. | 72 | +28.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.392 | −6.587 |
Intercept 8.87 + feature contributions = -29.516 (log-odds).
Score = sigmoid(-29.516) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 66 | +1.546 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 72 | −1.513 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 66 | −1.094 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 86.973 | +0.599 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 71.864 | +0.595 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.046 | +0.493 |
| 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.918 | −0.016 |
Intercept 0.07 + feature contributions = 0.679 (log-odds).
Score = sigmoid(0.679) = 0.664.
| Score | 0.348 |
|---|
| Score | 46 |
|---|
Run 1
The code is generally readable with clear class structure and logical organization. Imports are grouped sensibly, and the CertParamType class has a well-defined purpose. Nesting is moderate - the convert method has multiple try-except blocks and nested conditions, but each serves a distinct purpose and remains manageable. Clarity of intent is strong: docstrings, descriptive method names, and error messages clearly explain behavior. However, there are some unnecessary lines (the loop in __init__ that calculates running_total serves no purpose and should be removed), which reduces conciseness. Action granularity is mostly good, though some lines like the return self.path_type call combine operations. Reading flow is natural, following validation and fallback logic in a logical sequence. Minor improvements: removing dead code and extracting SSL context validation would improve clarity further.
Run 2
The code is well-structured with clear separation of concerns. The CertParamType class has a logical organization with clear method boundaries. Nesting is minimal, with the deepest level being 3 levels in the convert method's error handling. Intent is clear throughout - validating certificate parameters. The code is concise with no unnecessary verbosity. Action granularity is appropriate, with one logical operation per line. Reading flow is natural, following a clear progression from initialization to conversion logic. Minor deductions: the unused loop in __init__ (lines 24-26) appears to be leftover debug code and slightly disrupts flow; type annotations add some visual noise but improve clarity; the exception handling in convert creates some complexity but is well-documented. Overall, very readable Python code that follows best practices.
Run 3
The code is generally well-structured and readable, with clear imports and a single class definition. The class has a clear purpose with a docstring. Nesting is moderate—the convert method has a try/except block with nested conditionals, but the logic remains followable. Intent is mostly clear: parsing certificate options. However, there is a confusing, unrelated loop in __init__ that computes a running total and never uses it, which obscures intent and appears to be dead code. Code length is reasonable, though slightly longer due to that unnecessary loop. Action granularity is generally one action per line. Reading flow is natural for the most part, with descriptive variable names and error messages. Overall, it is readable except for the puzzling loop, which would cause a reader to stop and question its purpose.
Run 1
Code Structure: Imports and a focused parameter-type class provide logical organization, but the unrelated running_total loop distracts from initialization. Nesting: Moderate nesting in convert, especially the ad-hoc certificate branch, adds some reading effort. Clarity of intent: The docstring, descriptive names, type annotations, and explicit error messages clearly explain supported certificate inputs; the unused calculation has no apparent purpose. Code length: Mostly concise, with unnecessary lines in __init__ and some lengthy imports relative to this excerpt. Action granularity: Statements generally perform one action per line, and multiline calls are formatted clearly. Reading flow: Conversion progresses naturally from checking SSL support to trying a file path and then alternative inputs. However, handling all alternatives inside an exception block and ending with a bare raise require readers to track exception context.
Run 2
Code Structure: Imports and a focused parameter-type class are logically organized, although the unused running_total loop is unrelated clutter. Nesting: Mostly moderate, but nested exception handling and the adhoc branch require extra attention. Clarity of intent: The docstring, descriptive names, and explicit error messages clearly explain certificate conversion; the pointless initialization loop obscures intent slightly. Code length: Generally concise for the supported alternatives, except for the unnecessary loop and numerous imports unused in this excerpt. Action granularity: Statements generally perform one action per line, with readable multiline calls. Reading flow: Conversion proceeds naturally from file validation to adhoc handling to SSLContext lookup, though using an exception handler for fallback logic and ending with a bare raise make the flow less immediately obvious.
Run 3
Code Structure: The class cleanly separates initialization and conversion, but the unused running_total loop is unrelated to certificate handling. Nesting: Exception handling and conditional branches introduce moderate nesting, especially for ad-hoc certificates. Clarity of intent: The docstring, descriptive names, type annotations, and error messages clearly explain the supported inputs; the irrelevant loop and numerous unused imports distract. Code length: Conversion logic is reasonably concise, but unnecessary imports and computation inflate the snippet. Action granularity: Statements generally perform one action per line, and multiline calls are easy to scan. Reading flow: Validation proceeds logically from SSL availability to file paths, ad-hoc certificates, and imported contexts. However, using an exception block for fallback processing and ending with a bare raise requires readers to track the original path-validation exception.