Showing 294 of 294 total issues

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

  @Override
  public int select(short[] S, int[] freq, int start, int end, int k) {
    // Non-destructive selection
    short[] copyS = Arrays.copyOf(S, S.length);
    int[] index = new int[S.length];
Severity: Major
Found in src/main/java/com/trickl/selection/MedianOfMedians.java and 4 other locations - About 1 hr to fix
src/main/java/com/trickl/selection/MedianOfMedians.java on lines 35..45
src/main/java/com/trickl/selection/MedianOfMedians.java on lines 137..147
src/main/java/com/trickl/selection/MedianOfMedians.java on lines 188..198
src/main/java/com/trickl/selection/MedianOfMedians.java on lines 239..249

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

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 select(double[] S, int[] freq, int start, int end, int k) {
    // Non-destructive selection
    double[] copyS = Arrays.copyOf(S, S.length);
    int[] index = new int[S.length];
Severity: Major
Found in src/main/java/com/trickl/selection/MedianOfMedians.java and 4 other locations - About 1 hr to fix
src/main/java/com/trickl/selection/MedianOfMedians.java on lines 35..45
src/main/java/com/trickl/selection/MedianOfMedians.java on lines 86..96
src/main/java/com/trickl/selection/MedianOfMedians.java on lines 188..198
src/main/java/com/trickl/selection/MedianOfMedians.java on lines 239..249

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

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 select(int[] S, int[] freq, int start, int end, int k) {
    // Non-destructive selection
    int[] copyS = Arrays.copyOf(S, S.length);
    int[] index = new int[S.length];
Severity: Major
Found in src/main/java/com/trickl/selection/MedianOfMedians.java and 4 other locations - About 1 hr to fix
src/main/java/com/trickl/selection/MedianOfMedians.java on lines 35..45
src/main/java/com/trickl/selection/MedianOfMedians.java on lines 86..96
src/main/java/com/trickl/selection/MedianOfMedians.java on lines 137..147
src/main/java/com/trickl/selection/MedianOfMedians.java on lines 188..198

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

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 select(float[] S, int[] freq, int start, int end, int k) {
    // Non-destructive selection
    float[] copyS = Arrays.copyOf(S, S.length);
    int[] index = new int[S.length];
Severity: Major
Found in src/main/java/com/trickl/selection/MedianOfMedians.java and 4 other locations - About 1 hr to fix
src/main/java/com/trickl/selection/MedianOfMedians.java on lines 35..45
src/main/java/com/trickl/selection/MedianOfMedians.java on lines 86..96
src/main/java/com/trickl/selection/MedianOfMedians.java on lines 137..147
src/main/java/com/trickl/selection/MedianOfMedians.java on lines 239..249

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

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 select(char[] S, int[] freq, int start, int end, int k) {
    // Non-destructive selection
    char[] copyS = Arrays.copyOf(S, S.length);
    int[] index = new int[S.length];
Severity: Major
Found in src/main/java/com/trickl/selection/MedianOfMedians.java and 4 other locations - About 1 hr to fix
src/main/java/com/trickl/selection/MedianOfMedians.java on lines 86..96
src/main/java/com/trickl/selection/MedianOfMedians.java on lines 137..147
src/main/java/com/trickl/selection/MedianOfMedians.java on lines 188..198
src/main/java/com/trickl/selection/MedianOfMedians.java on lines 239..249

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

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 short[] sort(short[] arr, int start, int end) {
    for (int i = start + 1; i < end; i++) {
      for (int j = i; j > start && arr[j - 1] > arr[j]; j--) {
        permutator.swap(arr, j, j - 1);
      }
Severity: Major
Found in src/main/java/com/trickl/sort/InsertionSort.java and 4 other locations - About 1 hr to fix
src/main/java/com/trickl/sort/InsertionSort.java on lines 27..34
src/main/java/com/trickl/sort/InsertionSort.java on lines 61..68
src/main/java/com/trickl/sort/InsertionSort.java on lines 78..85
src/main/java/com/trickl/sort/InsertionSort.java on lines 95..102

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

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 char[] sort(char[] arr, int start, int end) {
    for (int i = start + 1; i < end; i++) {
      for (int j = i; j > start && arr[j - 1] > arr[j]; j--) {
        permutator.swap(arr, j, j - 1);
      }
Severity: Major
Found in src/main/java/com/trickl/sort/InsertionSort.java and 4 other locations - About 1 hr to fix
src/main/java/com/trickl/sort/InsertionSort.java on lines 44..51
src/main/java/com/trickl/sort/InsertionSort.java on lines 61..68
src/main/java/com/trickl/sort/InsertionSort.java on lines 78..85
src/main/java/com/trickl/sort/InsertionSort.java on lines 95..102

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

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 double[] sort(double[] arr, int start, int end) {
    for (int i = start + 1; i < end; i++) {
      for (int j = i; j > start && arr[j - 1] > arr[j]; j--) {
        permutator.swap(arr, j, j - 1);
      }
Severity: Major
Found in src/main/java/com/trickl/sort/InsertionSort.java and 4 other locations - About 1 hr to fix
src/main/java/com/trickl/sort/InsertionSort.java on lines 27..34
src/main/java/com/trickl/sort/InsertionSort.java on lines 44..51
src/main/java/com/trickl/sort/InsertionSort.java on lines 78..85
src/main/java/com/trickl/sort/InsertionSort.java on lines 95..102

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

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 float[] sort(float[] arr, int start, int end) {
    for (int i = start + 1; i < end; i++) {
      for (int j = i; j > start && arr[j - 1] > arr[j]; j--) {
        permutator.swap(arr, j, j - 1);
      }
Severity: Major
Found in src/main/java/com/trickl/sort/InsertionSort.java and 4 other locations - About 1 hr to fix
src/main/java/com/trickl/sort/InsertionSort.java on lines 27..34
src/main/java/com/trickl/sort/InsertionSort.java on lines 44..51
src/main/java/com/trickl/sort/InsertionSort.java on lines 61..68
src/main/java/com/trickl/sort/InsertionSort.java on lines 95..102

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

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 int[] sort(int[] arr, int start, int end) {
    for (int i = start + 1; i < end; i++) {
      for (int j = i; j > start && arr[j - 1] > arr[j]; j--) {
        permutator.swap(arr, j, j - 1);
      }
Severity: Major
Found in src/main/java/com/trickl/sort/InsertionSort.java and 4 other locations - About 1 hr to fix
src/main/java/com/trickl/sort/InsertionSort.java on lines 27..34
src/main/java/com/trickl/sort/InsertionSort.java on lines 44..51
src/main/java/com/trickl/sort/InsertionSort.java on lines 61..68
src/main/java/com/trickl/sort/InsertionSort.java on lines 78..85

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

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 int partition(double[] arr, int start, int end, double pivot) {
    int pivotPoint = greaterOrEqualPartitioner.partition(arr, start, end, pivot);

    // Everything right of the pivotPoint is greater or equal
    // Now moved the equal elements to the pivot point
Severity: Major
Found in src/main/java/com/trickl/sort/ThreeWayPartitioner.java and 4 other locations - About 1 hr to fix
src/main/java/com/trickl/sort/ThreeWayPartitioner.java on lines 32..45
src/main/java/com/trickl/sort/ThreeWayPartitioner.java on lines 56..69
src/main/java/com/trickl/sort/ThreeWayPartitioner.java on lines 104..117
src/main/java/com/trickl/sort/ThreeWayPartitioner.java on lines 128..141

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

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 int partition(char[] arr, int start, int end, char pivot) {
    int pivotPoint = greaterOrEqualPartitioner.partition(arr, start, end, pivot);

    // Everything right of the pivotPoint is greater or equal
    // Now moved the equal elements to the pivot point
Severity: Major
Found in src/main/java/com/trickl/sort/ThreeWayPartitioner.java and 4 other locations - About 1 hr to fix
src/main/java/com/trickl/sort/ThreeWayPartitioner.java on lines 32..45
src/main/java/com/trickl/sort/ThreeWayPartitioner.java on lines 80..93
src/main/java/com/trickl/sort/ThreeWayPartitioner.java on lines 104..117
src/main/java/com/trickl/sort/ThreeWayPartitioner.java on lines 128..141

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

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 int partition(short[] arr, int start, int end, short pivot) {
    int pivotPoint = greaterOrEqualPartitioner.partition(arr, start, end, pivot);

    // Everything right of the pivotPoint is greater or equal
    // Now moved the equal elements to the pivot point
Severity: Major
Found in src/main/java/com/trickl/sort/ThreeWayPartitioner.java and 4 other locations - About 1 hr to fix
src/main/java/com/trickl/sort/ThreeWayPartitioner.java on lines 56..69
src/main/java/com/trickl/sort/ThreeWayPartitioner.java on lines 80..93
src/main/java/com/trickl/sort/ThreeWayPartitioner.java on lines 104..117
src/main/java/com/trickl/sort/ThreeWayPartitioner.java on lines 128..141

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

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 int partition(float[] arr, int start, int end, float pivot) {
    int pivotPoint = greaterOrEqualPartitioner.partition(arr, start, end, pivot);

    // Everything right of the pivotPoint is greater or equal
    // Now moved the equal elements to the pivot point
Severity: Major
Found in src/main/java/com/trickl/sort/ThreeWayPartitioner.java and 4 other locations - About 1 hr to fix
src/main/java/com/trickl/sort/ThreeWayPartitioner.java on lines 32..45
src/main/java/com/trickl/sort/ThreeWayPartitioner.java on lines 56..69
src/main/java/com/trickl/sort/ThreeWayPartitioner.java on lines 80..93
src/main/java/com/trickl/sort/ThreeWayPartitioner.java on lines 128..141

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

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 int partition(int[] arr, int start, int end, int pivot) {
    int pivotPoint = greaterOrEqualPartitioner.partition(arr, start, end, pivot);

    // Everything right of the pivotPoint is greater or equal
    // Now moved the equal elements to the pivot point
Severity: Major
Found in src/main/java/com/trickl/sort/ThreeWayPartitioner.java and 4 other locations - About 1 hr to fix
src/main/java/com/trickl/sort/ThreeWayPartitioner.java on lines 32..45
src/main/java/com/trickl/sort/ThreeWayPartitioner.java on lines 56..69
src/main/java/com/trickl/sort/ThreeWayPartitioner.java on lines 80..93
src/main/java/com/trickl/sort/ThreeWayPartitioner.java on lines 104..117

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

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 medianOf3 has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

  private int medianOf3(int[] arr, int a, int b, int c) {
    return (arr[a] < arr[b]
        ? (arr[b] < arr[c] ? b : arr[a] < arr[c] ? c : a)
        : (arr[b] > arr[c] ? b : arr[a] > arr[c] ? c : a));
  }
Severity: Minor
Found in src/main/java/com/trickl/sort/QuickSort.java - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

  private int medianOf3(double[] arr, int a, int b, int c) {
    return (arr[a] < arr[b]
        ? (arr[b] < arr[c] ? b : arr[a] < arr[c] ? c : a)
        : (arr[b] > arr[c] ? b : arr[a] > arr[c] ? c : a));
  }
Severity: Minor
Found in src/main/java/com/trickl/sort/QuickSort.java - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

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

Severity: Minor
Found in src/main/java/com/trickl/sort/GreaterOrEqualPartitioner.java - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

  private <T> int medianOf3(T[] arr, int a, int b, int c, Comparator<T> comparator) {
    return (comparator.compare(arr[a], arr[b]) < 0
        ? (comparator.compare(arr[b], arr[c]) < 0 ? b :
            comparator.compare(arr[a], arr[c]) < 0 ? c : a)
        : (comparator.compare(arr[b], arr[c]) > 0 ? b :
Severity: Minor
Found in src/main/java/com/trickl/sort/QuickSort.java - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

  @Override
  public <T> T[] sort(T[] arr, int start, int end, Comparator<T> comparator) {
    if (end > start) {
      if (comparator == null) {
        comparator = naturalOrderingComparator;
Severity: Minor
Found in src/main/java/com/trickl/sort/QuickSort.java - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Severity
Category
Status
Source
Language