deeplearning4j/deeplearning4j

View on GitHub

Showing 13,638 of 13,638 total issues

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

File WordVectorSerializer.java has 1985 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

    ArrayUtil has 262 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

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

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

        File CudaExecutioner.java has 1899 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 DifferentialFunctionFactory.java has 1867 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

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

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

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

                public class Shape {
                
                
                    private Shape() {}
                
                

                  Method importGraph has a Cognitive Complexity of 212 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static SameDiff importGraph(@NonNull GraphDef tfGraph, Map<String, TFImportOverride> importOverride, TFOpImportFilter opFilter) {
                  
                          /*
                          First, build an in-memory representation of the graph that allows us to build the graph incrementally
                          If we can build the graph incrementally, we can make sure that the added variables are set up with the correct

                  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

                  NativeOps has 215 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.
                       *

                    File NativeOpExecutioner.java has 1548 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 203 methods (exceeds 20 allowed). Consider refactoring.
                      Open

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

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

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

                          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;

                              File TrainModule.java has 1432 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              /* ******************************************************************************
                               * Copyright (c) 2015-2018 Skymind, Inc.
                               * Copyright (c) 2019 Konduit K.K.
                               *
                               * This program and the accompanying materials are made available under the

                                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;

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

                                  Severity: Major
                                  Found in libnd4j/include/graph/generated/nd4j/graph/LongTriple.py and 1 other location - About 3 days to fix
                                  libnd4j/include/graph/generated/nd4j/graph/IntTriple.py on lines 0..46

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

                                  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

                                  Severity: Major
                                  Found in libnd4j/include/graph/generated/nd4j/graph/IntTriple.py and 1 other location - About 3 days to fix
                                  libnd4j/include/graph/generated/nd4j/graph/LongTriple.py on lines 0..46

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

                                  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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language