deeplearning4j/deeplearning4j

View on GitHub

Showing 13,634 of 13,634 total issues

File WordVectorSerializer.java has 2024 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*******************************************************************************
 * Copyright (c) 2015-2018 Skymind, Inc.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Apache License, Version 2.0 which is available at

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

    var Legend = (function () {
        function Legend() {
        }
        Legend.offsetX = 15;
        Legend.offsetY = 15;
    deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-ui-components/src/main/resources/assets/dl4j-ui.js on lines 576..628

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

    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 2 locations. Consider refactoring.
    Open

    var Legend = (function () {
        function Legend() {
        }
        Legend.offsetX = 15;
        Legend.offsetY = 15;
    arbiter/arbiter-ui/src/main/resources/deeplearning4jUiAssets/dl4j-ui.js on lines 551..603

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

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

        protected synchronized History fitHelper(@NonNull MultiDataSetIterator iter, int numEpochs, boolean incrementEpochCount,
                                                 MultiDataSetIterator validationData, int validationFrequency, @NonNull List<Listener> listeners) {
            Preconditions.checkNotNull(iter, "Iterator must not be null");
            Preconditions.checkState(numEpochs > 0, "Number of training epochs must be a positive number. Got: %s", numEpochs);
            Preconditions.checkState(trainingConfig != null, "No training configuration has been set. A training configuration must " +

    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

    SDBaseOps has 261 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public abstract class SDBaseOps {
    
        /**
         * Intended for internal/developer use
         */

      ArrayUtil has 260 methods (exceeds 20 allowed). Consider refactoring.
      Open

      public class ArrayUtil {
      
      
          private ArrayUtil() {}
      
      
      Severity: Major
      Found in nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/ArrayUtil.java - About 5 days to fix

        SameDiff has 256 methods (exceeds 20 allowed). Consider refactoring.
        Open

        @AllArgsConstructor
        @Builder
        @Slf4j
        public class SameDiff extends SDBaseOps {
            protected static final String GRAD_FN_KEY = "grad";

          Method updateDescendentsForExec has a Cognitive Complexity of 248 (exceeds 5 allowed). Consider refactoring.
          Open

              protected void updateDescendentsForExec(int execStep, VarId executedVar) {
                  String varName = executedVar.getVariable();
                  Variable var = sameDiff.getVariables().get(executedVar.getVariable());
                  //Find any ops (or variables with control dependencies) that this is required for execution of and check if now available for exec
                  List<String> l = sameDiff.getVariables().get(executedVar.getVariable()).getInputsForOp();

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

          /*******************************************************************************
           * Copyright (c) 2015-2018 Skymind, Inc.
           *
           * This program and the accompanying materials are made available under the
           * terms of the Apache License, Version 2.0 which is available at

            File CudaExecutioner.java has 1800 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /*******************************************************************************
             * Copyright (c) 2015-2018 Skymind, Inc.
             *
             * This program and the accompanying materials are made available under the
             * terms of the Apache License, Version 2.0 which is available at

              File StaticInfoDecoder.java has 1703 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /*******************************************************************************
               * Copyright (c) 2015-2018 Skymind, Inc.
               *
               * This program and the accompanying materials are made available under the
               * terms of the Apache License, Version 2.0 which is available at

                Shape has 226 methods (exceeds 20 allowed). Consider refactoring.
                Open

                public class Shape {
                
                
                    private Shape() {}
                
                

                  NativeOps has 209 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  public interface NativeOps {
                      /**
                       * This method allows you to specify minimal number of elements per thread/block during op call
                       * PLEASE NOTE: Changing this value might and will affect performance.
                       *

                    NDArrayFactory has 209 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                    public interface NDArrayFactory {
                    
                    
                        char FORTRAN = 'f';
                        char C = 'c';

                      File BaseSparseNDArray.java has 1561 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      /*******************************************************************************
                       * Copyright (c) 2015-2018 Skymind, Inc.
                       *
                       * This program and the accompanying materials are made available under the
                       * terms of the Apache License, Version 2.0 which is available at

                        SDMath has 199 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                        public class SDMath extends SDOps {
                            public SDMath(SameDiff sameDiff) {
                                super(sameDiff);
                            }
                        
                        

                          File NativeOpExecutioner.java has 1485 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          /*******************************************************************************
                           * Copyright (c) 2015-2018 Skymind, Inc.
                           *
                           * This program and the accompanying materials are made available under the
                           * terms of the Apache License, Version 2.0 which is available at

                            File StaticInfoEncoder.java has 1456 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            /*******************************************************************************
                             * Copyright (c) 2015-2018 Skymind, Inc.
                             *
                             * This program and the accompanying materials are made available under the
                             * terms of the Apache License, Version 2.0 which is available at

                              MultiLayerNetwork has 193 methods (exceeds 20 allowed). Consider refactoring.
                              Open

                              @Slf4j
                              public class MultiLayerNetwork implements Serializable, Classifier, Layer, NeuralNetwork {
                              
                                  //the hidden neural network layers (including output layer)
                                  protected Layer[] layers;

                                ComputationGraph has 190 methods (exceeds 20 allowed). Consider refactoring.
                                Open

                                @Slf4j
                                public class ComputationGraph implements Serializable, Model, NeuralNetwork {
                                
                                    protected ComputationGraphConfiguration configuration;
                                    protected boolean initCalled = false;
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language