Showing 147 of 294 total issues
Method partition
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public <T> int partition(T[] arr, int start, int end, T pivot, Comparator<T> comparator) {
Method select
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public int select(double[] S, int[] freq, int start, int end, int k) {
Method select
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
int select(double[] arr, int[] freq, int start, int end, int k);
Method cycle
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public int[] cycle(int[] S, int first, int second, int third, int fourth) {
Method cycle
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
short[] cycle(short[] S, int first, int second, int third, int fourth);
Method sort
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
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 toArray
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
private static <T> int[] toArray(T[] S, Map<T, Integer> freq) {
int[] freqArray = new int[S.length];
if (freq != null) {
for (int i = 0; i < freqArray.length; ++i) {
Integer f = freq.get(S[i]);
- 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"