deeplearning4j/deeplearning4j

View on GitHub

Showing 6,111 of 13,975 total issues

Method walk has a Cognitive Complexity of 100 (exceeds 5 allowed). Consider refactoring.
Open

    protected Sequence<V> walk(Vertex<V> node, int cDepth) {
        Sequence<V> sequence = new Sequence<>();

        int idx = node.vertexID();
        List<Vertex<V>> vertices = sourceGraph.getConnectedVertices(idx);

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

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

    Method preOpExecution has a Cognitive Complexity of 99 (exceeds 5 allowed). Consider refactoring.
    Open

        @Override
        public void preOpExecution(SameDiff sd, At at, SameDiffOp op, OpContext opContext) {
            if(lastIter != at.iteration()){
                lastIter = at.iteration();
                stepThisIter = 0;

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

        @Override
        public PartitionMetaData write(List<Writable> record) throws IOException {
            if (!record.isEmpty()) {
                List<Writable> recordList = record instanceof List ? (List<Writable>) record : new ArrayList<>(record);
    
    

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

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

      File VariationalAutoencoder.java has 818 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

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

        File Nd4jNamespaceGenerator.java has 808 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

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

          File NDBase.java has 790 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

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

            Function ChartScatter has a Cognitive Complexity of 93 (exceeds 5 allowed). Consider refactoring.
            Open

            var ChartScatter = (function (_super) {
                __extends(ChartScatter, _super);
                function ChartScatter(jsonStr) {
                    var _this = _super.call(this, ComponentType.ChartScatter, 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

            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
                      Severity
                      Category
                      Status
                      Source
                      Language