deeplearning4j/deeplearning4j

View on GitHub

Showing 6,577 of 14,310 total issues

File Evaluation.java has 1132 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

    SDVariable has 147 methods (exceeds 20 allowed). Consider refactoring.
    Open

    @Data
    @NoArgsConstructor
    @Slf4j
    public class SDVariable implements Serializable {
    
    

      Method fit has a Cognitive Complexity of 141 (exceeds 5 allowed). Consider refactoring.
      Open

          protected EarlyStoppingResult<T> fit(boolean pretrain){
              esConfig.validate();
              log.info("Starting early stopping training");
              if (esConfig.getScoreCalculator() == null)
                  log.warn("No score calculator provided for early stopping. Score will be reported as 0.0 to epoch termination conditions");

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

          @Override
          public void encode(MutableDirectBuffer buffer) {
              MessageHeaderEncoder enc = new MessageHeaderEncoder();
              UpdateEncoder ue = new UpdateEncoder();
      
      

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

          private synchronized void getOverviewDataForSession(String sessionId, RoutingContext rc) {
              Long lastUpdateTime = getLastUpdateTime(sessionId);
              I18N i18N = getI18N(sessionId);
      
              //First pass (optimize later): query all data...

      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

      CudaDataBufferFactory has 133 methods (exceeds 20 allowed). Consider refactoring.
      Open

      @Slf4j
      public class CudaDataBufferFactory implements DataBufferFactory {
          protected DataBuffer.AllocationMode allocationMode;
      
          @Override

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

            public static boolean checkGradients(SameDiff sd, Map<String,INDArray> placeholderValues, double eps, double maxRelError, double minAbsError, boolean print,
                                                 boolean exitOnFirstFailure, boolean skipValidation, boolean debugMode, Set<String> skipVariables, Map<String,INDArray> gradCheckMask,
                                                 int maxPerParam, Subset subset){
        
                boolean debugBefore = sd.isDebugMode();

        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

        DefaultDataBufferFactory has 131 methods (exceeds 20 allowed). Consider refactoring.
        Open

        public class DefaultDataBufferFactory implements DataBufferFactory {
            protected DataBuffer.AllocationMode allocationMode;
        
        
            @Override

          DataBufferFactory has 131 methods (exceeds 20 allowed). Consider refactoring.
          Open

          public interface DataBufferFactory {
          
              /**
               * Setter for the allocation mode
               * @param allocationMode

            Method fillNDArray has a Cognitive Complexity of 126 (exceeds 5 allowed). Consider refactoring.
            Open

                protected void fillNDArray(Mat image, INDArray ret) {
                    long rows = image.rows();
                    long cols = image.cols();
                    long channels = image.channels();
            
            

            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

            NDBase has 129 methods (exceeds 20 allowed). Consider refactoring.
            Open

            public class NDBase {
              public NDBase() {
              }
            
              /**

              File JCublasNDArrayFactory.java has 1002 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

                Method calcBackpropGradients has a Cognitive Complexity of 122 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected void calcBackpropGradients(boolean clearLayers, boolean truncatedBPTT, INDArray... externalEpsilons) {
                        if (flattenedGradients == null) {
                            initGradientsView();
                        }
                
                

                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

                Transforms has 126 methods (exceeds 20 allowed). Consider refactoring.
                Open

                public class Transforms {
                
                
                    private Transforms() {
                    }

                  File OpValidation.java has 979 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 SbeStatsReport.java has 972 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

                      Method outputOfLayersDetached has a Cognitive Complexity of 119 (exceeds 5 allowed). Consider refactoring.
                      Open

                          protected INDArray[] outputOfLayersDetached(boolean train, @NonNull FwdPassType fwdPassType, @NonNull int[] layerIndexes, @NonNull INDArray[] features,
                                                                      INDArray[] fMask, INDArray[] lMasks, boolean clearLayerInputs, boolean detachedInputs, MemoryWorkspace outputWorkspace){
                              if(features.length != numInputArrays){
                                  throw new IllegalArgumentException("Invalid number of input arrays: network has " + numInputArrays
                                          + " inputs, got " + features.length + " input arrays");

                      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

                      NDMath has 123 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                      public class NDMath {
                        public NDMath() {
                        }
                      
                        /**

                        FlatNode has 122 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                        @SuppressWarnings("unused")
                        public final class FlatNode extends Table {
                          public static FlatNode getRootAsFlatNode(ByteBuffer _bb) { return getRootAsFlatNode(_bb, new FlatNode()); }
                          public static FlatNode getRootAsFlatNode(ByteBuffer _bb, FlatNode obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
                          public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; }
                        Severity: Major
                        Found in libnd4j/include/graph/generated/nd4j/graph/FlatNode.java - About 2 days to fix

                          FlatNode has 122 methods (exceeds 20 allowed). Consider refactoring.
                          Open

                          @SuppressWarnings("unused")
                          public final class FlatNode extends Table {
                            public static FlatNode getRootAsFlatNode(ByteBuffer _bb) { return getRootAsFlatNode(_bb, new FlatNode()); }
                            public static FlatNode getRootAsFlatNode(ByteBuffer _bb, FlatNode obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
                            public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; }
                            Severity
                            Category
                            Status
                            Source
                            Language