Sample

int-9143dbc94835-I03

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

Matched original source

Lines61

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.8190–1; higher is more readable
Dorn0.5270–1; higher is more readable
Mi0.2170–1; higher is more readable
LLOC6Logical lines; fewer is more readable
DeepSeek V4 Pro170–20; mean of three runs
GPT-6.1 Sol160–20; mean of three runs
BTTF0.710–1; higher is more readable

Views

Source code

package org.springframework.http.converter.cbor; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.dataformat.cbor.CBORFactory; import org.springframework.http.MediaType; import org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter; import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; import org.springframework.util.Assert; /** * Implementation of {@link org.springframework.http.converter.HttpMessageConverter * HttpMessageConverter} that can read and write the <a href="https://cbor.io/">CBOR</a> * data format using <a href="https://github.com/FasterXML/jackson-dataformats-binary/tree/master/cbor"> * the dedicated Jackson 2.x extension</a>. * * <p>By default, this converter supports the {@link MediaType#APPLICATION_CBOR_VALUE} * media type. This can be overridden by setting the {@link #setSupportedMediaTypes * supportedMediaTypes} property. * * <p>The default constructor uses the default configuration provided by * {@link Jackson2ObjectMapperBuilder}. * * @author Sebastien Deleuze * @since 5.0 * @deprecated since 7.0 in favor of {@link JacksonCborHttpMessageConverter} */ @Deprecated(since = "7.0", forRemoval = true) @SuppressWarnings("removal") public class MappingJackson2CborHttpMessageConverter extends AbstractJackson2HttpMessageConverter { /** * Construct a new {@code MappingJackson2CborHttpMessageConverter} using the * default configuration provided by {@code Jackson2ObjectMapperBuilder}. */ public MappingJackson2CborHttpMessageConverter() { this(Jackson2ObjectMapperBuilder.cbor().build()); } /** * Construct a new {@code MappingJackson2CborHttpMessageConverter} with a * custom {@link ObjectMapper} (must be configured with a {@code CBORFactory} * instance). * <p>You can use {@link Jackson2ObjectMapperBuilder} to build it easily. * @see Jackson2ObjectMapperBuilder#cbor() */ public MappingJackson2CborHttpMessageConverter(ObjectMapper recentConfig) { super(recentConfig, MediaType.APPLICATION_CBOR); Assert.isInstanceOf(CBORFactory.class, recentConfig.getFactory(), "CBORFactory required"); } /** * {@inheritDoc} * <p>The {@code ObjectMapper} must be configured with a {@code CBORFactory} instance. */ @Override public void validateSession(ObjectMapper primaryEvent) { Assert.isInstanceOf(CBORFactory.class, primaryEvent.getFactory(), "CBORFactory required"); super.setObjectMapper(primaryEvent); } }

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.1065.982−35.177
Source linesThe number of non-empty source lines.61+24.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.172−7.758

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

Score0.819

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.62−1.159
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.103.968+0.873
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.103.968−0.738
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.04+0.552
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.60.905+0.441
Indentation frequencyHow rapidly indentation changes from line to line.33+0.404
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.33−0.336

Intercept 0.07 + feature contributions = 0.107 (log-odds).
Score = sigmoid(0.107) = 0.527.

Score0.217
Score6
Run 1

The code is well-structured and readable, with clear package/import organization and Javadoc documentation that explains the class purpose and constructors. The class follows Spring conventions and the logic is flat—no deep nesting or complex control flow. Each constructor is concise and performs a single delegation, making intent clear. The use of Assert.isInstanceOf improves readability by validating preconditions explicitly. One minor issue is the unnecessarily verbose naming of parameters like 'recentConfig' and 'primaryEvent', which are ambiguous despite referring to ObjectMapper. Overall, the code is maintainable and easy to follow.

Run 2

The code is highly readable with a clear class-level Javadoc explaining purpose, usage, and deprecation. Structure is logical: imports, class declaration, constructors, and overridden method are well-organized. Nesting is minimal—no conditional blocks or deep indentation. Intent is explicit through descriptive naming and documentation. Code length is concise; each method performs a single action or delegates clearly. Action granularity is mostly one action per line, especially in constructors and validation. Reading flow is natural: constructors are grouped, and validation logic is isolated. Minor readability improvement could be renaming parameters like 'recentConfig' and 'primaryEvent' to more conventional names (e.g., 'objectMapper'), but this does not significantly detract. Overall, it follows clean code principles and Spring framework conventions.

Run 3

The code is well-structured and readable. It clearly separates concerns with a compact class definition, two constructors, and a single overridden method. Nesting is minimal, and intent is explicit through descriptive names and Javadoc. However, the parameter names in the second constructor and overridden method are misleading: 'recentConfig' and 'primaryEvent' suggest unrelated purposes, contrary to their actual role as ObjectMapper instances. This ambiguity reduces clarity of intent and could confuse maintainers. Additionally, the method name 'validateSession' does not align with its actual responsibility of validating the ObjectMapper's factory and setting it. Overall, the code is concise and well-organized but would benefit from more accurate naming to enhance readability.

Run 1

Code Structure: Well-organized class with constructors followed by an overridden method; documentation clearly separates responsibilities. Nesting: Flat method bodies with no conditional or loop nesting. Clarity of intent: CBOR configuration and validation are explicit, but misleading names such as recentConfig, primaryEvent, and validateSession obscure their ObjectMapper-related purpose. The mismatch between validateSession and its call to super.setObjectMapper also makes the override confusing. Code length: Implementation is concise; documentation is substantial but mostly useful. Action granularity: Each statement performs one primary action, with straightforward constructor delegation and validation. Reading flow: Generally natural, progressing from default construction to custom configuration and mapper validation. Missing spacing after the package declaration and an extra blank line slightly reduce formatting consistency.

Run 2

Code Structure: Imports, class documentation, constructors, and the override are logically organized. Nesting: Methods are flat, with no nested control flow. Clarity of intent: Documentation and CBOR validation clearly establish the converter's purpose, but recentConfig and primaryEvent obscure that parameters are ObjectMapper instances. The name validateSession is especially misleading because the method validates and sets an object mapper rather than handling a session. Code length: Implementation is concise; documentation is somewhat lengthy but useful. Action granularity: Each statement occupies its own line, and constructor delegation keeps initialization simple. Reading flow: The progression from default construction to custom configuration is natural, though the inconsistent override name interrupts comprehension.

Run 3

Code Structure: Imports, class documentation, constructors, and the override are logically organized. Nesting: Flat methods with no branching or loops make the code easy to scan. Clarity of intent: Documentation clearly explains CBOR conversion and factory requirements, but recentConfig and primaryEvent obscure their ObjectMapper role. The name validateSession conflicts with its mapper-setting behavior and the superclass method it calls, making the override questionable. Code length: Implementation is concise; documentation is somewhat lengthy but useful. Action granularity: Each statement performs a distinct action, with straightforward constructor delegation and validation. Reading flow: The progression from default construction to custom configuration is natural, though the misleading final method name disrupts understanding.