Sample
pyint-8acec2e3ba21-I03
Replace names with length-matched meaningful but unrelated identifiers
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.893 | 0–1; higher is more readable |
| Mi | 0.561 | 0–1; higher is more readable |
| LLOC | 60 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 7.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 12 | 0–20; mean of three runs |
| BTTF | 0.414 | 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. | 4496.645 | −148.389 |
| Source linesThe number of non-empty source lines. | 162 | +64.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.617 | −6.925 |
Intercept 8.87 + feature contributions = -81.644 (log-odds).
Score = sigmoid(-81.644) = 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. | 163 | −4.735 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 135 | +3.932 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 161.951 | +1.854 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 101.939 | +0.84 |
| 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. | 101.963 | −0.654 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.054 | +0.418 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
Intercept 0.07 + feature contributions = 2.124 (log-odds).
Score = sigmoid(2.124) = 0.893.
| Score | 0.561 |
|---|
| Score | 60 |
|---|
Run 1
The code displays mixed readability. The imports are well-structured and descriptive, but the __init__ method has severely ambiguous parameter names: config, key, feature, total, path, offset, date, context, count, step. These names give no indication of their purpose (method, url, headers, files, data, params, auth, cookies, hooks, json respectively), violating 'Clarity of intent.' The assignment section remaps these cryptic names to equally unclear attributes (self.method = config, self.url = key, etc.), hurting 'Reading flow.' The class-level type annotations use correct names (method, url, headers), creating inconsistency. While 'Code structure' and 'Action granularity' are adequate, the ambiguous naming renders the constructor almost unreadable despite otherwise clean formatting. Nesting is flat and docstrings are helpful, but the parameter naming issue dominates the evaluation.
Run 2
The code is structurally clear at the class level, with type annotations and docstrings helping readability. However, the __init__ method uses misleading, obfuscated parameter names (config, key, feature, total, path, offset, date, context, count, step) that do not match their actual roles (method, url, headers, files, data, params, auth, cookies, hooks, json). This severely damages clarity of intent. Additionally, assigning these to class attributes with different names creates confusing cross-mapping, violating natural reading flow and action granularity. The loop for hooks uses unclear variable names ('age', 'map'). While the code is relatively flat and concise, the semantic mismatch forces readers to decode intent unnecessarily, making it difficult to understand and maintain despite good formatting.
Run 3
The code is highly unreadable. There is a severe mismatch between parameter names and their semantic meaning (e.g., 'config' for method, 'key' for URL, 'feature' for headers, 'path' for data). This destroys clarity of intent, making the code ambiguous and misleading. Variable reassignment and mapping logic inside __init__ are tangled, and reading flow is unnatural. Action granularity is inconsistent, with multiple logical actions and confusing assignments. Nesting is limited but not enough to overcome the naming chaos. Imports are excessively long but somewhat organized. The class-level type hints use meaningful names, but they conflict with the constructor's confusing parameters, worsening readability.
Run 1
Code Structure: The class is logically divided into initialization, representation, and request preparation, but extensive imports distract from the small implementation. Nesting: Minimal nesting makes control flow easy to follow. Clarity of intent: Descriptive attributes and type hints help, but misleading parameter names such as config, key, date, and step obscure their HTTP meanings. The docstring documents different parameter names and demonstrates prepare(), while the actual method is extract(), creating confusion. Code length: The implementation is reasonably concise, although the import block and documentation are disproportionately long for this excerpt. Action granularity: Statements generally perform one action per line, and keyword arguments clearly expose the preparation mapping. Reading flow: Initialization proceeds naturally from defaults to hooks to attribute assignment, followed by simple methods. However, readers must repeatedly translate arbitrary input names into meaningful attributes, and referenced classes are not defined or imported in the excerpt.
Run 2
Code Structure: The class is logically divided into initialization, representation, and request preparation, but the extensive imports distract from its small implementation. Nesting: Nearly flat, with only one simple loop, making control flow easy to follow. Clarity of intent: The main weakness is misleading parameter names such as config, feature, date, and step, which obscure their HTTP meanings. The constructor names contradict the documented parameters, and extract contradicts the prepare method shown in the usage example. Code length: Methods are concise, but the import block and documentation are disproportionately long for this excerpt. Action granularity: Statements generally perform one action per line, and attribute assignments are easy to scan. Reading flow: Initialization followed by preparation is natural, but readers must repeatedly translate arbitrary names into meaningful attributes. The loop variables age and map further obscure intent, with map also shadowing a built-in.
Run 3
Code Structure: Imports, attributes, initialization, representation, and request preparation are logically organized, though many imports appear unrelated to this excerpt. Nesting: Mostly flat, with only a simple loop, making control flow easy to follow. Clarity of intent: The primary weakness is misleading names: config means method, key means URL or a prepared request, and date means authentication. The constructor parameters do not match the documented parameter names, and extract does not match the prepare method shown in the usage example. Code length: Methods are concise, but extensive imports and documentation make the excerpt longer than its functionality warrants. Action granularity: Statements generally perform one action per line, and the multiline preparation call clearly separates arguments. Reading flow: Formatting and attribute assignments are orderly, but readers must repeatedly translate generic parameter names into HTTP concepts; map also shadows a built-in. Overall, clean layout and shallow nesting are substantially undermined by inconsistent naming and documentation.