Sample

int-7a9c20be142a-I01

Remove line comments, block comments, and Javadoc

Matched original source

Lines72

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.8370–1; higher is more readable
Dorn0.1340–1; higher is more readable
Mi0.4370–1; higher is more readable
LLOC24Logical lines; fewer is more readable
DeepSeek V4 Pro17.330–20; mean of three runs
GPT-6.1 Sol170–20; mean of three runs
BTTF0.6950–1; higher is more readable

Views

Source code

package io.netty.handler.ssl; import io.netty.util.AbstractReferenceCounted; import io.netty.util.IllegalReferenceCountException; final class NonOwnedOpenSslCredential extends AbstractReferenceCounted implements OpenSslCredentialPointer { private final long credential; private final CredentialType type; private volatile boolean released; NonOwnedOpenSslCredential(long credential, CredentialType type) { if (credential == 0) { throw new IllegalArgumentException("credential pointer must not be 0"); } this.credential = credential; this.type = type; } @Override public long credentialAddress() { if (released) { throw new IllegalReferenceCountException(); } return credential; } @Override public CredentialType type() { return type; } @Override public OpenSslCredential retain() { return (OpenSslCredential) super.retain(); } @Override public OpenSslCredential retain(int increment) { return (OpenSslCredential) super.retain(increment); } @Override public OpenSslCredential touch() { return (OpenSslCredential) super.touch(); } @Override public OpenSslCredential touch(Object hint) { return this; } @Override protected void deallocate() { released = true; } }

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(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.1179.397−38.92
Source linesThe number of non-empty source lines.72+28.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.372−6.558

Intercept 8.87 + feature contributions = -7.808 (log-odds).
Score = sigmoid(-7.808) = 0.

Score0.837

Feature contributions

FeatureValueContribution
(log-odds)
Indentation frequencyHow rapidly indentation changes from line to line.72+1.753
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.73−1.548
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.72−1.231
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.107.986−0.909
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.71.917+0.595
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.076+0.206

Intercept 0.07 + feature contributions = -1.868 (log-odds).
Score = sigmoid(-1.868) = 0.134.

Score0.437
Score24
Run 1

The code is highly readable with a clean, logical structure. The class has a single responsibility and follows standard Netty patterns. Nesting is minimal—only a single conditional check in the constructor and one in credentialAddress(), both flat and clear. Intent is explicit: managing a non-owned OpenSSL credential with proper reference counting. Code length is concise without being cryptic; each method is short and focused. Action granularity is good, with one logical operation per statement. The reading flow is natural, progressing from field declarations to constructor to accessors to overridden lifecycle methods. Minor points: the touch(Object hint) method ignoring the hint is slightly surprising, and the released flag being checked before returning the credential provides reasonable safety. Overall, this is exemplary, idiomatic Java code.

Run 2

The code is well-structured with clear class-level organization. It maintains flat nesting with only one conditional block. The purpose of each method is evident, though the 'touch(Object hint)' method returns 'this' without calling super, which may be slightly ambiguous. Code length is concise and appropriate. Each method performs a single action. The reading flow is natural. Minor deductions: excessive blank lines in the imports/package section, redundant validation could be argued, and the 'touch(Object hint)' override could be documented for clarity.

Run 3

The code demonstrates clear structure with a single class implementing an interface and extending a base class. Nesting is minimal, with only one conditional check in the constructor and credentialAddress() method. Intent is evident - managing a non-owned OpenSSL credential with reference counting. The code is concise, avoiding unnecessary methods or excessive comments. Each line performs a single logical action, particularly in retain/touch methods that cleanly delegate to super. Reading flow is natural: fields, constructor, then overridden methods in logical order. Minor deductions include large blank gaps between imports and class declaration, and redundant @Override on touch(Object) that just returns 'this' without calling super, which is slightly inconsistent with the other delegation methods. The empty deallocate() body simply setting a boolean is acceptable but could be marginally clearer.

Run 1

Code Structure: Fields, constructor, accessors, reference-counting methods, and deallocation are logically organized. Nesting: Minimal, with only simple validation guards. Clarity of intent: Descriptive names make pointer access and release tracking understandable, although the non-owning lifecycle and casts to OpenSslCredential could benefit from explanation. Code length: Methods are concise, but excessive blank lines add unnecessary visual length. Action granularity: Each statement performs one clear action. Reading flow: Consistent method formatting and straightforward control flow support easy reading; irregular whitespace near the class and constructor slightly disrupts it.

Run 2

Code Structure: Fields, constructor, accessors, and reference-counting overrides are logically organized. Nesting: Only simple, single-level validation checks appear, keeping control flow easy to follow. Clarity of intent: Descriptive names and straightforward methods communicate the credential wrapper's purpose, though ownership semantics and the no-op touch(Object) method lack explanation. Code length: The implementation is concise, but excessive blank lines add unnecessary visual length; repetitive overrides are understandable interface boilerplate. Action granularity: Each statement performs one clear action, with no compressed multi-action lines. Reading flow: Method ordering and consistent formatting support natural reading, but large whitespace gaps near the imports and constructor interrupt the flow.

Run 3

Code Structure: Fields, constructor, accessors, reference-counting overrides, and cleanup are logically organized. Nesting: Shallow guard clauses keep control flow simple. Clarity of intent: Descriptive class, field, and method names communicate the non-owned credential wrapper's purpose, although the no-op touch behavior and release semantics lack explanation. Code length: The implementation is concise, but excessive blank lines add unnecessary visual length. Action granularity: Each statement performs one clear action, with no compressed multi-action lines. Reading flow: Conventional method ordering and consistent formatting make the code easy to follow; large whitespace gaps near the imports and constructor interrupt that flow.