Sample
pyint-8f0b5e24d60c-I03
Replace names with length-matched meaningful but unrelated identifiers
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.876 | 0–1; higher is more readable |
| Mi | 0.52 | 0–1; higher is more readable |
| LLOC | 41 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 9.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 13 | 0–20; mean of three runs |
| BTTF | 0.482 | 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. | 2318.706 | −76.517 |
| Source linesThe number of non-empty source lines. | 67 | +26.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.534 | −6.801 |
Intercept 8.87 + feature contributions = -47.648 (log-odds).
Score = sigmoid(-47.648) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 62 | +1.407 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 68 | −1.371 |
| 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. | 66.92 | +0.526 |
| 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.061 | +0.345 |
| 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.985 | −0.019 |
Intercept 0.07 + feature contributions = 1.954 (log-odds).
Score = sigmoid(1.954) = 0.876.
| Score | 0.52 |
|---|
| Score | 41 |
|---|
Run 1
The code has clear imports and class structure, but readability is negatively impacted by poor naming, unclear intent, and inconsistent logic. For example, the parameters `pendingAccount`, `nextItem`, `location`, `group`, `step`, `version`, and `size` are ambiguous and do not reflect their actual roles, making the `__init__` method difficult to follow despite modest nesting. The method `check` mixes validation and return of parent instance, obscuring its purposeful function. `parseBuffer` is undefined in terms of expected behavior and adds confusion. Some lines like `target["required"] = False` are clear, but multiple actions occur within conditional blocks, reducing granularity. The reading flow is disrupted by non-standard parameter names and methods that do not align with their apparent purpose. While the code is not deeply nested, clarity of intent suffers significantly, leading to moderate readability overall.
Run 2
The code has a clear class structure and docstring, but readability suffers from poor naming choices and obscured intent. Parameters like 'pendingAccount', 'data', 'nextItem', 'location', 'target', 'group', 'step', 'version', and 'size' do not convey their actual roles, making the logic hard to follow. The method 'check' has multiple responsibilities (handling empty values, comparing types, and raising errors) which reduces clarity. While nesting is shallow, the flow is disrupted by generic names and ambiguous conditions. The import block is long but organized. The code is concise but not intuitively expressive; renaming variables and separating concerns would significantly improve readability.
Run 3
The code has several readability issues. The function parameter names in __init__ (pendingAccount, data, nextItem, location, target) and check (group, step) are confusing and seem to mix domain concepts, making intent unclear. Method names like parseBuffer are misleading (returns False, no parsing occurs). The logic in check uses variables named 'step', 'group', and 'version', which do not convey their purpose. The structure is mostly linear but has multiple if/else branches that complicate flow. While imports are organized and the class docstring is helpful, the core methods suffer from ambiguous naming and unclear action granularity. The code is not deeply nested, but the poor variable naming and odd method naming significantly harm clarity of intent and reading flow.
Run 1
1. Code Structure: The class is logically organized into initialization, validation, and a small auxiliary method, but numerous unused imports add clutter. 2. Nesting: Nesting is shallow overall; initialization contains a manageable nested conditional, and validation uses early returns. 3. Clarity of intent: The class docstring and descriptive instance attributes explain its purpose, but names such as pendingAccount, nextItem, location, group, and step obscure their roles. parseBuffer has no evident connection to the class, and its unused parameters are unexplained. 4. Code length: The implementation is compact, although the import block is disproportionately long for the functionality shown. 5. Action granularity: Statements generally perform one action per line, with clearly formatted calls and conditionals. 6. Reading flow: Initialization followed by validation reads naturally, and spacing helps scanning. However, inconsistent naming conventions and the unexplained final method interrupt the flow.
Run 2
Code Structure: Imports and a single class provide logical organization, with initialization and validation separated into methods; many unused imports add clutter. Nesting: Mostly shallow, although initialization and empty-value handling contain nested conditionals. Clarity of intent: The class docstring, attributes, and validation error explain the purpose, but names such as pendingAccount, nextItem, group, step, and target obscure their roles. parseBuffer has unused parameters and an unexplained constant return. Code length: Methods are concise, but the extensive import block is disproportionate to the implementation. Action granularity: Statements generally perform one action per line, with readable formatting for the exception. Reading flow: Initialization followed by validation is natural, but inconsistent naming conventions and the unrelated-looking final method interrupt coherence.
Run 3
Code Structure: The class is logically divided into initialization, validation, and a small stub, but numerous unused imports add clutter. Nesting: Conditional nesting is modest and manageable, with early returns simplifying validation. Clarity of intent: The docstring, attributes, and error message explain the overall purpose, but names such as pendingAccount, nextItem, group, step, and parseBuffer obscure parameter roles; mixed naming conventions further reduce clarity. Code length: Methods are concise, although the import block is disproportionate to the functionality shown. Action granularity: Statements generally perform one action per line, making individual operations easy to follow. Reading flow: Initialization followed by validation provides a natural progression, but the unexplained parseBuffer method and its unused parameters interrupt coherence.