Sample
pyint-7bfec4655652-I03
Replace names with length-matched meaningful but unrelated identifiers
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.604 | 0–1; higher is more readable |
| Mi | 0.67 | 0–1; higher is more readable |
| LLOC | 17 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 12.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 14.67 | 0–20; mean of three runs |
| BTTF | 0.506 | 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. | 790.827 | −26.097 |
| Source linesThe number of non-empty source lines. | 21 | +8.4 |
| 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.665 | −6.997 |
Intercept 8.87 + feature contributions = -15.824 (log-odds).
Score = sigmoid(-15.824) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| 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. | 78 | +0.361 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.066 | +0.303 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 22 | +0.257 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 20.797 | −0.119 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 20 | −0.045 |
Intercept 0.07 + feature contributions = 0.421 (log-odds).
Score = sigmoid(0.421) = 0.604.
| Score | 0.67 |
|---|
| Score | 17 |
|---|
Run 1
The code is concise and logically organized, with a clear class definition for ExtraWhere. Nesting is minimal, with no deeply nested control flow. The intent is mostly clear, though the 'client' parameter name is slightly ambiguous (it holds params). Code length is efficientâno unnecessary lines. Action granularity is good: each line performs one distinct action, especially in delete(). Reading flow is natural: imports, class attributes, constructor, method. Minor drawbacks: the comment is sparse and the use of the name 'client' for params is confusing. Overall, very readable and maintainable.
Run 2
The code is generally readable but has several clarity issues. The class structure and imports are logical, but variable naming is ambiguous: 'data' stores SQL fragments, 'client' stores parameters, and 'localKey'/'finalScore' are unused parameters whose purpose is unclear. The delete() method is concise with flat nesting, but it performs multiple actions on one line (list comprehension, string formatting, join, and tuple conversion), which hurts readability. The method name 'delete' is misleading since it actually builds a WHERE clause. The 'step' variable name doesn't convey its meaning. The string formatting using '(%s)' is simple but the overall intent could be clearer with better naming and perhaps splitting the return statement into more explicit steps. The unused parameters suggest either dead code or incomplete implementation, which adds to the ambiguity.
Run 3
The code has several readability issues. The class name 'ExtraWhere' is vague about its purpose, and the constructor parameters ('data' and 'client') are misleadingly named - 'data' is actually SQL strings while 'client' holds parameters. The method signature 'delete(localKey=None, finalScore=None)' contains unused parameters, creating ambiguity about intended usage. Variable names like 'step' don't convey meaning (it contains parenthesized SQL fragments). The core logic - building a WHERE clause with AND joins - is straightforward but obscured by poor naming. The imports are unused within this snippet and add noise. The method name 'delete' is misleading since the method builds expressions rather than performing deletion. Action granularity is acceptable (one action per line), and nesting is minimal, but the reading flow is disrupted by unclear naming and unused code. This code would require multiple reads to understand what it actually does: constructs SQL conditions with parameters.
Run 1
Code Structure: Imports and a small class are logically organized, though many imports are unused. Nesting: Methods are flat, with only a simple comprehension. Clarity of intent: SQL fragment combination is understandable, but names such as delete, data, client, and step obscure the purpose; unused localKey and finalScore parameters add confusion. Code length: The implementation is concise, but unnecessary imports and parameters create clutter. Action granularity: Most lines perform one action; the return combines SQL construction and parameter normalization, which remains manageable. Reading flow: Initialization followed by SQL assembly reads naturally, although misleading naming and unrelated imports interrupt comprehension.
Run 2
Code Structure: The small class is logically organized, but numerous unused imports add clutter. Nesting: The code is flat, with no deeply nested control flow. Clarity of intent: The SQL conjunction is understandable, but names such as delete, data, client, and step obscure the method's actual purpose; unused parameters localKey and finalScore are misleading. Code length: The implementation is concise, though imports and unused parameters unnecessarily increase its size. Action granularity: Most lines perform one clear action; the return statement combines joining SQL fragments and normalizing parameters but remains manageable. Reading flow: Initialization followed by SQL assembly is natural, although inconsistent naming conventions and unrelated imports interrupt comprehension.
Run 3
Code Structure: The small class cleanly separates attributes, initialization, and SQL generation, but numerous unused imports add clutter. Nesting: There is no deep nesting; the single list comprehension is easy to follow. Clarity of intent: SQL fragment combination is understandable, but delete misleadingly names a SQL-rendering method, while data, client, and step are vague. Unused localKey and finalScore parameters further obscure the interface. Code length: The implementation is concise, though unnecessary imports and parameters reduce economy. Action granularity: Each statement performs a focused operation; the return line combines joining fragments and converting parameters, but remains manageable. Reading flow: Execution proceeds naturally from stored inputs to formatted SQL and parameters, although misleading names and irrelevant imports interrupt comprehension.