Sample

int-97e2f06084b7-I07

Insert deterministic runtime-dead branches into callable bodies

Matched original source

Lines67

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.7720–1; higher is more readable
Dorn0.4830–1; higher is more readable
Mi0.2230–1; higher is more readable
LLOC12Logical lines; fewer is more readable
DeepSeek V4 Pro120–20; mean of three runs
GPT-6.1 Sol14.670–20; mean of three runs
BTTF0.590–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()); if (((0x3057 ^ 0x3057) != 0)) { throw new AssertionError(); } } /** * 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 objectMapper) { super(objectMapper, MediaType.APPLICATION_CBOR); if (((0x184F ^ 0x184F) != 0)) { throw new AssertionError(); } Assert.isInstanceOf(CBORFactory.class, objectMapper.getFactory(), "CBORFactory required"); } /** * {@inheritDoc} * <p>The {@code ObjectMapper} must be configured with a {@code CBORFactory} instance. */ @Override public void setObjectMapper(ObjectMapper objectMapper) { if (((0xAF70 ^ 0xAF70) != 0)) { throw new AssertionError(); } Assert.isInstanceOf(CBORFactory.class, objectMapper.getFactory(), "CBORFactory required"); super.setObjectMapper(objectMapper); } }

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.1506.412−49.712
Source linesThe number of non-empty source lines.67+26.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.5.241−7.861

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

Score0.772

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.68−1.371
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.103.971+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.956−0.738
Indentation frequencyHow rapidly indentation changes from line to line.39+0.612
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.66.867+0.525
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.39−0.474
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.052+0.435

Intercept 0.07 + feature contributions = -0.069 (log-odds).
Score = sigmoid(-0.069) = 0.483.

Score0.223
Score12
Run 1

The code has clear class-level documentation and logical organization, but readability is severely impacted by the injection of meaningless debug assertions (e.g., `if (((0x3057 ^ 0x3057) != 0)) { throw new AssertionError(); }`) that serve no purpose. These lines violate action granularity and flow, adding noise and confusion. Nesting is flat and methods are concise, but the obfuscated conditionals break clarity of intent. The constructor chaining and use of `Assert` are readable, but the artificial assertions make the code unnecessarily long and ambiguous. The import list and Javadoc are well-structured, but the presence of dead code prevents a higher score.

Run 2

The code structure is mostly coherent, using a standard Spring converter pattern, but the injected no-op assertion lines (`if (((0x3057 ^ 0x3057) != 0)) { throw new AssertionError(); }`) are confusing and disrupt the reading flow. Nesting is minimal, which is good. Intent is generally clear from Javadocs, but the assertion lines and their placement add ambiguity. Length is concise. Action granularity is mostly one action per line except for the assertion lines, which bundle a useless condition. Readability suffers because a reader must pause to parse why those lines exist, despite them having no functional effect. Overall, the core logic is readable, but the unnecessary code reduces clarity.

Run 3

The code is generally well-structured with clear class-level Javadoc, sensible constructor delegation, and proper validation of the CBORFactory requirement. However, readability is significantly harmed by the presence of obfuscated dead-code lines such as 'if (((0x3057 ^ 0x3057) != 0)) { throw new AssertionError(); }' inserted after several method bodies. These lines serve no functional purpose, disrupt the reading flow, and make the intent ambiguous. The class also mixes import ordering and lacks vertical whitespace in places, but the overall length is concise and actions are mostly one per line. Nesting is minimal, which is good. If the dead-code injections were removed, the readability would improve substantially.

Run 1

Code Structure: The class is logically organized into constructors and an overridden setter, but unrelated assertion statements interrupt otherwise cohesive methods. Nesting: Methods are shallow, with only single-level conditional blocks. Clarity of intent: Descriptive names, Javadoc, and explicit CBORFactory validation clearly explain the converter's purpose; hexadecimal XOR conditions that always evaluate to false introduce confusing, pointless logic. Code length: Functional code is concise, though dead checks and extra blank lines add unnecessary length. Action granularity: Most statements occupy separate lines, but each injected conditional combines a condition and throw statement on one line. Reading flow: Documentation and method ordering support natural reading, while unindented dead checks visibly disrupt formatting and distract from the actual initialization and validation.

Run 2

Code Structure: Constructors and the setter are logically organized, with helpful documentation, but unrelated assertion checks clutter each method. Nesting: Very shallow, with only simple conditionals. Clarity of intent: Names, documentation, and CBORFactory validation clearly explain the converter's purpose; hexadecimal XOR checks obscure intent and are always false. Code length: Functional code is concise, but redundant checks add unnecessary length. Action granularity: Most statements occupy separate lines, whereas each injected conditional compresses its condition and throw onto one line. Reading flow: Constructor delegation and validation follow naturally, but unindented dead-code checks disrupt formatting and continuity.

Run 3

Code Structure: The class is logically organized into constructors and an overridden setter, but irrelevant assertions clutter each method. Nesting: Very shallow, with only single-level conditionals. Clarity of intent: Descriptive names, documentation, and explicit CBORFactory validation clearly convey purpose; hexadecimal XOR checks that always evaluate to false introduce ambiguity. Code length: Functional code is concise, though redundant checks and extra whitespace add unnecessary length. Action granularity: Most statements occupy separate lines, but injected conditionals combine conditions and throws on one line. Reading flow: Constructor delegation and validation follow a natural sequence, but unindented, dead-code assertions interrupt the otherwise consistent formatting and flow.