deeplearning4j/deeplearning4j

View on GitHub

Showing 13,976 of 13,976 total issues

Method SDBaseOps has a Cognitive Complexity of 2008 (exceeds 20 allowed). Consider refactoring.
Open
  • Open
  • Confirmed
  • Invalid
  • Wontfix
Cancel

fun SDBaseOps() =  Namespace("BaseOps"){

    val keepDimsDoc = Mixin("keepDims"){
        Doc(Language.ANY, DocScope.ALL){
            """
Severity: Minor
Found in codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/SDBaseOps.kt - About 1 mo to fix

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 Math has a Cognitive Complexity of 1120 (exceeds 20 allowed). Consider refactoring.
Open
  • Open
  • Confirmed
  • Invalid
  • Wontfix
Cancel

fun Math() =  Namespace("Math") {
    Op("abs", transformSame) {
        javaOpClass = "Abs"
        Doc(Language.ANY, DocScope.ALL){
            """
Severity: Minor
Found in codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/Math.kt - About 3 wks to fix

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 TensorNamespace.java has 6609 lines of code (exceeds 250 allowed). Consider refactoring.
Open
  • Open
  • Confirmed
  • Invalid
  • Wontfix
Cancel

// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: tensor.proto

package org.nd4j.ir;

    File MapperNamespace.java has 6107 lines of code (exceeds 250 allowed). Consider refactoring.
    Open
    • Open
    • Confirmed
    • Invalid
    • Wontfix
    Cancel

    // Generated by the protocol buffer compiler.  DO NOT EDIT!
    // source: mapper.proto
    
    package org.nd4j.ir;
    
    

      Method SDCNN has a Cognitive Complexity of 664 (exceeds 20 allowed). Consider refactoring.
      Open
      • Open
      • Confirmed
      • Invalid
      • Wontfix
      Cancel

      fun SDCNN() =  Namespace("CNN"){
          val namespaceJavaPackage = "org.nd4j.linalg.api.ops.impl.layers.convolution"
      
          val dataFormat = Mixin("dataFormat"){
              Arg(ENUM, "dataFormat") { possibleValues = listOf("NCHW", "NHWC"); description = "Data format: \"NCHW\" or \"NHWC\"" }
      Severity: Minor
      Found in codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/CNN.kt - About 1 wk to fix

      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 BaseNDArray.java has 4162 lines of code (exceeds 250 allowed). Consider refactoring.
      Open
      • Open
      • Confirmed
      • Invalid
      • Wontfix
      Cancel

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

        File SameDiff.java has 4043 lines of code (exceeds 250 allowed). Consider refactoring.
        Open
        • Open
        • Confirmed
        • Invalid
        • Wontfix
        Cancel

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

          Nd4j has 507 methods (exceeds 20 allowed). Consider refactoring.
          Open
          • Open
          • Confirmed
          • Invalid
          • Wontfix
          Cancel

          @Slf4j
          public class Nd4j {
          
              /**
               * Bitwise namespace - operations related to bitwise manipulation of arrays

            Method NN has a Cognitive Complexity of 486 (exceeds 20 allowed). Consider refactoring.
            Open
            • Open
            • Confirmed
            • Invalid
            • Wontfix
            Cancel

            fun NN() = Namespace("NN") {
                val convPkg = "org.nd4j.linalg.api.ops.impl.layers.convolution"
            
                Op("batchNorm") {
                    javaPackage = convPkg

            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 doExtractArgDescriptors has 1853 lines of code (exceeds 25 allowed). Consider refactoring.
            Open
            • Open
            • Confirmed
            • Invalid
            • Wontfix
            Cancel

                @SneakyThrows
                public Map<String, List<ArgDescriptorProposal>> doExtractArgDescriptors() {
                    Map<String, List<ArgDescriptorProposal>> ret = new HashMap<>();
                    List<OpDeclarationDescriptor> opDeclarationDescriptors = new ArrayList<>();
                    Map<String,OpDeclarationDescriptor> descriptorMap = new HashMap<>();

              File Nd4j.java has 3147 lines of code (exceeds 250 allowed). Consider refactoring.
              Open
              • Open
              • Confirmed
              • Invalid
              • Wontfix
              Cancel

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

                File OpNamespace.java has 3049 lines of code (exceeds 250 allowed). Consider refactoring.
                Open
                • Open
                • Confirmed
                • Invalid
                • Wontfix
                Cancel

                // Generated by the protocol buffer compiler.  DO NOT EDIT!
                // source: op.proto
                
                package org.nd4j.ir;
                
                

                  File ArrayUtil.java has 3038 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open
                  • Open
                  • Confirmed
                  • Invalid
                  • Wontfix
                  Cancel

                  /*
                   *  ******************************************************************************
                   *  *
                   *  *
                   *  * This program and the accompanying materials are made available under the
                  Severity: Major
                  Found in nd4j/nd4j-common/src/main/java/org/nd4j/common/util/ArrayUtil.java - About 1 wk to fix

                    File ComputationGraph.java has 3001 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open
                    • Open
                    • Confirmed
                    • Invalid
                    • Wontfix
                    Cancel

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

                      BaseNDArray has 391 methods (exceeds 20 allowed). Consider refactoring.
                      Open
                      • Open
                      • Confirmed
                      • Invalid
                      • Wontfix
                      Cancel

                      @Slf4j
                      public abstract class BaseNDArray implements INDArray, Iterable {
                      
                          private static final long serialVersionUID = 3285982317165542614L;
                      
                      

                        SDMath has 370 methods (exceeds 20 allowed). Consider refactoring.
                        Open
                        • Open
                        • Confirmed
                        • Invalid
                        • Wontfix
                        Cancel

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

                          Method importGraph has a Cognitive Complexity of 359 (exceeds 20 allowed). Consider refactoring.
                          Open
                          • Open
                          • Confirmed
                          • Invalid
                          • Wontfix
                          Cancel

                              /**
                               * Import a Graph based on a {@link IRGraph} model from a GraphDef, with optional import overrides
                               *
                               * @param irGraph       IRGraph reflecting the needed model import
                               * @param importOverride Optional import override for specific ops, keyed by op 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

                          INDArray has 347 methods (exceeds 20 allowed). Consider refactoring.
                          Open
                          • Open
                          • Confirmed
                          • Invalid
                          • Wontfix
                          Cancel

                          public interface INDArray extends Serializable, AutoCloseable {
                              /**
                               * Returns the shape information debugging information
                               * @return the shape information.
                               */

                            ArrayUtil has 347 methods (exceeds 20 allowed). Consider refactoring.
                            Open
                            • Open
                            • Confirmed
                            • Invalid
                            • Wontfix
                            Cancel

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

                              File MultiLayerNetwork.java has 2498 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open
                              • Open
                              • Confirmed
                              • Invalid
                              • Wontfix
                              Cancel

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

                                File Shape.java has 2479 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open
                                • Open
                                • Confirmed
                                • Invalid
                                • Wontfix
                                Cancel

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

                                  SDBaseOps has 332 methods (exceeds 20 allowed). Consider refactoring.
                                  Open
                                  • Open
                                  • Confirmed
                                  • Invalid
                                  • Wontfix
                                  Cancel

                                  public class SDBaseOps {
                                    protected SameDiff sd;
                                  
                                    public SDBaseOps(SameDiff sameDiff) {
                                      this.sd = sameDiff;

                                    File WordVectorSerializer.java has 2252 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open
                                    • Open
                                    • Confirmed
                                    • Invalid
                                    • Wontfix
                                    Cancel

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

                                      NativeOps has 299 methods (exceeds 20 allowed). Consider refactoring.
                                      Open
                                      • Open
                                      • Confirmed
                                      • Invalid
                                      • Wontfix
                                      Cancel

                                      public interface NativeOps {
                                          int contextNumInputs(Pointer execTrace);
                                          int contextNumOutputs(Pointer execTrace);
                                      
                                          int numInputs(Pointer execTrace);

                                        File Libnd4jArgDescriptorSource.java has 2072 lines of code (exceeds 250 allowed). Consider refactoring.
                                        Open
                                        • Open
                                        • Confirmed
                                        • Invalid
                                        • Wontfix
                                        Cancel

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

                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                          Open
                                          • Open
                                          • Confirmed
                                          • Invalid
                                          • Wontfix
                                          Cancel

                                          /*
                                           *  ******************************************************************************
                                           *  *
                                           *  *
                                           *  * This program and the accompanying materials are made available under the
                                          nd4j/samediff-import/samediff-import-onnx/src/main/kotlin/org/nd4j/samediff/frameworkimport/onnx/definitions/implementations/Resize.kt on lines 1..201

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

                                          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
                                          • Open
                                          • Confirmed
                                          • Invalid
                                          • Wontfix
                                          Cancel

                                          /*
                                           *  ******************************************************************************
                                           *  *
                                           *  *
                                           *  * This program and the accompanying materials are made available under the
                                          nd4j/samediff-import/samediff-import-onnx/src/main/kotlin/org/nd4j/samediff/frameworkimport/onnx/definitions/implementations/ResizeNearest.kt on lines 1..201

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

                                          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 UpdateDecoder.java has 2025 lines of code (exceeds 250 allowed). Consider refactoring.
                                          Open
                                          • Open
                                          • Confirmed
                                          • Invalid
                                          • Wontfix
                                          Cancel

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

                                            SameDiff has 275 methods (exceeds 20 allowed). Consider refactoring.
                                            Open
                                            • Open
                                            • Confirmed
                                            • Invalid
                                            • Wontfix
                                            Cancel

                                            @Slf4j
                                            public class SameDiff extends SDBaseOps {
                                                protected static final String GRAD_FN_KEY = "grad";
                                            
                                                //Fields for graph structure and execution

                                              File SDMath.java has 1992 lines of code (exceeds 250 allowed). Consider refactoring.
                                              Open
                                              • Open
                                              • Confirmed
                                              • Invalid
                                              • Wontfix
                                              Cancel

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

                                                Method SDImage has a Cognitive Complexity of 278 (exceeds 20 allowed). Consider refactoring.
                                                Open
                                                • Open
                                                • Confirmed
                                                • Invalid
                                                • Wontfix
                                                Cancel

                                                fun SDImage() =  Namespace("Image"){
                                                    val namespaceJavaPackage = "org.nd4j.linalg.api.ops.custom"
                                                    Op("CropAndResize") {
                                                        javaPackage = "org.nd4j.linalg.api.ops.impl.image"
                                                        javaOpClass = "CropAndResize"
                                                Severity: Minor
                                                Found in codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/Image.kt - About 5 days to fix

                                                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 SDBaseOps.kt has 1949 lines of code (exceeds 250 allowed). Consider refactoring.
                                                Open
                                                • Open
                                                • Confirmed
                                                • Invalid
                                                • Wontfix
                                                Cancel

                                                /*
                                                 *  ******************************************************************************
                                                 *  *
                                                 *  *
                                                 *  * This program and the accompanying materials are made available under the
                                                Severity: Major
                                                Found in codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/SDBaseOps.kt - About 5 days to fix

                                                  File BaseDataBuffer.java has 1929 lines of code (exceeds 250 allowed). Consider refactoring.
                                                  Open
                                                  • Open
                                                  • Confirmed
                                                  • Invalid
                                                  • Wontfix
                                                  Cancel

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

                                                    Method SDLoss has a Cognitive Complexity of 267 (exceeds 20 allowed). Consider refactoring.
                                                    Open
                                                    • Open
                                                    • Confirmed
                                                    • Invalid
                                                    • Wontfix
                                                    Cancel

                                                    fun SDLoss() =  Namespace("Loss"){
                                                    
                                                        Op("absoluteDifference") {
                                                            javaPackage = "org.nd4j.linalg.api.ops.impl.loss"
                                                            javaOpClass = "AbsoluteDifferenceLoss"
                                                    Severity: Minor
                                                    Found in codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/SDLoss.kt - About 5 days to fix

                                                    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 SDBaseOps.java has 1790 lines of code (exceeds 250 allowed). Consider refactoring.
                                                    Open
                                                    • Open
                                                    • Confirmed
                                                    • Invalid
                                                    • Wontfix
                                                    Cancel

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

                                                      Method output has a Cognitive Complexity of 227 (exceeds 5 allowed). Consider refactoring.
                                                      Open
                                                      • Open
                                                      • Confirmed
                                                      • Invalid
                                                      • Wontfix
                                                      Cancel

                                                          public ExecutionResult output(@NonNull List<String> variables,
                                                                  Map<String, T> placeholderValues,
                                                                  Map<String, SDValue> otherPlaceHolderValues,
                                                                  MultiDataSet batch,
                                                                  Collection<String> requiredActivations,

                                                      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 SDRNN has a Cognitive Complexity of 240 (exceeds 20 allowed). Consider refactoring.
                                                      Open
                                                      • Open
                                                      • Confirmed
                                                      • Invalid
                                                      • Wontfix
                                                      Cancel

                                                      fun SDRNN() = Namespace("RNN") {
                                                      
                                                      
                                                          val LSTMConfiguration = Config("LSTMConfiguration") {
                                                      
                                                      
                                                      Severity: Minor
                                                      Found in codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/RNN.kt - About 4 days to fix

                                                      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 StaticInfoDecoder.java has 1703 lines of code (exceeds 250 allowed). Consider refactoring.
                                                      Open
                                                      • Open
                                                      • Confirmed
                                                      • Invalid
                                                      • Wontfix
                                                      Cancel

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

                                                        Shape has 229 methods (exceeds 20 allowed). Consider refactoring.
                                                        Open
                                                        • Open
                                                        • Confirmed
                                                        • Invalid
                                                        • Wontfix
                                                        Cancel

                                                        public class Shape {
                                                        
                                                        
                                                            private Shape() {}
                                                        
                                                        

                                                          Method importGraph has a Cognitive Complexity of 224 (exceeds 5 allowed). Consider refactoring.
                                                          Open
                                                          • Open
                                                          • Confirmed
                                                          • Invalid
                                                          • Wontfix
                                                          Cancel

                                                              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

                                                          File CudaExecutioner.java has 1612 lines of code (exceeds 250 allowed). Consider refactoring.
                                                          Open
                                                          • Open
                                                          • Confirmed
                                                          • Invalid
                                                          • Wontfix
                                                          Cancel

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

                                                            Method Linalg has a Cognitive Complexity of 226 (exceeds 20 allowed). Consider refactoring.
                                                            Open
                                                            • Open
                                                            • Confirmed
                                                            • Invalid
                                                            • Wontfix
                                                            Cancel

                                                            fun Linalg() =  Namespace("Linalg") {
                                                                //val namespaceJavaPackage = "org.nd4j.linalg"
                                                            
                                                                Op("Cholesky") {
                                                                    javaPackage = "org.nd4j.linalg.api.ops.impl.transforms"
                                                            Severity: Minor
                                                            Found in codegen/op-codegen/src/main/ops/org/nd4j/codegen/ops/Linalg.kt - About 4 days to fix

                                                            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

                                                            Builder has 214 methods (exceeds 20 allowed). Consider refactoring.
                                                            Open
                                                            • Open
                                                            • Confirmed
                                                            • Invalid
                                                            • Wontfix
                                                            Cancel

                                                                public static final class Builder extends
                                                                    org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<Builder> implements
                                                                    // @@protoc_insertion_point(builder_implements:org.nd4j.ir.MappingRule)
                                                                    org.nd4j.ir.MapperNamespace.MappingRuleOrBuilder {
                                                                  public static final org.nd4j.shade.protobuf.Descriptors.Descriptor

                                                              Method initAttributes has a Cognitive Complexity of 220 (exceeds 20 allowed). Consider refactoring.
                                                              Open
                                                              • Open
                                                              • Confirmed
                                                              • Invalid
                                                              • Wontfix
                                                              Cancel

                                                                  override fun <GRAPH_TYPE : GeneratedMessageV3, NODE_TYPE : GeneratedMessageV3, OP_DEF_TYPE : GeneratedMessageV3, TENSOR_TYPE : GeneratedMessageV3, ATTR_DEF_TYPE : GeneratedMessageV3, ATTR_VALUE_TYPE : GeneratedMessageV3, DATA_TYPE : ProtocolMessageEnum> initAttributes(
                                                                      df: DifferentialFunction,
                                                                      sd: SameDiff,
                                                                      descriptorAndContext: Pair<MappingContext<GRAPH_TYPE, NODE_TYPE, OP_DEF_TYPE, TENSOR_TYPE, ATTR_DEF_TYPE, ATTR_VALUE_TYPE, DATA_TYPE>, OpNamespace.OpDescriptor>
                                                                  ) {

                                                              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 BaseCudaDataBuffer.java has 1552 lines of code (exceeds 250 allowed). Consider refactoring.
                                                              Open
                                                              • Open
                                                              • Confirmed
                                                              • Invalid
                                                              • Wontfix
                                                              Cancel

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

                                                                NDArrayFactory has 202 methods (exceeds 20 allowed). Consider refactoring.
                                                                Open
                                                                • Open
                                                                • Confirmed
                                                                • Invalid
                                                                • Wontfix
                                                                Cancel

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

                                                                  Similar blocks of code found in 3 locations. Consider refactoring.
                                                                  Open
                                                                  • Open
                                                                  • Confirmed
                                                                  • Invalid
                                                                  • Wontfix
                                                                  Cancel

                                                                  /*
                                                                   *  ******************************************************************************
                                                                   *  *
                                                                   *  *
                                                                   *  * This program and the accompanying materials are made available under the
                                                                  nd4j/samediff-import/samediff-import-onnx/src/main/kotlin/org/nd4j/samediff/frameworkimport/onnx/rule/attribute/OnnxStringContainsAdapterRule.kt on lines 1..82
                                                                  nd4j/samediff-import/samediff-import-onnx/src/main/kotlin/org/nd4j/samediff/frameworkimport/onnx/rule/attribute/OnnxStringNotEqualsAdapterRule.kt on lines 1..84

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

                                                                  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 3 locations. Consider refactoring.
                                                                  Open
                                                                  • Open
                                                                  • Confirmed
                                                                  • Invalid
                                                                  • Wontfix
                                                                  Cancel

                                                                  /*
                                                                   *  ******************************************************************************
                                                                   *  *
                                                                   *  *
                                                                   *  * This program and the accompanying materials are made available under the
                                                                  nd4j/samediff-import/samediff-import-onnx/src/main/kotlin/org/nd4j/samediff/frameworkimport/onnx/rule/attribute/OnnxStringContainsAdapterRule.kt on lines 1..82
                                                                  nd4j/samediff-import/samediff-import-onnx/src/main/kotlin/org/nd4j/samediff/frameworkimport/onnx/rule/attribute/OnnxStringEqualsAdapterRule.kt on lines 1..87

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

                                                                  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 3 locations. Consider refactoring.
                                                                  Open
                                                                  • Open
                                                                  • Confirmed
                                                                  • Invalid
                                                                  • Wontfix
                                                                  Cancel

                                                                  /*
                                                                   *  ******************************************************************************
                                                                   *  *
                                                                   *  *
                                                                   *  * This program and the accompanying materials are made available under the
                                                                  nd4j/samediff-import/samediff-import-onnx/src/main/kotlin/org/nd4j/samediff/frameworkimport/onnx/rule/attribute/OnnxStringEqualsAdapterRule.kt on lines 1..87
                                                                  nd4j/samediff-import/samediff-import-onnx/src/main/kotlin/org/nd4j/samediff/frameworkimport/onnx/rule/attribute/OnnxStringNotEqualsAdapterRule.kt on lines 1..84

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

                                                                  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 12 locations. Consider refactoring.
                                                                  Open
                                                                  • Open
                                                                  • Confirmed
                                                                  • Invalid
                                                                  • Wontfix
                                                                  Cancel

                                                                  /*
                                                                   *  ******************************************************************************
                                                                   *  *
                                                                   *  *
                                                                   *  * This program and the accompanying materials are made available under the
                                                                  nd4j/samediff-import/samediff-import-onnx/src/main/kotlin/org/nd4j/samediff/frameworkimport/onnx/rule/attribute/OnnxArgDescriptorConstant.kt on lines 1..83
                                                                  nd4j/samediff-import/samediff-import-onnx/src/main/kotlin/org/nd4j/samediff/frameworkimport/onnx/rule/attribute/OnnxAttributeNDArrayToScalarAttribute.kt on lines 1..83
                                                                  nd4j/samediff-import/samediff-import-onnx/src/main/kotlin/org/nd4j/samediff/frameworkimport/onnx/rule/attribute/OnnxAttributeNumberListNDArray.kt on lines 1..86
                                                                  nd4j/samediff-import/samediff-import-onnx/src/main/kotlin/org/nd4j/samediff/frameworkimport/onnx/rule/attribute/OnnxAttributeScalarNDArrayAttribute.kt on lines 1..84
                                                                  nd4j/samediff-import/samediff-import-onnx/src/main/kotlin/org/nd4j/samediff/frameworkimport/onnx/rule/attribute/OnnxFlattenDims.kt on lines 1..84
                                                                  nd4j/samediff-import/samediff-import-onnx/src/main/kotlin/org/nd4j/samediff/frameworkimport/onnx/rule/attribute/OnnxListAttributeValueLookupToIndex.kt on lines 1..84
                                                                  nd4j/samediff-import/samediff-import-onnx/src/main/kotlin/org/nd4j/samediff/frameworkimport/onnx/rule/attribute/OnnxListNumberToNDArray.kt on lines 1..79
                                                                  nd4j/samediff-import/samediff-import-onnx/src/main/kotlin/org/nd4j/samediff/frameworkimport/onnx/rule/attribute/OnnxMapStringToInt.kt on lines 1..80
                                                                  nd4j/samediff-import/samediff-import-onnx/src/main/kotlin/org/nd4j/samediff/frameworkimport/onnx/rule/attribute/OnnxNDArrayInputToNumericalAttribute.kt on lines 1..81
                                                                  nd4j/samediff-import/samediff-import-onnx/src/main/kotlin/org/nd4j/samediff/frameworkimport/onnx/rule/attribute/OnnxStringAttributeToNDArray.kt on lines 1..82
                                                                  nd4j/samediff-import/samediff-import-onnx/src/main/kotlin/org/nd4j/samediff/frameworkimport/onnx/rule/attribute/OnnxStringToIndex.kt on lines 1..80

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

                                                                  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