Sample
pyint-805cca75b03e-I03
Replace names with length-matched meaningful but unrelated identifiers
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.891 | 0–1; higher is more readable |
| Mi | 0.399 | 0–1; higher is more readable |
| LLOC | 43 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 14.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 13.33 | 0–20; mean of three runs |
| BTTF | 0.511 | 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. | 1694.374 | −55.914 |
| Source linesThe number of non-empty source lines. | 69 | +27.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.368 | −6.552 |
Intercept 8.87 + feature contributions = -25.996 (log-odds).
Score = sigmoid(-25.996) = 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. | 70 | −1.442 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 63 | +1.442 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 86.971 | +0.599 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 68.864 | +0.553 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.045 | +0.502 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| 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.929 | −0.017 |
Intercept 0.07 + feature contributions = 2.104 (log-odds).
Score = sigmoid(2.104) = 0.891.
| Score | 0.399 |
|---|
| Score | 43 |
|---|
Run 1
The code is generally well-structured, with a clear class definition and method organization. It avoids deep nesting by using early returns and exceptions, maintaining flat readability. The intent is clear: parsing and validating a --cert option with multiple fallback cases. Lines are concise, although some multi-line function calls with complex arguments slightly reduce readability (e.g., click.BadParameter with multiple positional args). Action granularity is mostly one action per line, though type-ignore comments and inline imports add minor noise. Reading flow is logical: try for SSL, try path, then fallback to adhoc or import string. The use of descriptive variable names (limit, entry, key) is okay but not highly descriptive. The main weakness is the terse variable name 'age' for the imported SSLContext, which obscures intent, and some repetition of exception handling blocks. Overall, the code is readable but could be improved with slightly better naming and minor restructuring to reduce repetitive error handling.
Run 2
The code is generally readable with clear intent, logical structure, and good use of type hints and docstrings. The class has a single responsibility, and the method follows a mostly linear flow. However, there are some readability concerns: the variable naming is inconsistent ('limit', 'entry', 'key' are opaque; 'age' appears to be a typo for 'ctx' or similar), and the nested try/except blocks add moderate depth. The re-raising of the original exception after the import_string check is subtle and could confuse readers. Overall, the code is concise and well-organized, but the unclear variable names and mixed abstraction levels prevent a higher score.
Run 3
The code has clear logical organization and follows standard Python patterns, but readability is hampered by several issues. The nesting is deep (3-4 levels in the 'deliver' method), making the flow hard to follow. The exception handling creates tangled control flow where the 'raise' at the end re-raises the original 'BadParameter' caught earlier. Variable names are cryptic: 'limit' should be 'value', 'age' should be 'ctx', 'key' and 'entry' have reversed/unclear roles (they appear to be the parameter and context, respectively). The 'deliver' method name is ambiguous for a type converter. The method signature with type hints is verbose and adds noise. The import of 'cryptography' with 'noqa' comment is a side-effect import that obscures intent. While each line performs one action and the code is not excessively long, the unclear naming, deep nesting, and convoluted exception flow reduce readability. The docstring is helpful but the internal logic requires careful reading to understand the three possible return scenarios.
Run 1
Code Structure: Certificate handling is logically grouped in a class and method, but many unrelated imports distract from the snippet. Nesting: Nested exception handling and conditional branches require moderate effort to follow. Clarity of intent: The class docstring, descriptive class name, and error messages explain the purpose, but names such as deliver, limit, entry, key, and age obscure parameter roles and intermediate values. Code length: The implementation is reasonably concise, although the extensive unused imports add clutter. Action granularity: Statements generally perform one action per line, with readable multiline calls. Reading flow: Processing progresses naturally from SSL availability to file validation, ad-hoc certificates, and imported contexts; however, exception-driven fallback and the final bare raise make control flow less immediately obvious.
Run 2
Code Structure: The class and method are logically organized around certificate validation, although many imports are unused in this excerpt. Nesting: Nested exception handlers and conditionals create moderate depth, particularly for the ad-hoc certificate branch. Clarity of intent: The class docstring and error messages clearly explain supported inputs, but names such as deliver, limit, entry, key, and age obscure the method's role and the values being processed. Code length: The implementation is reasonably concise, though the extensive import list adds visual overhead. Action granularity: Most lines perform one action, with readable multiline calls. Reading flow: Validation progresses naturally from a file path to an ad-hoc certificate and then an imported SSL context, but exception-driven branching and the final bare raise require closer attention.
Run 3
Code Structure: The class cleanly groups certificate-option handling, but numerous unrelated imports distract from its purpose. Nesting: Nested exception handling and the conditional dependency check introduce moderate depth, though returns keep branches manageable. Clarity of intent: The docstring and error messages clearly explain supported inputs, but names such as deliver, limit, entry, key, and age obscure their roles. Code length: The implementation is reasonably concise, while the import block is excessive for this excerpt. Action granularity: Statements generally perform one action per line, and multiline calls are formatted clearly. Reading flow: Processing moves logically from SSL availability to file validation, ad-hoc certificates, and imported SSL contexts. However, handling alternative inputs inside an exception block and ending with a bare raise make the flow less immediately obvious.