Showing 147 of 294 total issues

Method medianOf3 has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

  private int medianOf3(float[] arr, int a, int b, int c) {
    return (arr[a] < arr[b]
        ? (arr[b] < arr[c] ? b : arr[a] < arr[c] ? c : a)
        : (arr[b] > arr[c] ? b : arr[a] > arr[c] ? c : a));
  }
Severity: Minor
Found in src/main/java/com/trickl/sort/QuickSort.java - About 1 hr 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 partition has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

  public <T> int partition(T[] arr, int start, int end, T pivot, Comparator<T> comparator) {
    if (comparator == null) {
      comparator = naturalOrderingComparator;
    }

Severity: Minor
Found in src/main/java/com/trickl/sort/GreaterOrEqualPartitioner.java - About 1 hr 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 11 (exceeds 5 allowed). Consider refactoring.
Open

  @Override
  public <T> T[] sort(T[] arr, int start, int end, Comparator<T> comparator) {
    if (end > start) {
      if (comparator == null) {
        comparator = naturalOrderingComparator;
Severity: Minor
Found in src/main/java/com/trickl/sort/QuickSort.java - About 1 hr 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 medianOf3 has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

  private int medianOf3(char[] arr, int a, int b, int c) {
    return (arr[a] < arr[b]
        ? (arr[b] < arr[c] ? b : arr[a] < arr[c] ? c : a)
        : (arr[b] > arr[c] ? b : arr[a] > arr[c] ? c : a));
  }
Severity: Minor
Found in src/main/java/com/trickl/sort/QuickSort.java - About 1 hr 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 medianOf3 has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

  private int medianOf3(int[] arr, int a, int b, int c) {
    return (arr[a] < arr[b]
        ? (arr[b] < arr[c] ? b : arr[a] < arr[c] ? c : a)
        : (arr[b] > arr[c] ? b : arr[a] > arr[c] ? c : a));
  }
Severity: Minor
Found in src/main/java/com/trickl/sort/QuickSort.java - About 1 hr 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 medianOf3 has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

  private <T> int medianOf3(T[] arr, int a, int b, int c, Comparator<T> comparator) {
    return (comparator.compare(arr[a], arr[b]) < 0
        ? (comparator.compare(arr[b], arr[c]) < 0 ? b :
            comparator.compare(arr[a], arr[c]) < 0 ? c : a)
        : (comparator.compare(arr[b], arr[c]) > 0 ? b :
Severity: Minor
Found in src/main/java/com/trickl/sort/QuickSort.java - About 1 hr 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 partitionByMedian has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  protected int partitionByMedian(char[] S, int[] freq, int[] indices, int low, int high) {
    final int arraysize = high - low;
    char[] subList = new char[(arraysize + 4) / 5];
    int[] subListFreq = null;
    if (freq != null) {
Severity: Minor
Found in src/main/java/com/trickl/selection/MedianOfMedians.java - About 1 hr to fix

    Method partitionByMedian has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      protected int partitionByMedian(float[] S, int[] freq, int[] indices, int low, int high) {
        final int arraysize = high - low;
        float[] subList = new float[(arraysize + 4) / 5];
        int[] subListFreq = null;
        if (freq != null) {
    Severity: Minor
    Found in src/main/java/com/trickl/selection/MedianOfMedians.java - About 1 hr to fix

      Method partitionByMedian has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        protected int partitionByMedian(double[] S, int[] freq, int[] indices, int low, int high) {
          final int arraysize = high - low;
          double[] subList = new double[(arraysize + 4) / 5];
          int[] subListFreq = null;
          if (freq != null) {
      Severity: Minor
      Found in src/main/java/com/trickl/selection/MedianOfMedians.java - About 1 hr to fix

        Method partitionByMedian has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          protected int partitionByMedian(int[] S, int[] freq, int[] indices, int low, int high) {
            final int arraysize = high - low;
            int[] subList = new int[(arraysize + 4) / 5];
            int[] subListFreq = null;
            if (freq != null) {
        Severity: Minor
        Found in src/main/java/com/trickl/selection/MedianOfMedians.java - About 1 hr to fix

          Method partitionByMedian has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            protected int partitionByMedian(short[] S, int[] freq, int[] indices, int low, int high) {
              final int arraysize = high - low;
              short[] subList = new short[(arraysize + 4) / 5];
              int[] subListFreq = null;
              if (freq != null) {
          Severity: Minor
          Found in src/main/java/com/trickl/selection/MedianOfMedians.java - About 1 hr to fix

            Method partitionByMedian has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              protected <T> int partitionByMedian(
                  T[] S, int[] freq, int[] indices, int low, int high, Comparator<T> comparator) {
                final int arraysize = high - low;
                T[] subList = (T[]) Array.newInstance(S[0].getClass(), (arraysize + 4) / 5);
                int[] subListFreq = null;
            Severity: Minor
            Found in src/main/java/com/trickl/selection/MedianOfMedians.java - About 1 hr to fix

              Method partition has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                public int partition(char[] arr, int start, int end, char pivot) {
                  int i = start;
                  int j = end - 1;
                  while (true) {
                    while (i < end && arr[i] < pivot) {
              Severity: Minor
              Found in src/main/java/com/trickl/sort/GreaterOrEqualPartitioner.java - About 1 hr 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 partition has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                public int partition(float[] arr, int start, int end, float pivot) {
                  int i = start;
                  int j = end - 1;
                  while (true) {
                    while (i < end && arr[i] < pivot) {
              Severity: Minor
              Found in src/main/java/com/trickl/sort/GreaterOrEqualPartitioner.java - About 1 hr 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 partition has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                public int partition(short[] arr, int start, int end, short pivot) {
                  int i = start;
                  int j = end - 1;
                  while (true) {
                    while (i < end && arr[i] < pivot) {
              Severity: Minor
              Found in src/main/java/com/trickl/sort/GreaterOrEqualPartitioner.java - About 1 hr 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 partition has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                public int partition(int[] arr, int start, int end, int pivot) {
                  int i = start;
                  int j = end - 1;
                  while (true) {
                    while (i < end && arr[i] < pivot) {
              Severity: Minor
              Found in src/main/java/com/trickl/sort/GreaterOrEqualPartitioner.java - About 1 hr 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 partition has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                public int partition(double[] arr, int start, int end, double pivot) {
                  int i = start;
                  int j = end - 1;
                  while (true) {
                    while (i < end && arr[i] < pivot) {
              Severity: Minor
              Found in src/main/java/com/trickl/sort/GreaterOrEqualPartitioner.java - About 1 hr 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 9 (exceeds 5 allowed). Consider refactoring.
              Open

                @Override
                public int[] sort(int[] arr, int start, int end) {
                  if (end > start) {
                    if (end - start < 10) {
                      return insertionSort.sort(arr, start, end);
              Severity: Minor
              Found in src/main/java/com/trickl/sort/QuickSort.java - About 55 mins 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 9 (exceeds 5 allowed). Consider refactoring.
              Open

                @Override
                public short[] sort(short[] arr, int start, int end) {
                  if (end > start) {
                    if (end - start < 10) {
                      return insertionSort.sort(arr, start, end);
              Severity: Minor
              Found in src/main/java/com/trickl/sort/QuickSort.java - About 55 mins 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 9 (exceeds 5 allowed). Consider refactoring.
              Open

                @Override
                public char[] sort(char[] arr, int start, int end) {
                  if (end > start) {
                    if (end - start < 10) {
                      return insertionSort.sort(arr, start, end);
              Severity: Minor
              Found in src/main/java/com/trickl/sort/QuickSort.java - About 55 mins 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