Showing 294 of 294 total issues

Similar blocks of code found in 5 locations. 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: Major
Found in src/main/java/com/trickl/sort/FiveElementSort.java and 4 other locations - About 1 day to fix
src/main/java/com/trickl/sort/FiveElementSort.java on lines 143..255
src/main/java/com/trickl/sort/FiveElementSort.java on lines 262..374
src/main/java/com/trickl/sort/FiveElementSort.java on lines 381..493
src/main/java/com/trickl/sort/FiveElementSort.java on lines 500..611

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 690.

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

Similar blocks of code found in 5 locations. 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: Major
Found in src/main/java/com/trickl/sort/FiveElementSort.java and 4 other locations - About 1 day to fix
src/main/java/com/trickl/sort/FiveElementSort.java on lines 24..136
src/main/java/com/trickl/sort/FiveElementSort.java on lines 143..255
src/main/java/com/trickl/sort/FiveElementSort.java on lines 381..493
src/main/java/com/trickl/sort/FiveElementSort.java on lines 500..611

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 690.

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

Similar blocks of code found in 5 locations. 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: Major
Found in src/main/java/com/trickl/sort/FiveElementSort.java and 4 other locations - About 1 day to fix
src/main/java/com/trickl/sort/FiveElementSort.java on lines 24..136
src/main/java/com/trickl/sort/FiveElementSort.java on lines 262..374
src/main/java/com/trickl/sort/FiveElementSort.java on lines 381..493
src/main/java/com/trickl/sort/FiveElementSort.java on lines 500..611

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 690.

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

Similar blocks of code found in 5 locations. 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: Major
Found in src/main/java/com/trickl/sort/FiveElementSort.java and 4 other locations - About 1 day to fix
src/main/java/com/trickl/sort/FiveElementSort.java on lines 24..136
src/main/java/com/trickl/sort/FiveElementSort.java on lines 143..255
src/main/java/com/trickl/sort/FiveElementSort.java on lines 262..374
src/main/java/com/trickl/sort/FiveElementSort.java on lines 381..493

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 690.

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

Similar blocks of code found in 5 locations. 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: Major
Found in src/main/java/com/trickl/sort/FiveElementSort.java and 4 other locations - About 1 day to fix
src/main/java/com/trickl/sort/FiveElementSort.java on lines 24..136
src/main/java/com/trickl/sort/FiveElementSort.java on lines 143..255
src/main/java/com/trickl/sort/FiveElementSort.java on lines 262..374
src/main/java/com/trickl/sort/FiveElementSort.java on lines 500..611

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 690.

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 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

      Similar blocks of code found in 5 locations. 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: Major
      Found in src/main/java/com/trickl/selection/MedianOfMedians.java and 4 other locations - About 5 hrs to fix
      src/main/java/com/trickl/selection/MedianOfMedians.java on lines 351..387
      src/main/java/com/trickl/selection/MedianOfMedians.java on lines 400..436
      src/main/java/com/trickl/selection/MedianOfMedians.java on lines 449..485
      src/main/java/com/trickl/selection/MedianOfMedians.java on lines 547..583

      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 340.

      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

      Similar blocks of code found in 5 locations. 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: Major
      Found in src/main/java/com/trickl/selection/MedianOfMedians.java and 4 other locations - About 5 hrs to fix
      src/main/java/com/trickl/selection/MedianOfMedians.java on lines 351..387
      src/main/java/com/trickl/selection/MedianOfMedians.java on lines 400..436
      src/main/java/com/trickl/selection/MedianOfMedians.java on lines 449..485
      src/main/java/com/trickl/selection/MedianOfMedians.java on lines 498..534

      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 340.

      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

      Similar blocks of code found in 5 locations. 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: Major
      Found in src/main/java/com/trickl/selection/MedianOfMedians.java and 4 other locations - About 5 hrs to fix
      src/main/java/com/trickl/selection/MedianOfMedians.java on lines 351..387
      src/main/java/com/trickl/selection/MedianOfMedians.java on lines 400..436
      src/main/java/com/trickl/selection/MedianOfMedians.java on lines 498..534
      src/main/java/com/trickl/selection/MedianOfMedians.java on lines 547..583

      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 340.

      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

      Similar blocks of code found in 5 locations. 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: Major
      Found in src/main/java/com/trickl/selection/MedianOfMedians.java and 4 other locations - About 5 hrs to fix
      src/main/java/com/trickl/selection/MedianOfMedians.java on lines 351..387
      src/main/java/com/trickl/selection/MedianOfMedians.java on lines 449..485
      src/main/java/com/trickl/selection/MedianOfMedians.java on lines 498..534
      src/main/java/com/trickl/selection/MedianOfMedians.java on lines 547..583

      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 340.

      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

      Similar blocks of code found in 5 locations. 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: Major
      Found in src/main/java/com/trickl/selection/MedianOfMedians.java and 4 other locations - About 5 hrs to fix
      src/main/java/com/trickl/selection/MedianOfMedians.java on lines 400..436
      src/main/java/com/trickl/selection/MedianOfMedians.java on lines 449..485
      src/main/java/com/trickl/selection/MedianOfMedians.java on lines 498..534
      src/main/java/com/trickl/selection/MedianOfMedians.java on lines 547..583

      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 340.

      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

      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

        Similar blocks of code found in 5 locations. 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: Major
        Found in src/main/java/com/trickl/selection/Selection.java and 4 other locations - About 4 hrs to fix
        src/main/java/com/trickl/selection/Selection.java on lines 32..64
        src/main/java/com/trickl/selection/Selection.java on lines 75..107
        src/main/java/com/trickl/selection/Selection.java on lines 118..150
        src/main/java/com/trickl/selection/Selection.java on lines 204..236

        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 269.

        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

        Severity
        Category
        Status
        Source
        Language