Sample

int-495234eefe8f-I08

Select one of ten high-readability unrelated code templates per class

Matched original source

Lines81

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.8390–1; higher is more readable
Dorn0.4610–1; higher is more readable
Mi0.5880–1; higher is more readable
LLOC29Logical lines; fewer is more readable
DeepSeek V4 Pro60–20; mean of three runs
GPT-6.1 Sol14.330–20; mean of three runs
BTTF0.4820–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() { { int morningTemperature = 18; int eveningTemperature = 14; int lowerTemperature = morningTemperature; if (eveningTemperature < lowerTemperature) { lowerTemperature = eveningTemperature; } } 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.1381.862−45.601
Source linesThe number of non-empty source lines.81+32.4
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.55−6.825

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

Score0.839

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.82−1.867
Indentation frequencyHow rapidly indentation changes from line to line.67+1.58
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.67−1.117
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.107.988+0.938
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.927−0.906
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.80.872+0.721
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.053+0.425

Intercept 0.07 + feature contributions = -0.156 (log-odds).
Score = sigmoid(-0.156) = 0.461.

Score0.588
Score29
Run 1

The code suffers from severe structural problems. A block of unrelated temperature-variable code has been incorrectly pasted inside the retain() method, making the code uncompilable and completely breaking logical organization. This random insertion destroys the reading flow and makes the intent ambiguous. While the original class structure before the insertion appears reasonably organized with clear documentation and mostly one action per line, the unexpected nested block creates deep confusion. The code length is unnecessarily inflated, and the nesting becomes tangled due to the misplaced logic. The overall clarity is severely compromised, making the code nearly unreadable despite some good initial documentation and method separation.

Run 2

The code starts as a clear, well-documented wrapper class with logical structure and good naming conventions. However, it contains a severe flaw: a random, unrelated temperature-comparison block (lines 41-48) was inserted into the retain() method. This block has no connection to the class purpose, breaks the reading flow, adds gratuitous nesting, and creates syntactically confusing brace placement. The retain() method itself becomes ambiguous and potentially compilable but logically broken. Other methods are concise and follow one-action-per-line style, and the Javadoc is informative. Overall readability is significantly harmed by the inserted irrelevant code snippet, which contradicts the surrounding clarity and intent. Without that block, the class would score much higher (around 16-17).

Run 3

The code has clear structure with proper formatting and Javadoc, but contains a critical flaw: a random block of unrelated code (temperature variables) inserted in the middle of the retain() method. This breaks reading flow and clarity of intent. The class purpose is well-documented, naming is clear, and action granularity is mostly one action per line. Nesting is minimal (just one if-statement in the constructor). However, the stray code block makes the implementation confusing and unreadable. The methods are concise and the reference counting pattern is recognizable, but the accidental insertion undermines the entire file's readability. Without that extraneous block, the code would rate around 16-18; with it, the score drops significantly.

Run 1

Code Structure: The wrapper is logically organized into fields, construction, accessors, and lifecycle methods, but retain() contains an unrelated temperature-calculation block. Nesting: Mostly shallow; the extra block and conditional add unnecessary nesting. Clarity of intent: Descriptive names and documentation clearly explain non-owning pointer semantics, while the unused temperature calculation obscures retain()'s purpose. Code length: Generally concise, with straightforward overrides, but the unrelated block adds needless length. Action granularity: Statements mostly perform one action per line. Reading flow: Consistent method organization supports natural reading, but the poorly indented temperature block abruptly interrupts it.

Run 2

Code Structure: The wrapper is logically organized into initialization, accessors, reference-count operations, and deallocation, but unrelated temperature calculations disrupt retain(). Nesting: Most methods are flat; retain() adds an unnecessary block and conditional. Clarity of intent: Descriptive names and documentation clearly explain non-owning credential management, while the unused temperature calculation has no apparent purpose. Code length: The wrapper is reasonably concise apart from the extraneous block. Action granularity: Statements generally perform one action per line. Reading flow: Consistent method patterns are easy to follow, but the poorly indented temperature block abruptly interrupts the flow.

Run 3

Code Structure: The class is logically organized into fields, construction, accessors, and lifecycle methods, but retain() contains an unrelated temperature-calculation block. Nesting: Mostly flat, with shallow validation checks; the extra block adds unnecessary nesting. Clarity of intent: Descriptive names and documentation clearly explain non-owning credential semantics, while the unused temperature calculation obscures retain()'s purpose. Code length: Generally concise, with justified documentation and small methods, but the injected block adds needless length. Action granularity: Statements generally perform one action per line. Reading flow: Method ordering and consistent patterns support natural reading, but the temperature block's inconsistent indentation and irrelevant logic abruptly interrupt that flow.