Sample

int-3cc7449ae349-I05

Rewrite eligible decimal integer literals in hexadecimal notation

Matched original source

Lines72

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.8610–1; higher is more readable
Dorn0.4880–1; higher is more readable
Mi0.5570–1; higher is more readable
LLOC24Logical lines; fewer is more readable
DeepSeek V4 Pro180–20; mean of three runs
GPT-6.1 Sol190–20; mean of three runs
BTTF0.5470–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 == 0x0) { 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.1190.508−39.287
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.534−6.801

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

Score0.861

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.89+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.557
Score24
Run 1

The code is well-structured with a single class and a clear, focused purpose. It uses flat nesting, minimal branching, and short methods. Intent is explicit through naming and documentation, and each operation is granular with one logical action per line. The reading flow is natural, moving from fields to constructor to overridden methods. The only minor downside is the slight verbosity of the Javadoc and the redundant retain/touch overrides, but these are acceptable given the API requirements.

Run 2

The code demonstrates strong readability. Structure is logical, with clear field declarations, a single well-documented constructor, and cohesive methods. Nesting is minimal—only one level in the constructor and credentialAddress. Intent is explicit through Javadoc and method names. Length is concise, with no unnecessary code. Action granularity is one action per line for most operations. Reading flow proceeds naturally from fields to construction to accessors and lifecycle methods. The only minor deductions are the repetitive retain/touch overrides (necessary for type covariance but slightly noisy) and the explicit '0x0' check which could be a named constant.

Run 3

This code is highly readable. The class has a clear, single responsibility and logical structure with fields, constructor, and methods in a natural order. Nesting is minimal—one simple validation check in the constructor and one in credentialAddress(). Intent is well documented through class-level Javadoc and a precise class name ('NonOwnedOpenSslCredential'). The code is concise; each method performs one action or returns one value. Action granularity is appropriate, with each semantic step on its own line. Reading flow is smooth: package/imports, Javadoc, fields, constructor, then methods grouped by interface implementation. Minor areas for improvement might include adding Javadoc for deallocate() or credentialAddress(), but overall clarity is excellent for a low-level wrapper class.

Run 1

Code Structure: Fields, constructor, accessors, reference-counting overrides, and cleanup are logically organized. Nesting: Only simple guard clauses are used, keeping the code flat. Clarity of intent: Descriptive names and focused documentation clearly explain non-owning behavior and externally managed lifetime. Code length: The class is concise; repetitive overrides are justified by covariant return types. Action granularity: Each statement performs a single action, with no compressed multi-operation lines. Reading flow: Methods are short and follow a natural progression. Minor readability limitations include cramped package/import spacing and the unexplained distinction between touch() delegating to the superclass and touch(Object) returning this directly.

Run 2

Code Structure: Logically organized into fields, construction, accessors, reference-count operations, and deallocation. Nesting: Minimal, with simple guard clauses and no deeply nested logic. Clarity of intent: Descriptive names and documentation clearly explain non-owning pointer semantics and externally managed lifetime; the no-op touch(Object hint) could benefit from a brief explanation. Code length: Concise overall, with small methods and reasonable boilerplate for interface overrides. Action granularity: Each statement performs one clear action, without compressed or compound operations. Reading flow: Natural progression from initialization to access and lifecycle management, supported by consistent formatting. Minor spacing improvements around the package and imports would further polish readability.

Run 3

Code Structure: Fields, constructor, accessors, reference-count methods, and deallocation are logically organized. Nesting: Only simple, single-level validation checks appear. Clarity of intent: Descriptive names and documentation clearly explain the non-owning wrapper and externally managed lifetime; the relationship between the released flag and inherited reference counting is slightly implicit. Code length: The implementation is concise, with reasonable documentation and necessary override boilerplate. Action granularity: Each statement performs one action, making behavior easy to follow. Reading flow: Methods follow a natural progression from initialization to access and lifecycle management. Minor formatting improvements, such as separating the package declaration from imports, would further improve readability.