TestingResearchIllinois/NonDex

View on GitHub

Showing 156 of 156 total issues

Identical blocks of code found in 2 locations. Consider refactoring.
Open

/*
The MIT License (MIT)
Copyright (c) 2015 Alex Gyori
Copyright (c) 2022 Kaiyao Ke
Copyright (c) 2015 Owolabi Legunsen
nondex-gradle-plugin/plugin/src/functionalTest/resources/comprehensive-it/src/test/java/edu/illinois/nondex/functionalTest/ClassTestHelper.java on lines 1..93

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 235.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

package edu.illinois.nondex.functionalTest;

@TestAnnotation1
@TestAnnotation2
@TestAnnotation3
nondex-test/src/test/java/edu/illinois/nondex/core/ClassTestHelper.java on lines 1..122

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 235.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Method createJvmExecutionSpecWithArgs has 86 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected JvmTestExecutionSpec createJvmExecutionSpecWithArgs(List<String> args, JvmTestExecutionSpec originalSpec) {
        JavaForkOptions option = originalSpec.getJavaForkOptions();
        option.setAllJvmArgs(args);
        GradleVersion curGradleVersion = GradleVersion.current().getBaseVersion();
        try {

    Method visitMethod has 80 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        @Override
        public MethodVisitor visitMethod(int access, String name, String desc,
                                         String signature, String[] exceptions) {
            if ("getExceptionTypes".equals(name)) {
                return new MethodVisitor(Opcodes.ASM9, super.visitMethod(access, name, desc, signature, exceptions)) {

      AbstractNonDexTest has 27 methods (exceeds 20 allowed). Consider refactoring.
      Open

      public abstract class AbstractNonDexTest extends Test {
      
          protected int nondexSeed = Integer.parseInt(ConfigurationDefaults.DEFAULT_SEED_STR);
          @Option(option = ConfigurationDefaults.PROPERTY_SEED, description = "The seed that is used for randomization during shuffling.")
          public void setNondexSeed(String seed) {

        Method addNextIndex has 79 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public void addNextIndex() {
                MethodVisitor mv = super.visitMethod(Opcodes.ACC_PROTECTED, "nextIndex", "()I", null, null);
                mv.visitCode();
                mv.visitVarInsn(Opcodes.ALOAD, 0);
                mv.visitFieldInsn(Opcodes.GETFIELD, "java/util/IdentityHashMap$IdentityHashMapIterator", "this$0",

          Method printAndGetSummary has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
          Open

              private boolean printAndGetSummary(Configuration config) {
                  Set<String> allFailures = new LinkedHashSet<>();
                  Map<String, Integer> countsOfFailingTestsWithoutShuffling = new LinkedHashMap<>();
                  boolean failsWithoutShuffling = false;
                  Logger.getGlobal().log(Level.INFO, "NonDex SUMMARY:");

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          File Instrumenter.java has 294 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /*
          The MIT License (MIT)
          Copyright (c) 2015 Alex Gyori
          Copyright (c) 2022 Kaiyao Ke
          Copyright (c) 2015 Owolabi Legunsen

            File IdentityHashMapShufflingAdder.java has 293 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /*
            The MIT License (MIT)
            Copyright (c) 2015 Alex Gyori
            Copyright (c) 2022 Kaiyao Ke
            Copyright (c) 2015 Owolabi Legunsen

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

              /*
              The MIT License (MIT)
              Copyright (c) 2015 Alex Gyori
              Copyright (c) 2022 Kaiyao Ke
              Copyright (c) 2015 Owolabi Legunsen
              nondex-gradle-plugin/plugin/src/functionalTest/resources/comprehensive-it/src/test/java/edu/illinois/nondex/functionalTest/ClassTest.java on lines 1..66

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 189.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

              package edu.illinois.nondex.functionalTest;
              
              import static org.hamcrest.core.IsEqual.equalTo;
              import static org.hamcrest.core.IsNot.not;
              import static org.junit.Assert.assertThat;
              nondex-test/src/test/java/edu/illinois/nondex/core/ClassTest.java on lines 1..95

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 189.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              File NonDexDebug.java has 289 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              package edu.illinois.nondex.gradle.tasks;
              
              import com.google.common.collect.LinkedListMultimap;
              import edu.illinois.nondex.common.Configuration;
              import edu.illinois.nondex.common.ConfigurationDefaults;

                Method visitMethod has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                Open

                    @Override
                    public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
                        if ("hasNext".equals(name)) {
                            return super.visitMethod(access, "originalHasNext", desc, signature, exceptions);
                        }

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Method printSummary has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                Open

                    private void printSummary(Configuration config) {
                        Set<String> allFailures = new LinkedHashSet<>();
                        Map<String, Integer> countsOfFailingTestsWithoutShuffling =
                            new LinkedHashMap<String, Integer>();
                        boolean failsWithoutShuffling = false;

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Method visitMethod has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                Open

                    @Override
                    public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
                        if ("hasNext".equals(name)) {
                            return super.visitMethod(access, "originalHasNext", desc, signature, exceptions);
                        }

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Method visitMethod has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                Open

                    @Override
                    public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
                        if ("hasNext".equals(name)) {
                            return super.visitMethod(access, "originalHasNext", desc, signature, exceptions);
                        }

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Configuration has 22 methods (exceeds 20 allowed). Consider refactoring.
                Open

                public class Configuration {
                
                    public final Mode mode;
                    public final int seed;
                    public final Pattern filter;

                  Method generateHtml has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private void generateHtml(Set<String> allFailures, Configuration config) {
                          String head = "<!DOCTYPE html>"
                                  + "<html>"
                                  + "<head>"
                                  + "<title>Test Results</title>"

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Method startDebugLinear has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                  Open

                          private List<Configuration> startDebugLinear(Configuration config, long start, long end) {
                              List<Configuration> allFailingConfigurations = new LinkedList<>();
                  
                              List<Pair<Pair<Long, Long>, Configuration>> pairs = new LinkedList<>();
                              pairs.add(Pair.of(Pair.of(start, end),

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Method generateHtml has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private void generateHtml(Set<String> allFailures, Configuration config) {
                          String head = "<!DOCTYPE html>"
                                  + "<html>"
                                  + "<head>"
                                  + "<title>Test Results</title>"

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Severity
                  Category
                  Status
                  Source
                  Language