deeplearning4j/deeplearning4j

View on GitHub
deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/layers/convolutional/KerasConvolutionUtils.java

Summary

Maintainability
D
2 days
Test Coverage

Method getPaddingFromConfig has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    static int[] getPaddingFromConfig(Map<String, Object> layerConfig,
                                      KerasLayerConfiguration conf,
                                      String layerField,
                                      int dimension)
            throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException {

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

    public static int[] getKernelSizeFromConfig(Map<String, Object> layerConfig, int dimension,
                                                KerasLayerConfiguration conf, int kerasMajorVersion)
            throws InvalidKerasConfigurationException {
        Map<String, Object> innerConfig = KerasLayerUtils.getInnerLayerConfigFromConfig(layerConfig, conf);
        int[] kernelSize;

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

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

    Method getPaddingFromConfig has 62 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        static int[] getPaddingFromConfig(Map<String, Object> layerConfig,
                                          KerasLayerConfiguration conf,
                                          String layerField,
                                          int dimension)
                throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException {

      Method getKernelSizeFromConfig has 60 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static int[] getKernelSizeFromConfig(Map<String, Object> layerConfig, int dimension,
                                                      KerasLayerConfiguration conf, int kerasMajorVersion)
                  throws InvalidKerasConfigurationException {
              Map<String, Object> innerConfig = KerasLayerUtils.getInnerLayerConfigFromConfig(layerConfig, conf);
              int[] kernelSize;

        Method getStrideFromConfig has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            public static int[] getStrideFromConfig(Map<String, Object> layerConfig, int dimension,
                                                    KerasLayerConfiguration conf)
                    throws InvalidKerasConfigurationException {
                Map<String, Object> innerConfig = KerasLayerUtils.getInnerLayerConfigFromConfig(layerConfig, conf);
                int[] strides;

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

            public static int[] getDilationRate(Map<String, Object> layerConfig, int dimension, KerasLayerConfiguration conf,
                                                boolean forceDilation)
                    throws InvalidKerasConfigurationException {
                Map<String, Object> innerConfig = KerasLayerUtils.getInnerLayerConfigFromConfig(layerConfig, conf);
                int[] atrousRate;

        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 getStrideFromConfig has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static int[] getStrideFromConfig(Map<String, Object> layerConfig, int dimension,
                                                    KerasLayerConfiguration conf)
                    throws InvalidKerasConfigurationException {
                Map<String, Object> innerConfig = KerasLayerUtils.getInnerLayerConfigFromConfig(layerConfig, conf);
                int[] strides;

          Method getUpsamplingSizeFromConfig has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              static int[] getUpsamplingSizeFromConfig(Map<String, Object> layerConfig, int dimension,
                                                       KerasLayerConfiguration conf)
                      throws InvalidKerasConfigurationException {
                  Map<String, Object> innerConfig = KerasLayerUtils.getInnerLayerConfigFromConfig(layerConfig, conf);
                  int[] size;

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

              public static ConvolutionMode getConvolutionModeFromConfig(Map<String, Object> layerConfig,
                                                                         KerasLayerConfiguration conf)
                      throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException {
                  Map<String, Object> innerConfig = KerasLayerUtils.getInnerLayerConfigFromConfig(layerConfig, conf);
                  if (!innerConfig.containsKey(conf.getLAYER_FIELD_BORDER_MODE()))

          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

          There are no issues that match your filters.

          Category
          Status