Sample
int-320baddaeb0c-I03
Replace method, parameter, and local names with length-matched, meaningful but unrelated names
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0.002 | 0–1; higher is more readable |
| Scalabrino | 0.757 | 0–1; higher is more readable |
| Dorn | 0.832 | 0–1; higher is more readable |
| Mi | 0.536 | 0–1; higher is more readable |
| LLOC | 8 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 15.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15.67 | 0–20; mean of three runs |
| BTTF | 0.735 | 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. | 637.055 | −21.023 |
| Source linesThe number of non-empty source lines. | 33 | +13.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.753 | −7.13 |
Intercept 8.87 + feature contributions = -6.083 (log-odds).
Score = sigmoid(-6.083) = 0.002.
| Score | 0.757 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| 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. | 75.971 | +0.447 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 73.882 | +0.388 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.064 | +0.323 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 34 | −0.167 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 24 | +0.093 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 32.818 | +0.049 |
Intercept 0.07 + feature contributions = 1.6 (log-odds).
Score = sigmoid(1.6) = 0.832.
| Score | 0.536 |
|---|
| Score | 8 |
|---|
Run 1
The class has a clear purpose and is logically structured as a simple value object for a SOCKS init response. Nesting is negligible since there are no conditional or loop structures. Each operation is typically on its own line, and overall length is concise. However, clarity of intent is undermined by misleading naming: the constructor parameter 'localBatch' and method 'fetchIndex' do not accurately convey their actual roles (auth scheme retrieval). Additionally, the parameter name 'channel' in validateMessage (which should probably be 'byteBuf' or 'out') creates confusion. The reading flow is straightforward, but these naming inconsistencies reduce readability.
Run 2
The code is well-structured with a logical class hierarchy, minimal nesting, and clear intent due to Javadoc comments and descriptive type names. However, readability is undermined by poor naming choices: the constructor parameter 'localBatch' is unrelated to an auth scheme, the method 'fetchIndex' obscures its purpose instead of using a conventional getter like 'authScheme()', and the parameter 'channel' in validateMessage misrepresents the ByteBuf, which is a buffer, not a channel. These misleading names introduce ambiguity. The code is concise and follows one action per line, but the natural reading flow is disrupted by the parameter and method name mismatches. Overall, the structure and formatting are strong, but inconsistent naming prevents a higher score.
Run 3
The code is well-structured with clear class definition, single responsibility, and flat nesting. It uses proper encapsulation and validation via ObjectUtil.checkNotNull. However, readability is reduced by misleading naming: parameters/methods like 'localBatch', 'fetchIndex', and 'channel' don't accurately reflect their purpose (authScheme, getter, byte buffer). The class has one action per line in validateMessage, which is good. Overall, the logic is simple and concise but naming inconsistencies make the intent less clear than it should be.
Run 1
Code Structure: Logically organized into a field, constructor, accessor, and serialization method. Nesting: Flat and easy to follow, with no nested control flow. Clarity of intent: The class and authScheme field are clear, but localBatch is a misleading constructor parameter name, fetchIndex does not describe returning an authentication scheme, and validateMessage suggests validation rather than writing protocol bytes. Naming the ByteBuf parameter channel also obscures its role. Code length: Concise, though the accessor documentation is repetitive. Action granularity: Each statement performs a focused action; the null check within assignment is conventional and readable. Reading flow: Natural class progression and straightforward byte-writing order, but inconsistent method and parameter names interrupt comprehension.
Run 2
Code Structure: The class is logically organized into a field, constructor, accessor, and serialization method. Nesting: There is no nested control flow, making it easy to scan. Clarity of intent: Types and field names communicate the SOCKS response purpose, but localBatch, fetchIndex, validateMessage, and channel are misleading names for an authentication scheme, accessor, encoder, and output buffer. Code length: The implementation is concise, though the accessor documentation is repetitive. Action granularity: Each statement performs one clear action. Reading flow: The conventional class layout and sequential byte writes are natural, but inaccurate naming interrupts understanding. Minor formatting and the grammatical error in the class documentation slightly reduce polish.
Run 3
Code Structure: Logically organized into a field, constructor, accessor, and serialization method. Nesting: Flat, with no nested control flow. Clarity of intent: The class and authScheme field convey purpose, but localBatch, fetchIndex, validateMessage, and channel are misleading names for an authentication scheme, getter, encoding operation, and buffer. Code length: Concise, though the accessor documentation repeats itself. Action granularity: Each statement performs one main action, with straightforward null validation in the constructor. Reading flow: Natural top-to-bottom organization and simple statements make the code easy to follow, but inconsistent naming interrupts comprehension.