Showing 294 of 294 total issues

Similar blocks of code found in 12 locations. Consider refactoring.
Open

  @Override
  public double[] swap(double[] S, int first, int second) {
    int temp = array[first];
    array[first] = array[second];
    array[second] = temp;
Severity: Major
Found in src/main/java/com/trickl/math/IntArrayPermutator.java and 11 other locations - About 40 mins to fix
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 48..54
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 61..67
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 87..93
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 100..106
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 113..119
src/main/java/com/trickl/math/StandardPermutator.java on lines 36..42
src/main/java/com/trickl/math/StandardPermutator.java on lines 49..55
src/main/java/com/trickl/math/StandardPermutator.java on lines 62..68
src/main/java/com/trickl/math/StandardPermutator.java on lines 75..81
src/main/java/com/trickl/math/StandardPermutator.java on lines 88..94
src/main/java/com/trickl/math/StandardPermutator.java on lines 101..107

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

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 12 locations. Consider refactoring.
Open

  @Override
  public short[] swap(short[] S, int first, int second) {
    short temp = S[first];
    S[first] = S[second];
    S[second] = temp;
Severity: Major
Found in src/main/java/com/trickl/math/StandardPermutator.java and 11 other locations - About 40 mins to fix
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 48..54
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 61..67
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 74..80
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 87..93
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 100..106
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 113..119
src/main/java/com/trickl/math/StandardPermutator.java on lines 49..55
src/main/java/com/trickl/math/StandardPermutator.java on lines 62..68
src/main/java/com/trickl/math/StandardPermutator.java on lines 75..81
src/main/java/com/trickl/math/StandardPermutator.java on lines 88..94
src/main/java/com/trickl/math/StandardPermutator.java on lines 101..107

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

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 12 locations. Consider refactoring.
Open

  @Override
  public double[] swap(double[] S, int first, int second) {
    double temp = S[first];
    S[first] = S[second];
    S[second] = temp;
Severity: Major
Found in src/main/java/com/trickl/math/StandardPermutator.java and 11 other locations - About 40 mins to fix
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 48..54
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 61..67
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 74..80
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 87..93
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 100..106
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 113..119
src/main/java/com/trickl/math/StandardPermutator.java on lines 36..42
src/main/java/com/trickl/math/StandardPermutator.java on lines 49..55
src/main/java/com/trickl/math/StandardPermutator.java on lines 75..81
src/main/java/com/trickl/math/StandardPermutator.java on lines 88..94
src/main/java/com/trickl/math/StandardPermutator.java on lines 101..107

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

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 12 locations. Consider refactoring.
Open

  @Override
  public <T> T[] swap(T[] S, int first, int second) {
    T temp = S[first];
    S[first] = S[second];
    S[second] = temp;
Severity: Major
Found in src/main/java/com/trickl/math/StandardPermutator.java and 11 other locations - About 40 mins to fix
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 48..54
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 61..67
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 74..80
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 87..93
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 100..106
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 113..119
src/main/java/com/trickl/math/StandardPermutator.java on lines 36..42
src/main/java/com/trickl/math/StandardPermutator.java on lines 49..55
src/main/java/com/trickl/math/StandardPermutator.java on lines 62..68
src/main/java/com/trickl/math/StandardPermutator.java on lines 75..81
src/main/java/com/trickl/math/StandardPermutator.java on lines 88..94

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

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 12 locations. Consider refactoring.
Open

  @Override
  public float[] swap(float[] S, int first, int second) {
    int temp = array[first];
    array[first] = array[second];
    array[second] = temp;
Severity: Major
Found in src/main/java/com/trickl/math/IntArrayPermutator.java and 11 other locations - About 40 mins to fix
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 48..54
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 61..67
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 74..80
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 100..106
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 113..119
src/main/java/com/trickl/math/StandardPermutator.java on lines 36..42
src/main/java/com/trickl/math/StandardPermutator.java on lines 49..55
src/main/java/com/trickl/math/StandardPermutator.java on lines 62..68
src/main/java/com/trickl/math/StandardPermutator.java on lines 75..81
src/main/java/com/trickl/math/StandardPermutator.java on lines 88..94
src/main/java/com/trickl/math/StandardPermutator.java on lines 101..107

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

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 12 locations. Consider refactoring.
Open

  @Override
  public <T> T[] swap(T[] S, int first, int second) {
    int temp = array[first];
    array[first] = array[second];
    array[second] = temp;
Severity: Major
Found in src/main/java/com/trickl/math/IntArrayPermutator.java and 11 other locations - About 40 mins to fix
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 48..54
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 61..67
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 74..80
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 87..93
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 100..106
src/main/java/com/trickl/math/StandardPermutator.java on lines 36..42
src/main/java/com/trickl/math/StandardPermutator.java on lines 49..55
src/main/java/com/trickl/math/StandardPermutator.java on lines 62..68
src/main/java/com/trickl/math/StandardPermutator.java on lines 75..81
src/main/java/com/trickl/math/StandardPermutator.java on lines 88..94
src/main/java/com/trickl/math/StandardPermutator.java on lines 101..107

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

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 12 locations. Consider refactoring.
Open

  @Override
  public char[] swap(char[] S, int first, int second) {
    char temp = S[first];
    S[first] = S[second];
    S[second] = temp;
Severity: Major
Found in src/main/java/com/trickl/math/StandardPermutator.java and 11 other locations - About 40 mins to fix
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 48..54
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 61..67
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 74..80
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 87..93
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 100..106
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 113..119
src/main/java/com/trickl/math/StandardPermutator.java on lines 36..42
src/main/java/com/trickl/math/StandardPermutator.java on lines 62..68
src/main/java/com/trickl/math/StandardPermutator.java on lines 75..81
src/main/java/com/trickl/math/StandardPermutator.java on lines 88..94
src/main/java/com/trickl/math/StandardPermutator.java on lines 101..107

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

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 2 locations. Consider refactoring.
Open

  private static int accumulate(int[] S, int start, int end) {
    int sum = 0;
    for (int i = start; i < end; ++i) {
      sum += S[i];
    }
Severity: Minor
Found in src/main/java/com/trickl/selection/Selection.java and 1 other location - About 40 mins to fix
src/main/java/com/trickl/selection/MedianOfMedians.java on lines 648..654

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

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 12 locations. Consider refactoring.
Open

  @Override
  public int[] swap(int[] S, int first, int second) {
    int temp = array[first];
    array[first] = array[second];
    array[second] = temp;
Severity: Major
Found in src/main/java/com/trickl/math/IntArrayPermutator.java and 11 other locations - About 40 mins to fix
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 48..54
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 61..67
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 74..80
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 87..93
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 113..119
src/main/java/com/trickl/math/StandardPermutator.java on lines 36..42
src/main/java/com/trickl/math/StandardPermutator.java on lines 49..55
src/main/java/com/trickl/math/StandardPermutator.java on lines 62..68
src/main/java/com/trickl/math/StandardPermutator.java on lines 75..81
src/main/java/com/trickl/math/StandardPermutator.java on lines 88..94
src/main/java/com/trickl/math/StandardPermutator.java on lines 101..107

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

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 12 locations. Consider refactoring.
Open

  @Override
  public float[] swap(float[] S, int first, int second) {
    float temp = S[first];
    S[first] = S[second];
    S[second] = temp;
Severity: Major
Found in src/main/java/com/trickl/math/StandardPermutator.java and 11 other locations - About 40 mins to fix
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 48..54
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 61..67
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 74..80
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 87..93
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 100..106
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 113..119
src/main/java/com/trickl/math/StandardPermutator.java on lines 36..42
src/main/java/com/trickl/math/StandardPermutator.java on lines 49..55
src/main/java/com/trickl/math/StandardPermutator.java on lines 62..68
src/main/java/com/trickl/math/StandardPermutator.java on lines 88..94
src/main/java/com/trickl/math/StandardPermutator.java on lines 101..107

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

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 12 locations. Consider refactoring.
Open

  @Override
  public int[] swap(int[] S, int first, int second) {
    int temp = S[first];
    S[first] = S[second];
    S[second] = temp;
Severity: Major
Found in src/main/java/com/trickl/math/StandardPermutator.java and 11 other locations - About 40 mins to fix
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 48..54
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 61..67
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 74..80
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 87..93
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 100..106
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 113..119
src/main/java/com/trickl/math/StandardPermutator.java on lines 36..42
src/main/java/com/trickl/math/StandardPermutator.java on lines 49..55
src/main/java/com/trickl/math/StandardPermutator.java on lines 62..68
src/main/java/com/trickl/math/StandardPermutator.java on lines 75..81
src/main/java/com/trickl/math/StandardPermutator.java on lines 101..107

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

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 12 locations. Consider refactoring.
Open

  @Override
  public char[] swap(char[] S, int first, int second) {
    int temp = array[first];
    array[first] = array[second];
    array[second] = temp;
Severity: Major
Found in src/main/java/com/trickl/math/IntArrayPermutator.java and 11 other locations - About 40 mins to fix
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 48..54
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 74..80
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 87..93
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 100..106
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 113..119
src/main/java/com/trickl/math/StandardPermutator.java on lines 36..42
src/main/java/com/trickl/math/StandardPermutator.java on lines 49..55
src/main/java/com/trickl/math/StandardPermutator.java on lines 62..68
src/main/java/com/trickl/math/StandardPermutator.java on lines 75..81
src/main/java/com/trickl/math/StandardPermutator.java on lines 88..94
src/main/java/com/trickl/math/StandardPermutator.java on lines 101..107

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

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 2 locations. Consider refactoring.
Open

  private int accumulate(int[] freq, int first, int last) {
    int freqSum = 0;
    for (int i = first; i < last; ++i) {
      freqSum += freq[i];
    }
Severity: Minor
Found in src/main/java/com/trickl/selection/MedianOfMedians.java and 1 other location - About 40 mins to fix
src/main/java/com/trickl/selection/Selection.java on lines 535..541

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

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 12 locations. Consider refactoring.
Open

  @Override
  public short[] swap(short[] S, int first, int second) {
    int temp = array[first];
    array[first] = array[second];
    array[second] = temp;
Severity: Major
Found in src/main/java/com/trickl/math/IntArrayPermutator.java and 11 other locations - About 40 mins to fix
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 61..67
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 74..80
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 87..93
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 100..106
src/main/java/com/trickl/math/IntArrayPermutator.java on lines 113..119
src/main/java/com/trickl/math/StandardPermutator.java on lines 36..42
src/main/java/com/trickl/math/StandardPermutator.java on lines 49..55
src/main/java/com/trickl/math/StandardPermutator.java on lines 62..68
src/main/java/com/trickl/math/StandardPermutator.java on lines 75..81
src/main/java/com/trickl/math/StandardPermutator.java on lines 88..94
src/main/java/com/trickl/math/StandardPermutator.java on lines 101..107

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

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 2 locations. Consider refactoring.
Open

          if (comparator.compare(S[i], S[j]) == 0) {
            results[results.length - k] = i;
            k--;
          }
Severity: Minor
Found in src/main/java/com/trickl/selection/Selection.java and 1 other location - About 40 mins to fix
src/main/java/com/trickl/selection/Selection.java on lines 495..498

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

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 2 locations. Consider refactoring.
Open

          if (comparator.compare(S[i], S[j]) < 0) {
            results[results.length - k] = i;
            k--;
          }
Severity: Minor
Found in src/main/java/com/trickl/selection/Selection.java and 1 other location - About 40 mins to fix
src/main/java/com/trickl/selection/Selection.java on lines 503..506

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

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 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 partitionByMedian has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      protected int partitionByMedian(int[] S, int[] freq, int[] indices, int low, int high) {
    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(char[] 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/ChainPermutator.java - About 35 mins to fix
          Severity
          Category
          Status
          Source
          Language