Showing 147 of 294 total issues

Method sort has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
Open

  @Override
  public <T> T[] sort(T[] arr, int start, int end, Comparator<T> comparator) {
    if (comparator == null) {
      comparator = naturalOrderingComparator;
    }
Severity: Minor
Found in src/main/java/com/trickl/sort/FiveElementSort.java - About 1 day to fix

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

  @Override
  public short[] sort(short[] arr, int start, int end) {
    int i0 = start;
    int i1 = start + 1;
    int i2 = start + 2;
Severity: Minor
Found in src/main/java/com/trickl/sort/FiveElementSort.java - About 1 day to fix

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

  @Override
  public float[] sort(float[] arr, int start, int end) {
    int i0 = start;
    int i1 = start + 1;
    int i2 = start + 2;
Severity: Minor
Found in src/main/java/com/trickl/sort/FiveElementSort.java - About 1 day to fix

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

  @Override
  public char[] sort(char[] arr, int start, int end) {
    int i0 = start;
    int i1 = start + 1;
    int i2 = start + 2;
Severity: Minor
Found in src/main/java/com/trickl/sort/FiveElementSort.java - About 1 day to fix

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

  @Override
  public double[] sort(double[] arr, int start, int end) {
    int i0 = start;
    int i1 = start + 1;
    int i2 = start + 2;
Severity: Minor
Found in src/main/java/com/trickl/sort/FiveElementSort.java - About 1 day to fix

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

  @Override
  public int[] sort(int[] arr, int start, int end) {
    int i0 = start;
    int i1 = start + 1;
    int i2 = start + 2;
Severity: Minor
Found in src/main/java/com/trickl/sort/FiveElementSort.java - About 1 day to fix

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 FiveElementSort.java has 480 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package com.trickl.sort;

import com.trickl.math.Permutator;
import com.trickl.math.StandardPermutator;
import java.util.Comparator;
Severity: Minor
Found in src/main/java/com/trickl/sort/FiveElementSort.java - About 7 hrs to fix

    File MedianOfMedians.java has 420 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    package com.trickl.selection;
    
    import com.trickl.math.ChainPermutator;
    import com.trickl.math.IntArrayPermutator;
    import com.trickl.math.Permutator;
    Severity: Minor
    Found in src/main/java/com/trickl/selection/MedianOfMedians.java - About 6 hrs to fix

      ChainPermutator has 34 methods (exceeds 20 allowed). Consider refactoring.
      Open

      public class ChainPermutator implements Permutator {
      
        private Permutator lhsPermutator = new StandardPermutator();
      
        private Permutator rhsPermutator = new StandardPermutator();
      Severity: Minor
      Found in src/main/java/com/trickl/math/ChainPermutator.java - About 4 hrs to fix

        File Selection.java has 345 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        package com.trickl.selection;
        
        import com.trickl.sort.NaturalOrderingComparator;
        import java.lang.reflect.Array;
        import java.util.Collection;
        Severity: Minor
        Found in src/main/java/com/trickl/selection/Selection.java - About 4 hrs to fix

          IntArrayPermutator has 30 methods (exceeds 20 allowed). Consider refactoring.
          Open

          public class IntArrayPermutator implements Permutator {
          
            private int[] array;
          
            /**
          Severity: Minor
          Found in src/main/java/com/trickl/math/IntArrayPermutator.java - About 3 hrs to fix

            Permutator has 30 methods (exceeds 20 allowed). Consider refactoring.
            Open

            public interface Permutator {
            
              /**
               * Perform a three cycle permutation.
               * [ 1, 2, 3 ] -&gt; [ 2, 3, 1 ]
            Severity: Minor
            Found in src/main/java/com/trickl/math/Permutator.java - About 3 hrs to fix

              StandardPermutator has 30 methods (exceeds 20 allowed). Consider refactoring.
              Open

              public class StandardPermutator implements Permutator {
              
                /**
                 * {@inheritDoc}
                 *
              Severity: Minor
              Found in src/main/java/com/trickl/math/StandardPermutator.java - About 3 hrs to fix

                Method selectLast has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                Open

                  public static int[] selectLast(
                      float[] S, int[] freq, int k, SelectionAlgorithm selectionAlgorithm) {
                    int[] results = new int[k];
                    if (k > 0) {
                      int size = freq == null ? S.length : accumulate(freq, 0, freq.length);
                Severity: Minor
                Found in src/main/java/com/trickl/selection/Selection.java - About 3 hrs to fix

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

                  public static int[] selectLast(
                      int[] S, int[] freq, int k, SelectionAlgorithm selectionAlgorithm) {
                    int[] results = new int[k];
                    if (k > 0) {
                      int size = freq == null ? S.length : accumulate(freq, 0, freq.length);
                Severity: Minor
                Found in src/main/java/com/trickl/selection/Selection.java - About 3 hrs to fix

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

                  public static int[] selectLast(
                      char[] S, int[] freq, int k, SelectionAlgorithm selectionAlgorithm) {
                    int[] results = new int[k];
                    if (k > 0) {
                      int size = freq == null ? S.length : accumulate(freq, 0, freq.length);
                Severity: Minor
                Found in src/main/java/com/trickl/selection/Selection.java - About 3 hrs to fix

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

                  public static int[] selectLast(
                      short[] S, int[] freq, int k, SelectionAlgorithm selectionAlgorithm) {
                    int[] results = new int[k];
                    if (k > 0) {
                      int size = freq == null ? S.length : accumulate(freq, 0, freq.length);
                Severity: Minor
                Found in src/main/java/com/trickl/selection/Selection.java - About 3 hrs to fix

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

                  public static int[] selectLast(
                      double[] S, int[] freq, int k, SelectionAlgorithm selectionAlgorithm) {
                    int[] results = new int[k];
                    if (k > 0) {
                      int size = freq == null ? S.length : accumulate(freq, 0, freq.length);
                Severity: Minor
                Found in src/main/java/com/trickl/selection/Selection.java - About 3 hrs to fix

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

                  public static <T> int[] selectFirst(
                      T[] S, int[] freq, int k, Comparator<T> comparator, SelectionAlgorithm selectionAlgorithm) {
                    if (comparator == null) comparator = naturalOrderingComparator;
                    int[] results = new int[k];
                    if (k > 0) {
                Severity: Minor
                Found in src/main/java/com/trickl/selection/Selection.java - About 3 hrs to fix

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

                  public static <T> int[] selectFirst(
                      char[] S, int[] freq, int k, SelectionAlgorithm selectionAlgorithm) {
                    int[] results = new int[k];
                    if (k > 0) {
                      if (k == 1) {
                Severity: Minor
                Found in src/main/java/com/trickl/selection/Selection.java - About 3 hrs to fix

                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