Showing 147 of 294 total issues
Method sort
has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring. Open
@Override
public <T> T[] sort(T[] arr, int start, int end, Comparator<T> comparator) {
if (comparator == null) {
comparator = naturalOrderingComparator;
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method sort
has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring. Open
@Override
public short[] sort(short[] arr, int start, int end) {
int i0 = start;
int i1 = start + 1;
int i2 = start + 2;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method sort
has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring. Open
@Override
public float[] sort(float[] arr, int start, int end) {
int i0 = start;
int i1 = start + 1;
int i2 = start + 2;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method sort
has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring. Open
@Override
public char[] sort(char[] arr, int start, int end) {
int i0 = start;
int i1 = start + 1;
int i2 = start + 2;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method sort
has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring. Open
@Override
public double[] sort(double[] arr, int start, int end) {
int i0 = start;
int i1 = start + 1;
int i2 = start + 2;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method sort
has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring. Open
@Override
public int[] sort(int[] arr, int start, int end) {
int i0 = start;
int i1 = start + 1;
int i2 = start + 2;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
File FiveElementSort.java
has 480 lines of code (exceeds 250 allowed). Consider refactoring. Open
package com.trickl.sort;
import com.trickl.math.Permutator;
import com.trickl.math.StandardPermutator;
import java.util.Comparator;
File MedianOfMedians.java
has 420 lines of code (exceeds 250 allowed). Consider refactoring. Open
package com.trickl.selection;
import com.trickl.math.ChainPermutator;
import com.trickl.math.IntArrayPermutator;
import com.trickl.math.Permutator;
ChainPermutator
has 34 methods (exceeds 20 allowed). Consider refactoring. Open
public class ChainPermutator implements Permutator {
private Permutator lhsPermutator = new StandardPermutator();
private Permutator rhsPermutator = new StandardPermutator();
File Selection.java
has 345 lines of code (exceeds 250 allowed). Consider refactoring. Open
package com.trickl.selection;
import com.trickl.sort.NaturalOrderingComparator;
import java.lang.reflect.Array;
import java.util.Collection;
IntArrayPermutator
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
public class IntArrayPermutator implements Permutator {
private int[] array;
/**
Permutator
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
public interface Permutator {
/**
* Perform a three cycle permutation.
* [ 1, 2, 3 ] -> [ 2, 3, 1 ]
StandardPermutator
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
public class StandardPermutator implements Permutator {
/**
* {@inheritDoc}
*
Method selectLast
has a Cognitive Complexity of 24 (exceeds 5 allowed). 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);
- Read upRead up
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 selectLast
has a Cognitive Complexity of 24 (exceeds 5 allowed). 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);
- Read upRead up
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 selectLast
has a Cognitive Complexity of 24 (exceeds 5 allowed). 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);
- Read upRead up
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 selectLast
has a Cognitive Complexity of 24 (exceeds 5 allowed). 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);
- Read upRead up
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 selectLast
has a Cognitive Complexity of 24 (exceeds 5 allowed). 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);
- Read upRead up
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 selectFirst
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public static <T> int[] selectFirst(
T[] S, int[] freq, int k, Comparator<T> comparator, SelectionAlgorithm selectionAlgorithm) {
if (comparator == null) comparator = naturalOrderingComparator;
int[] results = new int[k];
if (k > 0) {
- Read upRead up
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 selectFirst
has a Cognitive Complexity of 22 (exceeds 5 allowed). 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) {
- Read upRead up
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"