tensorflow/models

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

Summary

Maintainability
F
3 wks
Test Coverage

File inception_v1.py has 297 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_v1.py - About 3 hrs to fix

    Function inception_v1_base has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

    def inception_v1_base(inputs,
                          final_endpoint='Mixed_5c',
                          include_root_block=True,
                          scope='InceptionV1'):
      """Defines the Inception V1 base architecture.
    Severity: Minor
    Found in research/slim/nets/inception_v1.py - About 3 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_v1 has 9 arguments (exceeds 4 allowed). Consider refactoring.
    Open

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

      Avoid deeply nested control flow statements.
      Open

                with tf.variable_scope('Branch_0'):
                  branch_0 = slim.conv2d(net, 128, [1, 1], scope='Conv2d_0a_1x1')
                with tf.variable_scope('Branch_1'):
      Severity: Major
      Found in research/slim/nets/inception_v1.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                  with tf.variable_scope('Branch_2'):
                    branch_2 = slim.conv2d(net, 24, [1, 1], scope='Conv2d_0a_1x1')
                    branch_2 = slim.conv2d(branch_2, 64, [3, 3], scope='Conv2d_0b_3x3')
                  with tf.variable_scope('Branch_3'):
        Severity: Major
        Found in research/slim/nets/inception_v1.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                    with tf.variable_scope('Branch_2'):
                      branch_2 = slim.conv2d(net, 32, [1, 1], scope='Conv2d_0a_1x1')
                      branch_2 = slim.conv2d(branch_2, 64, [3, 3], scope='Conv2d_0b_3x3')
                    with tf.variable_scope('Branch_3'):
          Severity: Major
          Found in research/slim/nets/inception_v1.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                      with tf.variable_scope('Branch_1'):
                        branch_1 = slim.conv2d(net, 160, [1, 1], scope='Conv2d_0a_1x1')
                        branch_1 = slim.conv2d(branch_1, 320, [3, 3], scope='Conv2d_0b_3x3')
                      with tf.variable_scope('Branch_2'):
            Severity: Major
            Found in research/slim/nets/inception_v1.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                        with tf.variable_scope('Branch_2'):
                          branch_2 = slim.conv2d(net, 16, [1, 1], scope='Conv2d_0a_1x1')
                          branch_2 = slim.conv2d(branch_2, 32, [3, 3], scope='Conv2d_0b_3x3')
                        with tf.variable_scope('Branch_3'):
              Severity: Major
              Found in research/slim/nets/inception_v1.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                          with tf.variable_scope('Branch_2'):
                            branch_2 = slim.conv2d(net, 32, [1, 1], scope='Conv2d_0a_1x1')
                            branch_2 = slim.conv2d(branch_2, 96, [3, 3], scope='Conv2d_0b_3x3')
                          with tf.variable_scope('Branch_3'):
                Severity: Major
                Found in research/slim/nets/inception_v1.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                            with tf.variable_scope('Branch_2'):
                              branch_2 = slim.conv2d(net, 16, [1, 1], scope='Conv2d_0a_1x1')
                              branch_2 = slim.conv2d(branch_2, 48, [3, 3], scope='Conv2d_0b_3x3')
                            with tf.variable_scope('Branch_3'):
                  Severity: Major
                  Found in research/slim/nets/inception_v1.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                              with tf.variable_scope('Branch_3'):
                                branch_3 = slim.max_pool2d(net, [3, 3], scope='MaxPool_0a_3x3')
                                branch_3 = slim.conv2d(branch_3, 64, [1, 1], scope='Conv2d_0b_1x1')
                              net = tf.concat(
                    Severity: Major
                    Found in research/slim/nets/inception_v1.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                with tf.variable_scope('Branch_1'):
                                  branch_1 = slim.conv2d(net, 128, [1, 1], scope='Conv2d_0a_1x1')
                                  branch_1 = slim.conv2d(branch_1, 256, [3, 3], scope='Conv2d_0b_3x3')
                                with tf.variable_scope('Branch_2'):
                      Severity: Major
                      Found in research/slim/nets/inception_v1.py - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                  with tf.variable_scope('Branch_3'):
                                    branch_3 = slim.max_pool2d(net, [3, 3], scope='MaxPool_0a_3x3')
                                    branch_3 = slim.conv2d(branch_3, 128, [1, 1], scope='Conv2d_0b_1x1')
                                  net = tf.concat(
                        Severity: Major
                        Found in research/slim/nets/inception_v1.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                    with tf.variable_scope('Branch_0'):
                                      branch_0 = slim.conv2d(net, 384, [1, 1], scope='Conv2d_0a_1x1')
                                    with tf.variable_scope('Branch_1'):
                          Severity: Major
                          Found in research/slim/nets/inception_v1.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                      with tf.variable_scope('Branch_1'):
                                        branch_1 = slim.conv2d(net, 144, [1, 1], scope='Conv2d_0a_1x1')
                                        branch_1 = slim.conv2d(branch_1, 288, [3, 3], scope='Conv2d_0b_3x3')
                                      with tf.variable_scope('Branch_2'):
                            Severity: Major
                            Found in research/slim/nets/inception_v1.py - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                        with tf.variable_scope('Branch_3'):
                                          branch_3 = slim.max_pool2d(net, [3, 3], scope='MaxPool_0a_3x3')
                                          branch_3 = slim.conv2d(branch_3, 32, [1, 1], scope='Conv2d_0b_1x1')
                                        net = tf.concat(
                              Severity: Major
                              Found in research/slim/nets/inception_v1.py - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                          with tf.variable_scope('Branch_1'):
                                            branch_1 = slim.conv2d(net, 96, [1, 1], scope='Conv2d_0a_1x1')
                                            branch_1 = slim.conv2d(branch_1, 128, [3, 3], scope='Conv2d_0b_3x3')
                                          with tf.variable_scope('Branch_2'):
                                Severity: Major
                                Found in research/slim/nets/inception_v1.py - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                            with tf.variable_scope('Branch_2'):
                                              branch_2 = slim.conv2d(net, 24, [1, 1], scope='Conv2d_0a_1x1')
                                              branch_2 = slim.conv2d(branch_2, 64, [3, 3], scope='Conv2d_0b_3x3')
                                            with tf.variable_scope('Branch_3'):
                                  Severity: Major
                                  Found in research/slim/nets/inception_v1.py - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                              with tf.variable_scope('Branch_3'):
                                                branch_3 = slim.max_pool2d(net, [3, 3], scope='MaxPool_0a_3x3')
                                                branch_3 = slim.conv2d(branch_3, 64, [1, 1], scope='Conv2d_0b_1x1')
                                              net = tf.concat(
                                    Severity: Major
                                    Found in research/slim/nets/inception_v1.py - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                with tf.variable_scope('Branch_0'):
                                                  branch_0 = slim.conv2d(net, 128, [1, 1], scope='Conv2d_0a_1x1')
                                                with tf.variable_scope('Branch_1'):
                                      Severity: Major
                                      Found in research/slim/nets/inception_v1.py - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                  with tf.variable_scope('Branch_0'):
                                                    branch_0 = slim.conv2d(net, 256, [1, 1], scope='Conv2d_0a_1x1')
                                                  with tf.variable_scope('Branch_1'):
                                        Severity: Major
                                        Found in research/slim/nets/inception_v1.py - About 45 mins to fix

                                          Avoid deeply nested control flow statements.
                                          Open

                                                    with tf.variable_scope('Branch_1'):
                                                      branch_1 = slim.conv2d(net, 160, [1, 1], scope='Conv2d_0a_1x1')
                                                      branch_1 = slim.conv2d(branch_1, 320, [3, 3], scope='Conv2d_0b_3x3')
                                                    with tf.variable_scope('Branch_2'):
                                          Severity: Major
                                          Found in research/slim/nets/inception_v1.py - About 45 mins to fix

                                            Avoid deeply nested control flow statements.
                                            Open

                                                      with tf.variable_scope('Branch_1'):
                                                        branch_1 = slim.conv2d(net, 192, [1, 1], scope='Conv2d_0a_1x1')
                                                        branch_1 = slim.conv2d(branch_1, 384, [3, 3], scope='Conv2d_0b_3x3')
                                                      with tf.variable_scope('Branch_2'):
                                            Severity: Major
                                            Found in research/slim/nets/inception_v1.py - About 45 mins to fix

                                              Avoid deeply nested control flow statements.
                                              Open

                                                        with tf.variable_scope('Branch_3'):
                                                          branch_3 = slim.max_pool2d(net, [3, 3], scope='MaxPool_0a_3x3')
                                                          branch_3 = slim.conv2d(branch_3, 128, [1, 1], scope='Conv2d_0b_1x1')
                                                        net = tf.concat(
                                              Severity: Major
                                              Found in research/slim/nets/inception_v1.py - About 45 mins to fix

                                                Avoid deeply nested control flow statements.
                                                Open

                                                          with tf.variable_scope('Branch_3'):
                                                            branch_3 = slim.max_pool2d(net, [3, 3], scope='MaxPool_0a_3x3')
                                                            branch_3 = slim.conv2d(branch_3, 64, [1, 1], scope='Conv2d_0b_1x1')
                                                          net = tf.concat(
                                                Severity: Major
                                                Found in research/slim/nets/inception_v1.py - About 45 mins to fix

                                                  Avoid deeply nested control flow statements.
                                                  Open

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

                                                    Avoid deeply nested control flow statements.
                                                    Open

                                                              with tf.variable_scope('Branch_3'):
                                                                branch_3 = slim.max_pool2d(net, [3, 3], scope='MaxPool_0a_3x3')
                                                                branch_3 = slim.conv2d(branch_3, 64, [1, 1], scope='Conv2d_0b_1x1')
                                                              net = tf.concat(
                                                    Severity: Major
                                                    Found in research/slim/nets/inception_v1.py - About 45 mins to fix

                                                      Avoid deeply nested control flow statements.
                                                      Open

                                                                with tf.variable_scope('Branch_1'):
                                                                  branch_1 = slim.conv2d(net, 128, [1, 1], scope='Conv2d_0a_1x1')
                                                                  branch_1 = slim.conv2d(branch_1, 192, [3, 3], scope='Conv2d_0b_3x3')
                                                                with tf.variable_scope('Branch_2'):
                                                      Severity: Major
                                                      Found in research/slim/nets/inception_v1.py - About 45 mins to fix

                                                        Avoid deeply nested control flow statements.
                                                        Open

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

                                                          Avoid deeply nested control flow statements.
                                                          Open

                                                                    with tf.variable_scope('Branch_0'):
                                                                      branch_0 = slim.conv2d(net, 256, [1, 1], scope='Conv2d_0a_1x1')
                                                                    with tf.variable_scope('Branch_1'):
                                                          Severity: Major
                                                          Found in research/slim/nets/inception_v1.py - About 45 mins to fix

                                                            Avoid deeply nested control flow statements.
                                                            Open

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

                                                              Avoid deeply nested control flow statements.
                                                              Open

                                                                        with tf.variable_scope('Branch_0'):
                                                                          branch_0 = slim.conv2d(net, 64, [1, 1], scope='Conv2d_0a_1x1')
                                                                        with tf.variable_scope('Branch_1'):
                                                              Severity: Major
                                                              Found in research/slim/nets/inception_v1.py - About 45 mins to fix

                                                                Avoid deeply nested control flow statements.
                                                                Open

                                                                          with tf.variable_scope('Branch_2'):
                                                                            branch_2 = slim.conv2d(net, 32, [1, 1], scope='Conv2d_0a_1x1')
                                                                            branch_2 = slim.conv2d(branch_2, 128, [3, 3], scope='Conv2d_0b_3x3')
                                                                          with tf.variable_scope('Branch_3'):
                                                                Severity: Major
                                                                Found in research/slim/nets/inception_v1.py - About 45 mins to fix

                                                                  Avoid deeply nested control flow statements.
                                                                  Open

                                                                            with tf.variable_scope('Branch_3'):
                                                                              branch_3 = slim.max_pool2d(net, [3, 3], scope='MaxPool_0a_3x3')
                                                                              branch_3 = slim.conv2d(branch_3, 128, [1, 1], scope='Conv2d_0b_1x1')
                                                                            net = tf.concat(
                                                                  Severity: Major
                                                                  Found in research/slim/nets/inception_v1.py - About 45 mins to fix

                                                                    Avoid deeply nested control flow statements.
                                                                    Open

                                                                              with tf.variable_scope('Branch_0'):
                                                                                branch_0 = slim.conv2d(net, 192, [1, 1], scope='Conv2d_0a_1x1')
                                                                              with tf.variable_scope('Branch_1'):
                                                                    Severity: Major
                                                                    Found in research/slim/nets/inception_v1.py - About 45 mins to fix

                                                                      Avoid deeply nested control flow statements.
                                                                      Open

                                                                                with tf.variable_scope('Branch_0'):
                                                                                  branch_0 = slim.conv2d(net, 160, [1, 1], scope='Conv2d_0a_1x1')
                                                                                with tf.variable_scope('Branch_1'):
                                                                      Severity: Major
                                                                      Found in research/slim/nets/inception_v1.py - About 45 mins to fix

                                                                        Avoid deeply nested control flow statements.
                                                                        Open

                                                                                  with tf.variable_scope('Branch_3'):
                                                                                    branch_3 = slim.max_pool2d(net, [3, 3], scope='MaxPool_0a_3x3')
                                                                                    branch_3 = slim.conv2d(branch_3, 64, [1, 1], scope='Conv2d_0b_1x1')
                                                                                  net = tf.concat(
                                                                        Severity: Major
                                                                        Found in research/slim/nets/inception_v1.py - About 45 mins to fix

                                                                          Avoid deeply nested control flow statements.
                                                                          Open

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

                                                                            Avoid deeply nested control flow statements.
                                                                            Open

                                                                                      with tf.variable_scope('Branch_1'):
                                                                                        branch_1 = slim.conv2d(net, 96, [1, 1], scope='Conv2d_0a_1x1')
                                                                                        branch_1 = slim.conv2d(branch_1, 208, [3, 3], scope='Conv2d_0b_3x3')
                                                                                      with tf.variable_scope('Branch_2'):
                                                                            Severity: Major
                                                                            Found in research/slim/nets/inception_v1.py - About 45 mins to fix

                                                                              Avoid deeply nested control flow statements.
                                                                              Open

                                                                                        with tf.variable_scope('Branch_1'):
                                                                                          branch_1 = slim.conv2d(net, 112, [1, 1], scope='Conv2d_0a_1x1')
                                                                                          branch_1 = slim.conv2d(branch_1, 224, [3, 3], scope='Conv2d_0b_3x3')
                                                                                        with tf.variable_scope('Branch_2'):
                                                                              Severity: Major
                                                                              Found in research/slim/nets/inception_v1.py - About 45 mins to fix

                                                                                Avoid deeply nested control flow statements.
                                                                                Open

                                                                                          with tf.variable_scope('Branch_0'):
                                                                                            branch_0 = slim.conv2d(net, 112, [1, 1], scope='Conv2d_0a_1x1')
                                                                                          with tf.variable_scope('Branch_1'):
                                                                                Severity: Major
                                                                                Found in research/slim/nets/inception_v1.py - About 45 mins to fix

                                                                                  Avoid deeply nested control flow statements.
                                                                                  Open

                                                                                            with tf.variable_scope('Branch_2'):
                                                                                              branch_2 = slim.conv2d(net, 32, [1, 1], scope='Conv2d_0a_1x1')
                                                                                              branch_2 = slim.conv2d(branch_2, 128, [3, 3], scope='Conv2d_0a_3x3')
                                                                                            with tf.variable_scope('Branch_3'):
                                                                                  Severity: Major
                                                                                  Found in research/slim/nets/inception_v1.py - About 45 mins to fix

                                                                                    Avoid deeply nested control flow statements.
                                                                                    Open

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

                                                                                      Avoid deeply nested control flow statements.
                                                                                      Open

                                                                                                with tf.variable_scope('Branch_2'):
                                                                                                  branch_2 = slim.conv2d(net, 48, [1, 1], scope='Conv2d_0a_1x1')
                                                                                                  branch_2 = slim.conv2d(branch_2, 128, [3, 3], scope='Conv2d_0b_3x3')
                                                                                                with tf.variable_scope('Branch_3'):
                                                                                      Severity: Major
                                                                                      Found in research/slim/nets/inception_v1.py - About 45 mins to fix

                                                                                        Avoid too many return statements within this function.
                                                                                        Open

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

                                                                                          Avoid too many return statements within this function.
                                                                                          Open

                                                                                                      return net, end_points
                                                                                          Severity: Major
                                                                                          Found in research/slim/nets/inception_v1.py - About 30 mins to fix

                                                                                            Avoid too many return statements within this function.
                                                                                            Open

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

                                                                                              Avoid too many return statements within this function.
                                                                                              Open

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

                                                                                                Avoid too many return statements within this function.
                                                                                                Open

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

                                                                                                  Avoid too many return statements within this function.
                                                                                                  Open

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

                                                                                                    Avoid too many return statements within this function.
                                                                                                    Open

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

                                                                                                      Avoid too many return statements within this function.
                                                                                                      Open

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

                                                                                                        Avoid too many return statements within this function.
                                                                                                        Open

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

                                                                                                          Avoid too many return statements within this function.
                                                                                                          Open

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

                                                                                                            Avoid too many return statements within this function.
                                                                                                            Open

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

                                                                                                              Avoid too many return statements within this function.
                                                                                                              Open

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

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

                                                                                                                        with tf.variable_scope(end_point):
                                                                                                                          with tf.variable_scope('Branch_0'):
                                                                                                                            branch_0 = slim.conv2d(net, 160, [1, 1], scope='Conv2d_0a_1x1')
                                                                                                                          with tf.variable_scope('Branch_1'):
                                                                                                                            branch_1 = slim.conv2d(net, 112, [1, 1], scope='Conv2d_0a_1x1')
                                                                                                                Severity: Major
                                                                                                                Found in research/slim/nets/inception_v1.py and 8 other locations - About 1 day to fix
                                                                                                                research/slim/nets/inception_v1.py on lines 98..111
                                                                                                                research/slim/nets/inception_v1.py on lines 116..129
                                                                                                                research/slim/nets/inception_v1.py on lines 139..152
                                                                                                                research/slim/nets/inception_v1.py on lines 175..188
                                                                                                                research/slim/nets/inception_v1.py on lines 193..206
                                                                                                                research/slim/nets/inception_v1.py on lines 211..224
                                                                                                                research/slim/nets/inception_v1.py on lines 234..247
                                                                                                                research/slim/nets/inception_v1.py on lines 252..265

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

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

                                                                                                                        with tf.variable_scope(end_point):
                                                                                                                          with tf.variable_scope('Branch_0'):
                                                                                                                            branch_0 = slim.conv2d(net, 192, [1, 1], scope='Conv2d_0a_1x1')
                                                                                                                          with tf.variable_scope('Branch_1'):
                                                                                                                            branch_1 = slim.conv2d(net, 96, [1, 1], scope='Conv2d_0a_1x1')
                                                                                                                Severity: Major
                                                                                                                Found in research/slim/nets/inception_v1.py and 8 other locations - About 1 day to fix
                                                                                                                research/slim/nets/inception_v1.py on lines 98..111
                                                                                                                research/slim/nets/inception_v1.py on lines 116..129
                                                                                                                research/slim/nets/inception_v1.py on lines 157..170
                                                                                                                research/slim/nets/inception_v1.py on lines 175..188
                                                                                                                research/slim/nets/inception_v1.py on lines 193..206
                                                                                                                research/slim/nets/inception_v1.py on lines 211..224
                                                                                                                research/slim/nets/inception_v1.py on lines 234..247
                                                                                                                research/slim/nets/inception_v1.py on lines 252..265

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

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

                                                                                                                        with tf.variable_scope(end_point):
                                                                                                                          with tf.variable_scope('Branch_0'):
                                                                                                                            branch_0 = slim.conv2d(net, 256, [1, 1], scope='Conv2d_0a_1x1')
                                                                                                                          with tf.variable_scope('Branch_1'):
                                                                                                                            branch_1 = slim.conv2d(net, 160, [1, 1], scope='Conv2d_0a_1x1')
                                                                                                                Severity: Major
                                                                                                                Found in research/slim/nets/inception_v1.py and 8 other locations - About 1 day to fix
                                                                                                                research/slim/nets/inception_v1.py on lines 98..111
                                                                                                                research/slim/nets/inception_v1.py on lines 116..129
                                                                                                                research/slim/nets/inception_v1.py on lines 139..152
                                                                                                                research/slim/nets/inception_v1.py on lines 157..170
                                                                                                                research/slim/nets/inception_v1.py on lines 175..188
                                                                                                                research/slim/nets/inception_v1.py on lines 193..206
                                                                                                                research/slim/nets/inception_v1.py on lines 211..224
                                                                                                                research/slim/nets/inception_v1.py on lines 252..265

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

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

                                                                                                                        with tf.variable_scope(end_point):
                                                                                                                          with tf.variable_scope('Branch_0'):
                                                                                                                            branch_0 = slim.conv2d(net, 64, [1, 1], scope='Conv2d_0a_1x1')
                                                                                                                          with tf.variable_scope('Branch_1'):
                                                                                                                            branch_1 = slim.conv2d(net, 96, [1, 1], scope='Conv2d_0a_1x1')
                                                                                                                Severity: Major
                                                                                                                Found in research/slim/nets/inception_v1.py and 8 other locations - About 1 day to fix
                                                                                                                research/slim/nets/inception_v1.py on lines 116..129
                                                                                                                research/slim/nets/inception_v1.py on lines 139..152
                                                                                                                research/slim/nets/inception_v1.py on lines 157..170
                                                                                                                research/slim/nets/inception_v1.py on lines 175..188
                                                                                                                research/slim/nets/inception_v1.py on lines 193..206
                                                                                                                research/slim/nets/inception_v1.py on lines 211..224
                                                                                                                research/slim/nets/inception_v1.py on lines 234..247
                                                                                                                research/slim/nets/inception_v1.py on lines 252..265

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

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

                                                                                                                        with tf.variable_scope(end_point):
                                                                                                                          with tf.variable_scope('Branch_0'):
                                                                                                                            branch_0 = slim.conv2d(net, 112, [1, 1], scope='Conv2d_0a_1x1')
                                                                                                                          with tf.variable_scope('Branch_1'):
                                                                                                                            branch_1 = slim.conv2d(net, 144, [1, 1], scope='Conv2d_0a_1x1')
                                                                                                                Severity: Major
                                                                                                                Found in research/slim/nets/inception_v1.py and 8 other locations - About 1 day to fix
                                                                                                                research/slim/nets/inception_v1.py on lines 98..111
                                                                                                                research/slim/nets/inception_v1.py on lines 116..129
                                                                                                                research/slim/nets/inception_v1.py on lines 139..152
                                                                                                                research/slim/nets/inception_v1.py on lines 157..170
                                                                                                                research/slim/nets/inception_v1.py on lines 175..188
                                                                                                                research/slim/nets/inception_v1.py on lines 211..224
                                                                                                                research/slim/nets/inception_v1.py on lines 234..247
                                                                                                                research/slim/nets/inception_v1.py on lines 252..265

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

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

                                                                                                                        with tf.variable_scope(end_point):
                                                                                                                          with tf.variable_scope('Branch_0'):
                                                                                                                            branch_0 = slim.conv2d(net, 128, [1, 1], scope='Conv2d_0a_1x1')
                                                                                                                          with tf.variable_scope('Branch_1'):
                                                                                                                            branch_1 = slim.conv2d(net, 128, [1, 1], scope='Conv2d_0a_1x1')
                                                                                                                Severity: Major
                                                                                                                Found in research/slim/nets/inception_v1.py and 8 other locations - About 1 day to fix
                                                                                                                research/slim/nets/inception_v1.py on lines 98..111
                                                                                                                research/slim/nets/inception_v1.py on lines 139..152
                                                                                                                research/slim/nets/inception_v1.py on lines 157..170
                                                                                                                research/slim/nets/inception_v1.py on lines 175..188
                                                                                                                research/slim/nets/inception_v1.py on lines 193..206
                                                                                                                research/slim/nets/inception_v1.py on lines 211..224
                                                                                                                research/slim/nets/inception_v1.py on lines 234..247
                                                                                                                research/slim/nets/inception_v1.py on lines 252..265

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

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

                                                                                                                        with tf.variable_scope(end_point):
                                                                                                                          with tf.variable_scope('Branch_0'):
                                                                                                                            branch_0 = slim.conv2d(net, 384, [1, 1], scope='Conv2d_0a_1x1')
                                                                                                                          with tf.variable_scope('Branch_1'):
                                                                                                                            branch_1 = slim.conv2d(net, 192, [1, 1], scope='Conv2d_0a_1x1')
                                                                                                                Severity: Major
                                                                                                                Found in research/slim/nets/inception_v1.py and 8 other locations - About 1 day to fix
                                                                                                                research/slim/nets/inception_v1.py on lines 98..111
                                                                                                                research/slim/nets/inception_v1.py on lines 116..129
                                                                                                                research/slim/nets/inception_v1.py on lines 139..152
                                                                                                                research/slim/nets/inception_v1.py on lines 157..170
                                                                                                                research/slim/nets/inception_v1.py on lines 175..188
                                                                                                                research/slim/nets/inception_v1.py on lines 193..206
                                                                                                                research/slim/nets/inception_v1.py on lines 211..224
                                                                                                                research/slim/nets/inception_v1.py on lines 234..247

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

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

                                                                                                                        with tf.variable_scope(end_point):
                                                                                                                          with tf.variable_scope('Branch_0'):
                                                                                                                            branch_0 = slim.conv2d(net, 256, [1, 1], scope='Conv2d_0a_1x1')
                                                                                                                          with tf.variable_scope('Branch_1'):
                                                                                                                            branch_1 = slim.conv2d(net, 160, [1, 1], scope='Conv2d_0a_1x1')
                                                                                                                Severity: Major
                                                                                                                Found in research/slim/nets/inception_v1.py and 8 other locations - About 1 day to fix
                                                                                                                research/slim/nets/inception_v1.py on lines 98..111
                                                                                                                research/slim/nets/inception_v1.py on lines 116..129
                                                                                                                research/slim/nets/inception_v1.py on lines 139..152
                                                                                                                research/slim/nets/inception_v1.py on lines 157..170
                                                                                                                research/slim/nets/inception_v1.py on lines 175..188
                                                                                                                research/slim/nets/inception_v1.py on lines 193..206
                                                                                                                research/slim/nets/inception_v1.py on lines 234..247
                                                                                                                research/slim/nets/inception_v1.py on lines 252..265

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

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

                                                                                                                        with tf.variable_scope(end_point):
                                                                                                                          with tf.variable_scope('Branch_0'):
                                                                                                                            branch_0 = slim.conv2d(net, 128, [1, 1], scope='Conv2d_0a_1x1')
                                                                                                                          with tf.variable_scope('Branch_1'):
                                                                                                                            branch_1 = slim.conv2d(net, 128, [1, 1], scope='Conv2d_0a_1x1')
                                                                                                                Severity: Major
                                                                                                                Found in research/slim/nets/inception_v1.py and 8 other locations - About 1 day to fix
                                                                                                                research/slim/nets/inception_v1.py on lines 98..111
                                                                                                                research/slim/nets/inception_v1.py on lines 116..129
                                                                                                                research/slim/nets/inception_v1.py on lines 139..152
                                                                                                                research/slim/nets/inception_v1.py on lines 157..170
                                                                                                                research/slim/nets/inception_v1.py on lines 193..206
                                                                                                                research/slim/nets/inception_v1.py on lines 211..224
                                                                                                                research/slim/nets/inception_v1.py on lines 234..247
                                                                                                                research/slim/nets/inception_v1.py on lines 252..265

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

                                                                                                                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