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

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

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

Similar blocks of code found in 5 locations. 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: 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 75..107
src/main/java/com/trickl/selection/Selection.java on lines 118..150
src/main/java/com/trickl/selection/Selection.java on lines 161..193
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

Similar blocks of code found in 5 locations. 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: 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 161..193
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

Similar blocks of code found in 5 locations. 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: 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 161..193

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

Similar blocks of code found in 5 locations. 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: 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 118..150
src/main/java/com/trickl/selection/Selection.java on lines 161..193
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

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

  public static <T> int[] selectFirst(
      double[] S, int[] freq, int k, SelectionAlgorithm selectionAlgorithm) {
    int[] results = new int[k];
    if (k > 0) {
      if (k == 1) {
Severity: Major
Found in src/main/java/com/trickl/selection/Selection.java and 4 other locations - About 3 hrs to fix
src/main/java/com/trickl/selection/Selection.java on lines 268..299
src/main/java/com/trickl/selection/Selection.java on lines 311..342
src/main/java/com/trickl/selection/Selection.java on lines 397..428
src/main/java/com/trickl/selection/Selection.java on lines 440..471

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

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

  public static <T> int[] selectFirst(
      float[] S, int[] freq, int k, SelectionAlgorithm selectionAlgorithm) {
    int[] results = new int[k];
    if (k > 0) {
      if (k == 1) {
Severity: Major
Found in src/main/java/com/trickl/selection/Selection.java and 4 other locations - About 3 hrs to fix
src/main/java/com/trickl/selection/Selection.java on lines 268..299
src/main/java/com/trickl/selection/Selection.java on lines 311..342
src/main/java/com/trickl/selection/Selection.java on lines 354..385
src/main/java/com/trickl/selection/Selection.java on lines 440..471

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

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

  public static <T> int[] selectFirst(
      int[] S, int[] freq, int k, SelectionAlgorithm selectionAlgorithm) {
    int[] results = new int[k];
    if (k > 0) {
      if (k == 1) {
Severity: Major
Found in src/main/java/com/trickl/selection/Selection.java and 4 other locations - About 3 hrs to fix
src/main/java/com/trickl/selection/Selection.java on lines 268..299
src/main/java/com/trickl/selection/Selection.java on lines 311..342
src/main/java/com/trickl/selection/Selection.java on lines 354..385
src/main/java/com/trickl/selection/Selection.java on lines 397..428

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

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

  public static <T> int[] selectFirst(
      short[] S, int[] freq, int k, SelectionAlgorithm selectionAlgorithm) {
    int[] results = new int[k];
    if (k > 0) {
      if (k == 1) {
Severity: Major
Found in src/main/java/com/trickl/selection/Selection.java and 4 other locations - About 3 hrs to fix
src/main/java/com/trickl/selection/Selection.java on lines 268..299
src/main/java/com/trickl/selection/Selection.java on lines 354..385
src/main/java/com/trickl/selection/Selection.java on lines 397..428
src/main/java/com/trickl/selection/Selection.java on lines 440..471

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

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

  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: Major
Found in src/main/java/com/trickl/selection/Selection.java and 4 other locations - About 3 hrs to fix
src/main/java/com/trickl/selection/Selection.java on lines 311..342
src/main/java/com/trickl/selection/Selection.java on lines 354..385
src/main/java/com/trickl/selection/Selection.java on lines 397..428
src/main/java/com/trickl/selection/Selection.java on lines 440..471

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

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