Sample
pyint-d42ae4293632-I11
Split eligible integer literals into pairs of short-named intermediate variables
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.872 | 0–1; higher is more readable |
| Mi | 0.781 | 0–1; higher is more readable |
| LLOC | 31 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 8.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 14 | 0–20; mean of three runs |
| BTTF | 0.417 | 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. | 1049.741 | −34.641 |
| Source linesThe number of non-empty source lines. | 53 | +21.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.174 | −6.261 |
Intercept 8.87 + feature contributions = -10.832 (log-odds).
Score = sigmoid(-10.832) = 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. | 52 | −0.805 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 44 | +0.785 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 78.537 | +0.463 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.056 | +0.397 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 52.827 | +0.329 |
| 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. | 79.963 | +0.278 |
Intercept 0.07 + feature contributions = 1.914 (log-odds).
Score = sigmoid(1.914) = 0.872.
| Score | 0.781 |
|---|
| Score | 31 |
|---|
Run 1
The code shows some structural organization with a clear class and method separation, but readability is significantly hindered by poor variable naming (a, b, c, d) and unusual arithmetic expressions (a + b, c + d) that obscure intent. The action granularity is inconsistent - some lines are clean single operations while others needlessly split trivial expressions across multiple lines. Nesting is acceptable with early returns, and the docstrings help clarify purpose, but the overall reading flow is disrupted by the cryptic index calculations and redundant imports. The unused imports (sys, threading) and unused type aliases add noise. While the logic is simple, the implementation choices make it unnecessarily harder to understand than needed.
Run 2
The code is moderately readable but has several clarity issues. The class structure is logical, with a clear purpose and docstrings, but the methods contain unnecessary complexity. The use of variables 'a', 'b', 'c', and 'd' to calculate indices (a+b, c+d) is confusing; direct indexing with 0 or -1 would be clearer. Imports inside functions are acceptable but disrupt reading flow. Nesting is minimal, and action granularity is mostly one action per line. However, the 'get_first_param_type' method is overcomplicated for a simple task, reducing clarity. The code could be shortened by removing redundant variable assignments and simplifying conditions. Overall, the code is functional but not optimally readable due to unclear variable names and unnecessary indirection.
Run 3
The code has some organizational strengths, such as a dedicated class with clear method names and docstrings. However, readability is severely undermined by several factors. The use of cryptic variables like 'a', 'b', 'c', and 'd' to calculate array indices (e.g., params[(a + b)]) obscures intent and introduces unnecessary complexity where 'params[0]' would be direct. Repeated imports of 'inspect' inside methods are inconsistent and confusing. Nesting is minimal, which is positive, but the action granularity suffers from multi-step logic compressed into convoluted expressions. The reading flow is disrupted by these unnatural index calculations and redundant arithmetic. Overall, while the structure is logical, the implementation choices make the code harder to follow than necessary.
Run 1
Code Structure: The class logically separates signature extraction, parameter inspection, and return-type inspection, though unused imports add clutter. Nesting: Shallow conditionals and early returns keep complexity low. Clarity of intent: Method names and docstrings explain the purpose, but meaningless variables a, b, c, and d obscure the simple first-parameter index, and callable shadows a built-in. Code length: Mostly concise, but redundant arithmetic, repeated local imports, and unnecessary variables lengthen straightforward operations. Action granularity: Each statement performs one action, making individual steps easy to follow. Reading flow: The methods follow a natural progression, but the artificial indexing calculations interrupt comprehension. Overall, the code is readable and well organized, with localized obfuscation reducing its score.
Run 2
Code Structure: The class logically groups signature extraction and annotation access into small methods, though unused imports add clutter. Nesting: Shallow conditionals and early returns keep complexity low. Clarity of intent: Method names and docstrings clearly communicate the purpose, but meaningless variables a, b, c, and d obscure simple indexing of the first parameter. Code length: Mostly concise, with unnecessary arithmetic assignments, repeated local imports, and a needlessly split condition adding length. Action granularity: Each line generally performs one action, making operations easy to distinguish. Reading flow: Initialization followed by parameter and return annotation access is natural, but the artificial indexing arithmetic interrupts comprehension.
Run 3
Code Structure: The class logically groups signature extraction and annotation access, although unused imports add clutter. Nesting: Shallow conditionals and early returns keep control flow easy to follow. Clarity of intent: Method names and docstrings clearly explain the purpose, but meaningless variables a, b, c, and d obscure straightforward first-parameter indexing. Code length: Mostly concise, with unnecessary arithmetic, temporary variables, and repeated local imports adding avoidable length. Action granularity: Statements generally perform one action per line, though the indexing expressions introduce needless mental work. Reading flow: Initialization followed by parameter and return annotation access feels natural, but the artificial arithmetic interrupts an otherwise straightforward reading experience.