deeplearning4j/deeplearning4j

View on GitHub

Showing 13,975 of 13,975 total issues

CpuNDArrayFactory has 97 methods (exceeds 20 allowed). Consider refactoring.
Open

@Slf4j
public class CpuNDArrayFactory extends BaseNativeNDArrayFactory {

    protected ThreadLocal<PointerPointer> extrazA = new ThreadLocal<>();
    protected ThreadLocal<PointerPointer> extrazB = new ThreadLocal<>();

    Method getOutputs has a Cognitive Complexity of 92 (exceeds 5 allowed). Consider refactoring.
    Open

        @Override
        public ExecutionResult getOutputs(Pair<SameDiffOp, OpContext> opPair, FrameIter outputFrameIter, Set<VarId> opInputs, Set<VarId> allIterInputs,
                                          Set<String> constAndPhInputs, List<Listener> listeners, At at, MultiDataSet batch, Set<String> allReqVariables, Map<String, SDValue> otherPlaceHolders) {
            //Get outputs from InferenceSession
            ExecutionResult out = super.getOutputs(opPair, outputFrameIter, opInputs, allIterInputs, constAndPhInputs, listeners, at, batch, allReqVariables, otherPlaceHolders);

    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

    DataBuffer has 96 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public interface DataBuffer extends Serializable, AutoCloseable, Deallocatable {
        enum TypeEx {
    
        }
    
    

      Method mapFlatPropertiesToFunctionProperties has a Cognitive Complexity of 91 (exceeds 5 allowed). Consider refactoring.
      Open

          public static Map<String, Object> mapFlatPropertiesToFunctionProperties(Iterable<FlatProperties> list) {
              Map<String, Object> out = new HashMap<>();
              for (FlatProperties p : list) {
      
                  String name = p.name();

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

          private Pair<INDArray, INDArray> convertWritablesSequence(List<List<List<Writable>>> list, int minValues,
                          int maxTSLength, SubsetDetails details, int[] longestSequence, long rngSeed) {
              if (maxTSLength == -1)
                  maxTSLength = list.get(0).size();
              INDArray arr;

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

          public void init(INDArray parameters, boolean cloneParametersArray) {
              if (initCalled)
                  return;
      
              DataType netDtype = getConfiguration().getDataType();

      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

      JCublasNDArrayFactory has 95 methods (exceeds 20 allowed). Consider refactoring.
      Open

      @Slf4j
      public class JCublasNDArrayFactory extends BaseNativeNDArrayFactory {
      
      
          public JCublasNDArrayFactory() { }

        Method checkGradients has a Cognitive Complexity of 90 (exceeds 5 allowed). Consider refactoring.
        Open

            public static boolean checkGradients(MLNConfig c) {
        
                //Basic sanity checks on input:
                if (c.epsilon <= 0.0 || c.epsilon > 0.1)
                    throw new IllegalArgumentException("Invalid epsilon: expect epsilon in range (0,0.1], usually 1e-4 or so");

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

            protected INDArray outputOfLayerDetached(boolean train, @NonNull FwdPassType fwdPassType, int layerIndex, @NonNull INDArray input,
                                                     INDArray featureMask, INDArray labelsMask, MemoryWorkspace outputWorkspace){
                setInput(input);
                setLayerMaskArrays(featureMask, labelsMask);
        
        

        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 Configuration.java has 767 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*
         *  ******************************************************************************
         *  *
         *  *
         *  * This program and the accompanying materials are made available under the

          File CudaDataBufferFactory.java has 763 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /*
           *  ******************************************************************************
           *  *
           *  *
           *  * This program and the accompanying materials are made available under the

            Method createGradFunction has 355 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public void createGradFunction(final String... variablesRequiringGradients) {
                    if(this.sameDiffFunctionInstances.containsKey(GRAD_FN_KEY))
                        sameDiffFunctionInstances.remove(GRAD_FN_KEY);
                    List<String> lossInferred = bestGuessLossVariables();
                    //Check for external errors function

              File NativeOps.java has 758 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /*
               *  ******************************************************************************
               *  *
               *  *
               *  * This program and the accompanying materials are made available under the

                File DefaultOpExecutioner.java has 758 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /*
                 *  ******************************************************************************
                 *  *
                 *  *
                 *  * This program and the accompanying materials are made available under the

                  Method markSatisfied has a Cognitive Complexity of 88 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public void markSatisfied(@NonNull D x, boolean satisfied) {
                  
                          if (satisfied) {
                              boolean alreadySatisfied = satisfiedDependencies.contains(x);
                  
                  

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

                      public static boolean checkActivationGradients(ActGradConfig config){
                          SameDiff sd = config.getSd();
                          List<String> actGrads = config.getActivationGradsToCheck();
                          double maxRelError = config.getMaxRelError();
                          double minAbsError = config.getMinAbsError();

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

                      public static MultiLayerConfiguration fromJson(String json) {
                          MultiLayerConfiguration conf;
                          ObjectMapper mapper = NeuralNetConfiguration.mapper();
                          try {
                              conf = mapper.readValue(json, MultiLayerConfiguration.class);

                  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

                  Function ChartLine has a Cognitive Complexity of 88 (exceeds 5 allowed). Consider refactoring.
                  Open

                  var ChartLine = (function (_super) {
                      __extends(ChartLine, _super);
                      function ChartLine(jsonStr) {
                          var _this = _super.call(this, ComponentType.ChartLine, jsonStr) || this;
                          _this.render = function (appendToObject) {

                  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 ArrowConverter.java has 751 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /*
                   *  ******************************************************************************
                   *  *
                   *  *
                   *  * This program and the accompanying materials are made available under the

                    BaseCudaDataBuffer has 91 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                    public abstract class BaseCudaDataBuffer extends BaseDataBuffer implements JCudaBuffer, Deallocatable {
                    
                        @Getter
                        protected transient volatile AllocationPoint allocationPoint;
                        public final static long BASE_CUDA_DATA_BUFFER_OFFSET = RandomUtils.nextLong();
                      Severity
                      Category
                      Status
                      Source
                      Language