TestingResearchIllinois/NonDex

View on GitHub

Showing 77 of 156 total issues

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

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

    public List<Configuration> startDebugLinear(Configuration config, long start, long end) {
        List<Configuration> allFailingConfigurations = new LinkedList<Configuration>();

        List<Pair<Pair<Long, Long>, Configuration>> pairs = new LinkedList<Pair<Pair<Long, Long>, Configuration>>();
        pairs.add((Pair<Pair<Long, Long>, Configuration>)Pair.of((Pair<Long, Long>)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 startDebugBinary has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public List<Configuration> startDebugBinary(Configuration config) {
        List<Configuration> allFailingConfigurations = new LinkedList<Configuration>();

        List<Pair<Pair<Long, Long>, Configuration>> pairs = new LinkedList<Pair<Pair<Long, Long>, Configuration>>();
        pairs.add((Pair<Pair<Long, Long>, Configuration>)Pair.of((Pair<Long, Long>)Pair.of(0L,

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 startDebugBinary has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

        private List<Configuration> startDebugBinary(Configuration config) {
            List<Configuration> allFailingConfigurations = new LinkedList<>();

            List<Pair<Pair<Long, Long>, Configuration>> pairs = new LinkedList<>();
            pairs.add(Pair.of(Pair.of(0L, (long) config.getInvocationCount()), config));

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 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

    Method generateHtml has 48 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

      Method run has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          public void run() throws MojoExecutionException {
              Xpp3Dom origNode = null;
              if (this.surefire.getConfiguration() != null) {
                  origNode = new Xpp3Dom((Xpp3Dom) this.surefire.getConfiguration());
              }

      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 printAndGetSummary has 44 lines of code (exceeds 25 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:");

        Method printSummary has 44 lines of code (exceeds 25 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;

          Method run has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public void run() throws MojoExecutionException {
                  Xpp3Dom origNode = null;
                  if (this.surefire.getConfiguration() != null) {
                      origNode = new Xpp3Dom((Xpp3Dom) this.surefire.getConfiguration());
                  }

            Method execute has 40 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                @Override
                public void execute() throws MojoExecutionException, MojoFailureException {
                    super.execute();
                    Logger.getGlobal().log(Level.INFO, "The original argline is: " + this.originalArgLine);
                    MojoExecutionException allExceptions = null;

              Method setupArgline has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  @Override
                  protected void setupArgline(Xpp3Dom configNode) {
                      String localRepo = this.mavenSession.getSettings().getLocalRepository();
                      String pathToNondex = this.getPathToNondexJar(localRepo);
                      String annotationsModuleName = "nondex-annotations";

                Method execute has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    @Override
                    public void execute(JvmTestExecutionSpec spec, TestResultProcessor testResultProcessor) {
                        Logger.getGlobal().log(Level.INFO, "The original argline is: " + nondexTestTask.getOriginalArgLine());
                        NonDexTestProcessor cleanRunProcessor = new NonDexTestProcessor(testResultProcessor);
                
                

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

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

                  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 getInvocationCount has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public int getInvocationCount() {
                          if (this.invoCount == null) {
                              File failed = Paths.get(this.nondexDir, this.executionId,
                                      ConfigurationDefaults.INVOCATIONS_FILE).toFile();
                  
                  

                  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 addNextEntry has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public void addNextEntry() {
                          MethodVisitor mv = super.visitMethod(Opcodes.ACC_PUBLIC, "nextEntry", "()Ljava/util/WeakHashMap$Entry;",
                                  "()Ljava/util/WeakHashMap$Entry<TK;TV;>;", null);
                          mv.visitCode();
                          mv.visitVarInsn(Opcodes.ALOAD, 0);

                    Method startDebugBinary has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public List<Configuration> startDebugBinary(Configuration config) {
                            List<Configuration> allFailingConfigurations = new LinkedList<Configuration>();
                    
                            List<Pair<Pair<Long, Long>, Configuration>> pairs = new LinkedList<Pair<Pair<Long, Long>, Configuration>>();
                            pairs.add((Pair<Pair<Long, Long>, Configuration>)Pair.of((Pair<Long, Long>)Pair.of(0L,

                      Method startDebugLinear has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

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

                        Method startDebugLinear has 34 lines of code (exceeds 25 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),
                          Severity
                          Category
                          Status
                          Source
                          Language