tensorflow/models

View on GitHub
research/slim/nets/inception_v3.py

Summary

Maintainability
F
1 mo
Test Coverage

File inception_v3.py has 493 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Severity: Minor
Found in research/slim/nets/inception_v3.py - About 7 hrs to fix

    Function inception_v3_base has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

    def inception_v3_base(inputs,
                          final_endpoint='Mixed_7c',
                          min_depth=16,
                          depth_multiplier=1.0,
                          scope=None):
    Severity: Minor
    Found in research/slim/nets/inception_v3.py - About 2 hrs 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

    Function inception_v3 has 12 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def inception_v3(inputs,
    Severity: Major
    Found in research/slim/nets/inception_v3.py - About 1 hr to fix

      Function inception_v3 has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      def inception_v3(inputs,
                       num_classes=1000,
                       is_training=True,
                       dropout_keep_prob=0.8,
                       min_depth=16,
      Severity: Minor
      Found in research/slim/nets/inception_v3.py - About 55 mins 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

      Avoid deeply nested control flow statements.
      Open

                with tf.variable_scope('AuxLogits'):
                  aux_logits = slim.avg_pool2d(
                      aux_logits, [5, 5], stride=3, padding='VALID',
                      scope='AvgPool_1a_5x5')
                  aux_logits = slim.conv2d(aux_logits, depth(128), [1, 1],
      Severity: Major
      Found in research/slim/nets/inception_v3.py - About 45 mins to fix

        Function inception_v3_base has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def inception_v3_base(inputs,
        Severity: Minor
        Found in research/slim/nets/inception_v3.py - About 35 mins to fix

          Avoid too many return statements within this function.
          Open

                if end_point == final_endpoint: return net, end_points
          Severity: Major
          Found in research/slim/nets/inception_v3.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                  if end_point == final_endpoint: return net, end_points
            Severity: Major
            Found in research/slim/nets/inception_v3.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                    if end_point == final_endpoint: return net, end_points
              Severity: Major
              Found in research/slim/nets/inception_v3.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                      if end_point == final_endpoint: return net, end_points
                Severity: Major
                Found in research/slim/nets/inception_v3.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                        if end_point == final_endpoint: return net, end_points
                  Severity: Major
                  Found in research/slim/nets/inception_v3.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                          if end_point == final_endpoint: return net, end_points
                    Severity: Major
                    Found in research/slim/nets/inception_v3.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                            if end_point == final_endpoint: return net, end_points
                      Severity: Major
                      Found in research/slim/nets/inception_v3.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                              if end_point == final_endpoint: return net, end_points
                        Severity: Major
                        Found in research/slim/nets/inception_v3.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                if end_point == final_endpoint: return net, end_points
                          Severity: Major
                          Found in research/slim/nets/inception_v3.py - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                  if end_point == final_endpoint: return net, end_points
                            Severity: Major
                            Found in research/slim/nets/inception_v3.py - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                    if end_point == final_endpoint: return net, end_points
                              Severity: Major
                              Found in research/slim/nets/inception_v3.py - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                      if end_point == final_endpoint: return net, end_points
                                Severity: Major
                                Found in research/slim/nets/inception_v3.py - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                        if end_point == final_endpoint: return net, end_points
                                  Severity: Major
                                  Found in research/slim/nets/inception_v3.py - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                          if end_point == final_endpoint: return net, end_points
                                    Severity: Major
                                    Found in research/slim/nets/inception_v3.py - About 30 mins to fix

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

                                            with tf.variable_scope(end_point):
                                              with tf.variable_scope('Branch_0'):
                                                branch_0 = slim.conv2d(net, depth(192), [1, 1], scope='Conv2d_0a_1x1')
                                              with tf.variable_scope('Branch_1'):
                                                branch_1 = slim.conv2d(net, depth(128), [1, 1], scope='Conv2d_0a_1x1')
                                      Severity: Major
                                      Found in research/slim/nets/inception_v3.py and 3 other locations - About 3 days to fix
                                      research/slim/nets/inception_v3.py on lines 264..287
                                      research/slim/nets/inception_v3.py on lines 292..315
                                      research/slim/nets/inception_v3.py on lines 321..344

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

                                      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 4 locations. Consider refactoring.
                                      Open

                                            with tf.variable_scope(end_point):
                                              with tf.variable_scope('Branch_0'):
                                                branch_0 = slim.conv2d(net, depth(192), [1, 1], scope='Conv2d_0a_1x1')
                                              with tf.variable_scope('Branch_1'):
                                                branch_1 = slim.conv2d(net, depth(160), [1, 1], scope='Conv2d_0a_1x1')
                                      Severity: Major
                                      Found in research/slim/nets/inception_v3.py and 3 other locations - About 3 days to fix
                                      research/slim/nets/inception_v3.py on lines 235..258
                                      research/slim/nets/inception_v3.py on lines 292..315
                                      research/slim/nets/inception_v3.py on lines 321..344

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

                                      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 4 locations. Consider refactoring.
                                      Open

                                            with tf.variable_scope(end_point):
                                              with tf.variable_scope('Branch_0'):
                                                branch_0 = slim.conv2d(net, depth(192), [1, 1], scope='Conv2d_0a_1x1')
                                              with tf.variable_scope('Branch_1'):
                                                branch_1 = slim.conv2d(net, depth(160), [1, 1], scope='Conv2d_0a_1x1')
                                      Severity: Major
                                      Found in research/slim/nets/inception_v3.py and 3 other locations - About 3 days to fix
                                      research/slim/nets/inception_v3.py on lines 235..258
                                      research/slim/nets/inception_v3.py on lines 264..287
                                      research/slim/nets/inception_v3.py on lines 321..344

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

                                      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 4 locations. Consider refactoring.
                                      Open

                                            with tf.variable_scope(end_point):
                                              with tf.variable_scope('Branch_0'):
                                                branch_0 = slim.conv2d(net, depth(192), [1, 1], scope='Conv2d_0a_1x1')
                                              with tf.variable_scope('Branch_1'):
                                                branch_1 = slim.conv2d(net, depth(192), [1, 1], scope='Conv2d_0a_1x1')
                                      Severity: Major
                                      Found in research/slim/nets/inception_v3.py and 3 other locations - About 3 days to fix
                                      research/slim/nets/inception_v3.py on lines 235..258
                                      research/slim/nets/inception_v3.py on lines 264..287
                                      research/slim/nets/inception_v3.py on lines 292..315

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

                                      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

                                            with tf.variable_scope(end_point):
                                              with tf.variable_scope('Branch_0'):
                                                branch_0 = slim.conv2d(net, depth(320), [1, 1], scope='Conv2d_0a_1x1')
                                              with tf.variable_scope('Branch_1'):
                                                branch_1 = slim.conv2d(net, depth(384), [1, 1], scope='Conv2d_0a_1x1')
                                      Severity: Major
                                      Found in research/slim/nets/inception_v3.py and 1 other location - About 3 days to fix
                                      research/slim/nets/inception_v3.py on lines 371..390

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

                                      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

                                            with tf.variable_scope(end_point):
                                              with tf.variable_scope('Branch_0'):
                                                branch_0 = slim.conv2d(net, depth(320), [1, 1], scope='Conv2d_0a_1x1')
                                              with tf.variable_scope('Branch_1'):
                                                branch_1 = slim.conv2d(net, depth(384), [1, 1], scope='Conv2d_0a_1x1')
                                      Severity: Major
                                      Found in research/slim/nets/inception_v3.py and 1 other location - About 3 days to fix
                                      research/slim/nets/inception_v3.py on lines 396..415

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

                                      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

                                            with tf.variable_scope(end_point):
                                              with tf.variable_scope('Branch_0'):
                                                branch_0 = slim.conv2d(net, depth(64), [1, 1], scope='Conv2d_0a_1x1')
                                              with tf.variable_scope('Branch_1'):
                                                branch_1 = slim.conv2d(net, depth(48), [1, 1], scope='Conv2d_0b_1x1')
                                      Severity: Major
                                      Found in research/slim/nets/inception_v3.py and 2 other locations - About 2 days to fix
                                      research/slim/nets/inception_v3.py on lines 146..163
                                      research/slim/nets/inception_v3.py on lines 193..210

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

                                      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

                                            with tf.variable_scope(end_point):
                                              with tf.variable_scope('Branch_0'):
                                                branch_0 = slim.conv2d(net, depth(64), [1, 1], scope='Conv2d_0a_1x1')
                                              with tf.variable_scope('Branch_1'):
                                                branch_1 = slim.conv2d(net, depth(48), [1, 1], scope='Conv2d_0a_1x1')
                                      Severity: Major
                                      Found in research/slim/nets/inception_v3.py and 2 other locations - About 2 days to fix
                                      research/slim/nets/inception_v3.py on lines 169..187
                                      research/slim/nets/inception_v3.py on lines 193..210

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

                                      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

                                            with tf.variable_scope(end_point):
                                              with tf.variable_scope('Branch_0'):
                                                branch_0 = slim.conv2d(net, depth(64), [1, 1], scope='Conv2d_0a_1x1')
                                              with tf.variable_scope('Branch_1'):
                                                branch_1 = slim.conv2d(net, depth(48), [1, 1], scope='Conv2d_0a_1x1')
                                      Severity: Major
                                      Found in research/slim/nets/inception_v3.py and 2 other locations - About 2 days to fix
                                      research/slim/nets/inception_v3.py on lines 146..163
                                      research/slim/nets/inception_v3.py on lines 169..187

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

                                      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

                                            with tf.variable_scope('Logits'):
                                              if global_pool:
                                                # Global average pooling.
                                                net = tf.reduce_mean(
                                                    input_tensor=net, axis=[1, 2], keepdims=True, name='GlobalPool')
                                      Severity: Major
                                      Found in research/slim/nets/inception_v3.py and 1 other location - About 1 day to fix
                                      research/slim/nets/inception_v2.py on lines 536..556

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

                                      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

                                      def _reduced_kernel_size_for_small_input(input_tensor, kernel_size):
                                        """Define kernel size which is automatically reduced for small input.
                                      
                                        If the shape of the input images is unknown at graph construction time this
                                        function assumes that the input images are is large enough.
                                      Severity: Major
                                      Found in research/slim/nets/inception_v3.py and 2 other locations - About 6 hrs to fix
                                      research/slim/nets/inception_v2.py on lines 563..591
                                      research/slim/nets/mobilenet_v1.py on lines 406..425

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

                                      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 6 locations. Consider refactoring.
                                      Open

                                              with tf.variable_scope('Branch_2'):
                                                branch_2 = slim.max_pool2d(net, [3, 3], stride=2, padding='VALID',
                                      Severity: Major
                                      Found in research/slim/nets/inception_v3.py and 5 other locations - About 45 mins to fix
                                      research/slim/nets/inception_v3.py on lines 363..364
                                      research/slim/nets/inception_v4.py on lines 70..71
                                      research/slim/nets/inception_v4.py on lines 118..119
                                      research/slim/nets/inception_v4.py on lines 193..194
                                      research/slim/nets/inception_v4.py on lines 222..223

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

                                      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 6 locations. Consider refactoring.
                                      Open

                                              with tf.variable_scope('Branch_2'):
                                                branch_2 = slim.max_pool2d(net, [3, 3], stride=2, padding='VALID',
                                      Severity: Major
                                      Found in research/slim/nets/inception_v3.py and 5 other locations - About 45 mins to fix
                                      research/slim/nets/inception_v3.py on lines 226..227
                                      research/slim/nets/inception_v4.py on lines 70..71
                                      research/slim/nets/inception_v4.py on lines 118..119
                                      research/slim/nets/inception_v4.py on lines 193..194
                                      research/slim/nets/inception_v4.py on lines 222..223

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

                                      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