deeplearning4j/deeplearning4j

View on GitHub
deeplearning4j/deeplearning4j-zoo/src/main/java/org/deeplearning4j/zoo/model/helper/InceptionResNetHelper.java

Summary

Maintainability
F
3 days
Test Coverage

Method inceptionV1ResA has 95 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static ComputationGraphConfiguration.GraphBuilder inceptionV1ResA(
                    ComputationGraphConfiguration.GraphBuilder graph, String blockName, int scale,
                    double activationScale, String input) {
        //        // first add the RELU activation layer
        //        graph.addLayer(nameLayer(blockName,"activation1",0), new ActivationLayer.Builder().activation(Activation.TANH).build(), input);

    Method inceptionV1ResB has 76 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static ComputationGraphConfiguration.GraphBuilder inceptionV1ResB(
                        ComputationGraphConfiguration.GraphBuilder graph, String blockName, int scale,
                        double activationScale, String input) {
            // first add the RELU activation layer
            graph.addLayer(nameLayer(blockName, "activation1", 0),

      Method inceptionV1ResC has 74 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static ComputationGraphConfiguration.GraphBuilder inceptionV1ResC(
                          ComputationGraphConfiguration.GraphBuilder graph, String blockName, int scale,
                          double activationScale, String input) {
              // loop and add each subsequent resnet blocks
              String previousBlock = input;

        File InceptionResNetHelper.java has 272 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

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

          Method inceptionV1ResB has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                              ComputationGraphConfiguration.GraphBuilder graph, String blockName, int scale,
                              double activationScale, String input) {

            Method inceptionV1ResA has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                                ComputationGraphConfiguration.GraphBuilder graph, String blockName, int scale,
                                double activationScale, String input) {

              Method inceptionV1ResC has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                                  ComputationGraphConfiguration.GraphBuilder graph, String blockName, int scale,
                                  double activationScale, String input) {

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                            graph
                                            // 1x1
                                            .addLayer(nameLayer(blockName, "cnn1", i),
                                                            new ConvolutionLayer.Builder(new int[] {1, 1})
                                                                            .convolutionMode(ConvolutionMode.Same).nIn(576).nOut(128)
                deeplearning4j/deeplearning4j-zoo/src/main/java/org/deeplearning4j/zoo/model/helper/InceptionResNetHelper.java on lines 275..313

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

                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

                            graph
                                            // 1x1
                                            .addLayer(nameLayer(blockName, "cnn1", i),
                                                            new ConvolutionLayer.Builder(new int[] {1, 1})
                                                                            .convolutionMode(ConvolutionMode.Same).nIn(1344).nOut(192)
                deeplearning4j/deeplearning4j-zoo/src/main/java/org/deeplearning4j/zoo/model/helper/InceptionResNetHelper.java on lines 179..217

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

                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

                Identical blocks of code found in 3 locations. Consider refactoring.
                Open

                            if (i == scale)
                                graph.addLayer(blockName, new ActivationLayer.Builder().activation(Activation.TANH).build(),
                                                nameLayer(blockName, "shortcut", i));
                            else
                                graph.addLayer(nameLayer(blockName, "activation", i),
                deeplearning4j/deeplearning4j-zoo/src/main/java/org/deeplearning4j/zoo/model/helper/InceptionResNetHelper.java on lines 147..153
                deeplearning4j/deeplearning4j-zoo/src/main/java/org/deeplearning4j/zoo/model/helper/InceptionResNetHelper.java on lines 343..349

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

                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

                Identical blocks of code found in 3 locations. Consider refactoring.
                Open

                            if (i == scale)
                                graph.addLayer(blockName, new ActivationLayer.Builder().activation(Activation.TANH).build(),
                                                nameLayer(blockName, "shortcut", i));
                            else
                                graph.addLayer(nameLayer(blockName, "activation", i),
                deeplearning4j/deeplearning4j-zoo/src/main/java/org/deeplearning4j/zoo/model/helper/InceptionResNetHelper.java on lines 247..253
                deeplearning4j/deeplearning4j-zoo/src/main/java/org/deeplearning4j/zoo/model/helper/InceptionResNetHelper.java on lines 343..349

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

                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

                Identical blocks of code found in 3 locations. Consider refactoring.
                Open

                            if (i == scale)
                                graph.addLayer(blockName, new ActivationLayer.Builder().activation(Activation.TANH).build(),
                                                nameLayer(blockName, "shortcut", i));
                            else
                                graph.addLayer(nameLayer(blockName, "activation", i),
                deeplearning4j/deeplearning4j-zoo/src/main/java/org/deeplearning4j/zoo/model/helper/InceptionResNetHelper.java on lines 147..153
                deeplearning4j/deeplearning4j-zoo/src/main/java/org/deeplearning4j/zoo/model/helper/InceptionResNetHelper.java on lines 247..253

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

                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

                There are no issues that match your filters.

                Category
                Status