Showing 147 of 294 total issues

Method partition has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

  public <T> int partition(T[] arr, int start, int end, T pivot, Comparator<T> comparator) {
Severity: Minor
Found in src/main/java/com/trickl/sort/GreaterOrEqualPartitioner.java - About 35 mins to fix

    Method select has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      public int select(double[] S, int[] freq, int start, int end, int k) {
    Severity: Minor
    Found in src/main/java/com/trickl/selection/MedianOfMedians.java - About 35 mins to fix

      Method select has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        int select(double[] arr, int[] freq, int start, int end, int k);
      Severity: Minor
      Found in src/main/java/com/trickl/selection/SelectionAlgorithm.java - About 35 mins to fix

        Method cycle has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          public int[] cycle(int[] S, int first, int second, int third, int fourth) {
        Severity: Minor
        Found in src/main/java/com/trickl/math/IntArrayPermutator.java - About 35 mins to fix

          Method cycle has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            short[] cycle(short[] S, int first, int second, int third, int fourth);
          Severity: Minor
          Found in src/main/java/com/trickl/math/Permutator.java - About 35 mins to fix

            Method sort has a Cognitive Complexity of 6 (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/FourElementSort.java - About 25 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 toArray has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

              private static <T> int[] toArray(T[] S, Map<T, Integer> freq) {
                int[] freqArray = new int[S.length];
                if (freq != null) {
                  for (int i = 0; i < freqArray.length; ++i) {
                    Integer f = freq.get(S[i]);
            Severity: Minor
            Found in src/main/java/com/trickl/selection/Selection.java - About 25 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