Sample
int-d9d4cbdab0a1-I02
Shorten method, parameter, and local names without collisions
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.746 | 0–1; higher is more readable |
| Dorn | 0.388 | 0–1; higher is more readable |
| Mi | 0.437 | 0–1; higher is more readable |
| LLOC | 30 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 9.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 14 | 0–20; mean of three runs |
| BTTF | 0.382 | 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. | 2209.767 | −72.922 |
| Source linesThe number of non-empty source lines. | 110 | +44 |
| 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.5 | −6.75 |
Intercept 8.87 + feature contributions = -26.802 (log-odds).
Score = sigmoid(-26.802) = 0.
| Score | 0.746 |
|---|
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. | 110 | −2.858 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 66 | +1.546 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 109.861 | +1.126 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 65 | −1.071 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 99.964 | +0.808 |
| 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. | 99.991 | −0.57 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.046 | +0.492 |
Intercept 0.07 + feature contributions = -0.457 (log-odds).
Score = sigmoid(-0.457) = 0.388.
| Score | 0.437 |
|---|
| Score | 30 |
|---|
Run 1
The code suffers from poor naming and unclear intent, significantly hurting readability. Variables like 'off', 'is', 'so', 'off2', and 'cur' are cryptic and give no indication of their purpose, violating the 'clarity of intent' criterion. This forces the reader to constantly refer back to comments or method signatures. The 'find' method contains convoluted logic: the early return condition inside the loop makes the loop's purpose and the method's final result confusing. The comment explains a 'contiguous prefix' concept, but the code logic does not clearly mirror that explanation, making the relationship ambiguous. Furthermore, the 'update' method performs multiple actions (setting the minimum, putting the offset, calling find, conditionally removing) without clear transitional logic, and the sequence feels disorganized. While the file has logical package/import structure and basic Javadocs, the poor naming, ambiguous conditionals, and multi-purpose methods greatly reduce readability.
Run 2
The code has a clear class purpose and some helpful comments, but readability suffers from several issues. Naming is inconsistent and vague: parameters like 'off', 'is', 'so', 'off2', and method 'find'/'cur' obscure intent. The update method performs multiple actions (setting offsets, calculating redundancy, handling deletion) in a non-logical order, and the deletion check occurs after offset insertion, which can be confusing. The find method contains misleading logic: it iterates over all values but returns early if 'so' equals lastRedundantOffset, making the loop partially redundant. Comments are verbose yet do not clarify the algorithm's core logic. The method 'last' intermixes validity checks with retrieval. Overall, the code is functional but requires careful reading to understand the offset-tracking algorithm, indicating poor action granularity and clarity of intent.
Run 3
The code has a clear class-level purpose and reasonable structure, but its readability is undermined by several issues. Conciseness is a point of concern — method and parameter names like 'update', 'off', 'is', 'find', and 'cur' are too abbreviated, creating ambiguity about intent. The comments are sometimes helpful in explaining behavior but also include an odd inline example that adds visual noise. The 'find' method has confusing naming (using 'so' and 'off2') and is not easy to follow. The sequence of operations in 'update' is somewhat non-intuitive — setting offsets before checking and removing deleted keys makes the logic harder to grasp. Nesting is not deep, but action granularity is mixed, with some lines doing multiple actions. Overall, the code is understandable if the reader works through it, but it does not flow naturally and would benefit from clearer naming and cleaner method decomposition.
Run 1
Code Structure: Well organized into initialization, updates, minimum-offset calculation, queries, and test access. Nesting: Shallow, with early returns and only a loop containing one conditional. Clarity of intent: Class documentation and descriptive field names explain the overall purpose, but names such as off, is, so, off2, find, last, and cur obscure local intent. Javadoc parameter names do not match the update signature, and comments reference updateState and soFar rather than actual identifiers. Code length: Implementation is reasonably concise, though lengthy comments repeat concepts and interrupt scanning. Action granularity: Generally one action per line, with straightforward assignments and calls. Reading flow: Method sequencing and control flow are natural, but calculating the minimum before removing a deleted key requires careful interpretation, and inconsistent terminology around redundant versus necessary offsets adds ambiguity.
Run 2
Code Structure: Fields, initialization, updates, minimum calculation, and accessors are logically separated into small methods. Nesting: Shallow control flow, with only an if inside a loop, makes navigation easy. Clarity of intent: Class documentation and descriptive field names explain the overall purpose, but names such as find, last, cur, off, is, so, and off2 obscure specific roles. Documentation references parameter names and identifiers that do not match the implementation, further reducing clarity. Code length: Executable code is concise, although lengthy, sometimes repetitive comments interrupt readability. Action granularity: Statements generally perform one action per line, with no compressed multi-statement lines. Reading flow: The method order and early returns support natural reading, but understanding why the minimum is calculated before deletion requires extra attention, and terminology around redundant versus necessary offsets is somewhat confusing.
Run 3
Code Structure: Cohesive class with clearly separated initialization, updates, minimum-offset calculation, and accessors. Nesting: Shallow conditionals and a single loop make control flow easy to follow. Clarity of intent: Descriptive field names and explanatory comments help, but names such as find, last, cur, off, is, so, and off2 obscure purpose. Javadoc parameter names do not match the actual signature, and comments reference nonexistent names such as updateState and soFar. Code length: Methods are concise, although some comments are lengthy or repetitive. Action granularity: Each statement generally performs one action, with no crowded multi-statement lines. Reading flow: The overall sequence is natural, but inconsistent terminology around redundant versus necessary offsets and the deletion occurring after minimum calculation require extra thought.