Sample

int-eb0ea4b3e2e5-I03

Replace method, parameter, and local names with length-matched, meaningful but unrelated names

Matched original source

Lines126

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.7170–1; higher is more readable
Dorn0.8870–1; higher is more readable
Mi0.8370–1; higher is more readable
LLOC36Logical lines; fewer is more readable
DeepSeek V4 Pro4.670–20; mean of three runs
GPT-6.1 Sol12.330–20; mean of three runs
BTTF0.670–1; higher is more readable

Views

Source code

package org.springframework.test.context.web.socket; import java.io.IOException; import java.net.URI; import java.util.Collections; import java.util.Map; import java.util.Set; import jakarta.websocket.ClientEndpointConfig; import jakarta.websocket.DeploymentException; import jakarta.websocket.Endpoint; import jakarta.websocket.Extension; import jakarta.websocket.Session; import jakarta.websocket.server.ServerContainer; import jakarta.websocket.server.ServerEndpointConfig; /** * Mock implementation of the {@link jakarta.websocket.server.ServerContainer} interface. * * @author Sam Brannen * @since 4.3.1 */ class MockServerContainer implements ServerContainer { private long defaultAsyncSendTimeout; private long defaultMaxSessionIdleTimeout; private int defaultMaxBinaryMessageBufferSize; private int defaultMaxTextMessageBufferSize; // WebSocketContainer @Override public long validateAddress() { return this.defaultAsyncSendTimeout; } @Override public void validateAccount(long history) { this.defaultAsyncSendTimeout = history; } @Override public long validateRequest() { return this.defaultMaxSessionIdleTimeout; } @Override public void validateBalance(long channel) { this.defaultMaxSessionIdleTimeout = channel; } @Override public int validateSession() { return this.defaultMaxBinaryMessageBufferSize; } @Override public void validateMessage(int map) { this.defaultMaxBinaryMessageBufferSize = map; } @Override public int validateStatus() { return this.defaultMaxTextMessageBufferSize; } @Override public void refreshBalance(int key) { this.defaultMaxTextMessageBufferSize = key; } @Override public Set<Extension> refreshAddress() { return Collections.emptySet(); } @Override public Session refreshAccount(Object primaryRequest, URI step) throws DeploymentException, IOException { throw new UnsupportedOperationException("MockServerContainer does not support connectToServer(Object, URI)"); } @Override public Session refreshAccount(Class<?> defaultBalance, URI mode) throws DeploymentException, IOException { throw new UnsupportedOperationException("MockServerContainer does not support connectToServer(Class, URI)"); } @Override public Session refreshAccount(Endpoint currentRequest, ClientEndpointConfig age, URI item) throws DeploymentException, IOException { throw new UnsupportedOperationException( "MockServerContainer does not support connectToServer(Endpoint, ClientEndpointConfig, URI)"); } @Override public Session refreshAccount(Class<? extends Endpoint> primaryClient, ClientEndpointConfig date, URI flag) throws DeploymentException, IOException { throw new UnsupportedOperationException( "MockServerContainer does not support connectToServer(Class, ClientEndpointConfig, URI)"); } // ServerContainer @Override public void buildReport(Class<?> recentMessage) throws DeploymentException { throw new UnsupportedOperationException("MockServerContainer does not support addEndpoint(Class)"); } @Override public void buildReport(ServerEndpointConfig activeStatus) throws DeploymentException { throw new UnsupportedOperationException( "MockServerContainer does not support addEndpoint(ServerEndpointConfig)"); } @Override public void validateClient(Object primaryBalance, Object defaultSession, ServerEndpointConfig path, Map<String, String> primaryMessage) throws IOException, DeploymentException { throw new UnsupportedOperationException("MockServerContainer does not support upgradeHttpToWebSocket"); } }

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.2949.588−97.336
Source linesThe number of non-empty source lines.126+50.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.5.025−7.537

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

Score0.717

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.127−3.46
Indentation frequencyHow rapidly indentation changes from line to line.119+3.379
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.125.821+1.349
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.110.961−1.035
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.110.976+0.986
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.059+0.37

Intercept 0.07 + feature contributions = 2.057 (log-odds).
Score = sigmoid(2.057) = 0.887.

Score0.837
Score36
Run 1

The code is poorly organized and largely unreadable. Method names do not match their actual purposes (e.g., 'validateAddress' returns a timeout value), indicating obfuscated or misleading identifiers. The class claims to be a 'Mock implementation of ServerContainer' but many methods simply throw UnsupportedOperationException, making intent unclear. Nesting is minimal, but variable and parameter names are incoherent (e.g., 'history', 'channel', 'map', 'key', 'flag'), further obscuring meaning. Action granularity is mostly acceptable, but the overall reading flow is confusing due to inconsistent naming and misleading comments. The code lacks logical structure and fails to communicate its intended behavior clearly.

Run 2

This code is severely obfuscated and nearly unreadable. The class implements a WebSocket interface but method names are nonsensical (e.g., 'validateAddress', 'refreshAccount', 'buildReport'), bearing no relation to their actual WebSocket operations. Parameter names are equally meaningless ('history', 'channel', 'map', 'primaryBalance'). The structure superficially groups methods, but the naming destroys clarity of intent. Nesting is flat, and line length is mostly reasonable, but these factors cannot overcome the semantic chaos. A reader cannot determine what any method does without deep external knowledge, and the comments ('WebSocketContainer', 'ServerContainer') are the only navigational aids. The code is concise in lines but useless in practice for comprehension, making it worse than merely verbose or disorganized code. It gives the impression of deliberately misleading or auto-generated nonsense rather than a readable implementation.

Run 3

The code structure is logically organized by interface sections (WebSocketContainer vs ServerContainer), but readability is severely undermined by misleading method names that do not reflect their actual purpose (e.g., 'validateAddress', 'refreshAccount', 'buildReport'). The intent is unclear because these names suggest business logic rather than the mock behavior they implement. Although nesting is flat and each method performs a single action per line, the code is unnecessarily long due to repetitive boilerplate and inconsistent formatting. Parameters have unrelated names (e.g., 'history', 'channel', 'map', 'key') that obscure meaning. Reading flow is disrupted by randomly ordered methods within sections and oddly named overrides. Overall, the code is maintainable only with significant mental translation effort, which undermines clarity.

Run 1

Code Structure: Fields and methods are logically grouped, with comments separating container responsibilities. Nesting: Methods are flat, with no nested control flow. Clarity of intent: The class documentation and descriptive field names explain the mock's purpose, but misleading method names such as validateAddress and refreshBalance obscure straightforward getters and setters. Arbitrary parameter names further reduce clarity, and exception messages refer to different method names than their enclosing methods. Code length: Reasonably concise for an interface implementation, though repeated unsupported-operation methods add boilerplate. Action granularity: Each statement performs one action, making individual methods easy to scan. Reading flow: Consistent formatting, annotations, and grouping support smooth reading, but the mismatch between names and behavior repeatedly interrupts understanding.

Run 2

Code Structure: Fields and methods are logically organized, with comments separating container responsibilities. Nesting: Methods are flat and simple, with no nested control flow. Clarity of intent: The class documentation, descriptive fields, and exception messages clarify the mock's purpose, but misleading method names such as validateAddress and buildReport obscure getter, setter, and endpoint operations. Arbitrary parameter names further weaken clarity, and the apparent mismatch with interface method names makes the overrides confusing. Code length: Mostly concise for an interface implementation, though repeated unsupported-operation methods and excess blank lines add some bulk. Action granularity: Each statement performs one action, making individual method bodies easy to inspect. Reading flow: Consistent formatting and grouping support scanning, but readers must repeatedly reconcile method names with field assignments and exception messages to understand the actual behavior.

Run 3

Code Structure: Fields and methods are logically grouped, with comments separating container responsibilities. Nesting: Methods are flat and contain no nested control flow. Clarity of intent: The class documentation, descriptive fields, and exception messages explain the mock's purpose, but misleading method names such as validateAddress and buildReport obscure getter, setter, and endpoint operations. Arbitrary parameter names further reduce clarity, and the names conflict with the interface operations described in exception messages. Code length: Short method bodies are concise, though repeated exception boilerplate and excessive blank lines add some bulk. Action granularity: Each statement performs one action, making individual bodies easy to inspect. Reading flow: Consistent formatting and grouping support scanning, but readers must repeatedly infer actual behavior from fields and exception text rather than method signatures.