deeplearning4j/deeplearning4j

View on GitHub
deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/main/java/org/deeplearning4j/ui/module/train/TrainModuleUtils.java

Summary

Maintainability
C
1 day
Test Coverage

Method buildGraphInfo has 90 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static GraphInfo buildGraphInfo(NeuralNetConfiguration config) {

        List<String> vertexNames = new ArrayList<>();
        List<String> originalVertexName = new ArrayList<>();
        List<String> layerTypes = new ArrayList<>();

    Method buildGraphInfo has 46 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static GraphInfo buildGraphInfo(ComputationGraphConfiguration config) {
            List<String> layerNames = new ArrayList<>();
            List<String> layerTypes = new ArrayList<>();
            List<List<Integer>> layerInputs = new ArrayList<>();
            List<Map<String, String>> layerInfo = new ArrayList<>();

      Method buildGraphInfo has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          public static GraphInfo buildGraphInfo(NeuralNetConfiguration config) {
      
              List<String> vertexNames = new ArrayList<>();
              List<String> originalVertexName = new ArrayList<>();
              List<String> layerTypes = new ArrayList<>();

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

          public static GraphInfo buildGraphInfo(MultiLayerConfiguration config) {
              List<String> vertexNames = new ArrayList<>();
              List<String> originalVertexName = new ArrayList<>();
              List<String> layerTypes = new ArrayList<>();
              List<List<Integer>> layerInputs = new ArrayList<>();

        Method getLayerInfo has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private static Map<String, String> getLayerInfo(NeuralNetConfiguration c, Layer layer) {
                Map<String, String> map = new LinkedHashMap<>();
        
                if (layer instanceof FeedForwardLayer) {
                    FeedForwardLayer layer1 = (FeedForwardLayer) layer;

          Method buildGraphInfo has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public static GraphInfo buildGraphInfo(ComputationGraphConfiguration config) {
                  List<String> layerNames = new ArrayList<>();
                  List<String> layerTypes = new ArrayList<>();
                  List<List<Integer>> layerInputs = new ArrayList<>();
                  List<Map<String, String>> layerInfo = new ArrayList<>();

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

              private static Map<String, String> getLayerInfo(NeuralNetConfiguration c, Layer layer) {
                  Map<String, String> map = new LinkedHashMap<>();
          
                  if (layer instanceof FeedForwardLayer) {
                      FeedForwardLayer layer1 = (FeedForwardLayer) layer;

          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