nd4j/nd4j-common/src/main/java/org/nd4j/common/base/Preconditions.java
Preconditions
has 67 methods (exceeds 20 allowed). Consider refactoring. Open
Open
public final class Preconditions {
private static final Map<String,PreconditionsFormat> FORMATTERS = new HashMap<>();
static {
ServiceLoader<PreconditionsFormat> sl = ND4JClassLoading.loadService(PreconditionsFormat.class);
for (PreconditionsFormat pf : sl) {
File Preconditions.java
has 424 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* ******************************************************************************
* *
* *
* * This program and the accompanying materials are made available under the
Method format
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
Open
private static String format(String message, Object... args) {
if (message == null) {
message = "";
}
if (args == null) {
- 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 format
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static String format(String message, Object... args) {
if (message == null) {
message = "";
}
if (args == null) {
Method formatArray
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
public static String formatArray(Object o){
if(o == null)
return "null";
if(o.getClass().getComponentType().isPrimitive()){
- 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 formatArray
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static String formatArray(Object o){
if(o == null)
return "null";
if(o.getClass().getComponentType().isPrimitive()){
Method checkState
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static void checkState(boolean b, String msg, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6) {
Method checkArgument
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static void checkArgument(boolean b, String msg, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6) {
Method checkState
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static void checkState(boolean b, String msg, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5) {
Method checkArgument
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static void checkArgument(boolean b, String msg, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5) {
Method checkState
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static void checkState(boolean b, String msg, Object arg1, Object arg2, Object arg3, Object arg4) {
Method checkNotNull
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static void checkNotNull(Object o, String msg, int arg1, int arg2, int arg3, int arg4) {
Method checkArgument
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static void checkArgument(boolean b, String msg, long arg1, long arg2, long arg3, long arg4) {
Method checkState
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static void checkState(boolean b, String msg, double arg1, double arg2, double arg3, double arg4) {
Method checkNotNull
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static void checkNotNull(Object o, String msg, Object arg1, Object arg2, Object arg3, Object arg4) {
Method checkArgument
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static void checkArgument(boolean b, String msg, double arg1, double arg2, double arg3, double arg4) {
Method checkArgument
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static void checkArgument(boolean b, String msg, Object arg1, Object arg2, Object arg3, Object arg4) {
Method checkState
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static void checkState(boolean b, String msg, int arg1, int arg2, int arg3, int arg4) {
Method checkState
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static void checkState(boolean b, String msg, long arg1, long arg2, long arg3, long arg4) {
Avoid deeply nested control flow statements. Open
Open
if (i < args.length - 1) {
sb.append(",");
}
Method checkArgument
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static void checkArgument(boolean b, String msg, int arg1, int arg2, int arg3, int arg4) {
Method checkNotNull
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static void checkNotNull(Object o, String msg, double arg1, double arg2, double arg3, double arg4) {
Method checkNotNull
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static void checkNotNull(Object o, String msg, long arg1, long arg2, long arg3, long arg4) {
Method checkNotNull
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static void checkNotNull(Object o, String msg, Object arg1, Object arg2, Object arg3) {
Method checkNotNull
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static void checkNotNull(Object o, String msg, double arg1, double arg2, double arg3) {
Method checkArgument
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static void checkArgument(boolean b, String msg, long arg1, long arg2, long arg3) {
Method checkArgument
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static void checkArgument(boolean b, String msg, double arg1, double arg2, double arg3) {
Method checkState
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static void checkState(boolean b, String msg, int arg1, int arg2, int arg3) {
Method checkArgument
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static void checkArgument(boolean b, String msg, int arg1, int arg2, int arg3) {
Method checkNotNull
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static void checkNotNull(Object o, String msg, long arg1, long arg2, long arg3) {
Method checkState
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static void checkState(boolean b, String msg, long arg1, long arg2, long arg3) {
Method checkNotNull
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static void checkNotNull(Object o, String msg, int arg1, int arg2, int arg3) {
Method checkArgument
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static void checkArgument(boolean b, String msg, Object arg1, Object arg2, Object arg3) {
Method checkState
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static void checkState(boolean b, String msg, double arg1, double arg2, double arg3) {
Method checkState
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static void checkState(boolean b, String msg, Object arg1, Object arg2, Object arg3) {
Avoid too many return
statements within this method. Open
Open
return Arrays.toString((char[])o);
Avoid too many return
statements within this method. Open
Open
return Arrays.toString((byte[])o);
Avoid too many return
statements within this method. Open
Open
return Arrays.toString((double[])o);
Avoid too many return
statements within this method. Open
Open
return Arrays.toString((long[])o);
Avoid too many return
statements within this method. Open
Open
return Arrays.toString((boolean[])o);
Avoid too many return
statements within this method. Open
Open
return Arrays.toString((float[])o);
Avoid too many return
statements within this method. Open
Open
return Arrays.toString((int[])o);