Sample

int-eff6ee2ca06f-SRC

Unmodified source class

Lines72

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.8580–1; higher is more readable
Dorn0.4880–1; higher is more readable
Mi0.5830–1; higher is more readable
LLOC24Logical lines; fewer is more readable
DeepSeek V4 Pro18.330–20; mean of three runs
GPT-6.1 Sol190–20; mean of three runs
BTTF0.7380–1; higher is more readable

Views

Source code

package io.netty.handler.ssl; import io.netty.util.AbstractReferenceCounted; import io.netty.util.IllegalReferenceCountException; /** * A non-owning wrapper for an {@link OpenSslCredential} pointer. * * <p>This class is used when we need to expose an SSL_CREDENTIAL pointer that is managed * by OpenSSL itself (e.g., the credential selected during the handshake). Unlike * {@link DefaultOpenSslCredential}, this wrapper does not free the underlying credential * when its reference count reaches zero, as the lifetime is managed externally. * * <p>This is a BoringSSL-specific feature. */ final class NonOwnedOpenSslCredential extends AbstractReferenceCounted implements OpenSslCredentialPointer { private final long credential; private final CredentialType type; private volatile boolean released; /** * Creates a new non-owning credential wrapper. * * @param credential the native SSL_CREDENTIAL pointer (must not be 0) * @param type the credential type */ 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.53−6.795

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

Score0.858

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.73−1.548
Indentation frequencyHow rapidly indentation changes from line to line.58+1.269
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.107.973+0.938
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.58−0.91
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
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.051+0.447

Intercept 0.07 + feature contributions = -0.048 (log-odds).
Score = sigmoid(-0.048) = 0.488.

Score0.583
Score24
Run 1

The code is well-structured with clear class purpose and comprehensive documentation. It follows a logical organization with fields, constructor, and methods in a natural order. Nesting is minimal with only one if-statement in the constructor and credentialAddress method. Intent is clearly stated through the class Javadoc and method naming. The code is concise, with no redundant logic or unnecessary verbosity. Each line performs a single action, maintaining good action granularity. Reading flow is natural as methods are grouped logically with override implementations following a consistent pattern. The only minor deductions are for the touch(Object hint) method which returns 'this' instead of delegating to super, which could be slightly confusing without documentation, and the lack of a null check on the type parameter. Overall, this is highly readable and maintainable code.

Run 2

The code is highly readable. It follows a clear class structure with a specific purpose and well-defined methods. Nesting is minimal, with only a simple null check creating a single level. The intent is immediately clear from the class name, Javadoc, and method implementations. The length is appropriate, covering all necessary operations without being verbose. Each method performs a single logical action, and the reading flow is natural, starting with the constructor and moving through the implemented interface methods. The use of empty line separation between methods and the consistent formatting contribute to the overall clarity. The only minor deduction is due to the repeated 'return (OpenSslCredential) super.retain()' pattern, which is necessary for the fluent API but adds slight noise.

Run 3

The code is highly readable with clear structure and purpose. It follows a logical organization: imports, Javadoc, class declaration, fields, constructor, and overridden methods. The Javadoc comments effectively explain the non-owning nature and BoringSSL-specific use case. Nesting is minimal—only a single conditional check in the constructor. Each method has a single, clear responsibility, and actions are appropriately granular with one operation per line. Variable and method names are descriptive (credential, type, released, credentialAddress), making intent obvious without ambiguity. The code is concise without unnecessary verbosity, and the reading flow is natural, moving from construction to accessors to reference-counting overrides and cleanup. Minor improvements could include a brief comment explaining the volatile keyword, but overall readability is excellent.

Run 1

Code Structure: Fields, constructor, accessors, reference-counting overrides, and deallocation are logically organized. Nesting: Only simple guard clauses are used, keeping nesting minimal. Clarity of intent: Descriptive names and focused documentation clearly explain non-ownership and externally managed lifetime; the no-op touch(Object hint) is slightly less explicit. Code length: The implementation is concise, with necessary interface overrides and little unnecessary code. Action granularity: Each statement performs a single action, and validation is separated from initialization. Reading flow: Consistent formatting and straightforward method ordering make the class easy to follow, though a blank line between the package declaration and imports would improve visual separation.

Run 2

Code Structure: Fields, constructor, accessors, reference-counting methods, and deallocation are logically organized. Nesting: Only simple, single-level guards appear. Clarity of intent: Descriptive names and documentation clearly explain the non-owning wrapper and externally managed pointer lifetime; the inherited reference-counting behavior requires some framework familiarity. Code length: Compact methods and relevant documentation avoid unnecessary length, with minor repetition in required overrides. Action granularity: Each statement performs one clear action. Reading flow: Consistent formatting and predictable method ordering make the class easy to follow, although spacing between the package and imports would slightly improve presentation.

Run 3

Code Structure: Fields, constructor, accessors, and lifecycle overrides are logically organized. Nesting: Only simple guard clauses appear, keeping methods flat. Clarity of intent: Descriptive names and focused documentation clearly explain non-owning behavior and externally managed lifetime; the relationship between the released flag and inherited reference counting requires slight background knowledge. Code length: Compact methods and necessary interface overrides avoid unnecessary complexity, though documentation is somewhat extensive for a small class. Action granularity: Each statement performs one clear action. Reading flow: Consistent formatting and predictable method ordering make the class easy to follow, with only minor spacing improvements possible around the package and imports.