tensorflow/models

View on GitHub

Showing 11,634 of 11,634 total issues

Avoid deeply nested control flow statements.
Open

          if use_explicit_padding:
            net = _fixed_padding(net, conv_def.kernel)
          net = slim.conv2d(net, depth(conv_def.depth), conv_def.kernel,
Severity: Major
Found in research/slim/nets/mobilenet_v1.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

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

      Avoid deeply nested control flow statements.
      Open

                if not num_classes:
                  return net, end_points
                # 1 x 1 x 1536
                net = slim.dropout(net, dropout_keep_prob, scope='Dropout_1b')
      Severity: Major
      Found in research/slim/nets/inception_v4.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                    with self.test_session() as sess:
                      tf.set_random_seed(0)
                      inputs = create_test_input(1, height, width, 3)
        
                      # Subsampling at the last unit of the block.
        Severity: Major
        Found in research/slim/nets/resnet_v1_test.py - About 45 mins to fix

          Function episode has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

            def episode(self):
              """Episode data.
          
              Returns:
                observations: a tuple with one element. This element is a numpy array of
          Severity: Minor
          Found in research/cognitive_planning/tasks.py - About 45 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

                    if not display_str:
                      display_str = '{}%'.format(int(100*scores[i]))
                    else:
                      display_str = '{}: {}%'.format(display_str, int(100*scores[i]))
                  box_to_display_str_map[box].append(display_str)
          Severity: Major
          Found in research/cognitive_planning/visualization_utils.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                      if use_explicit_padding:
                        net = _fixed_padding(net, conv_def.kernel, layer_rate)
                      net = slim.separable_conv2d(net, None, conv_def.kernel,
            Severity: Major
            Found in research/slim/nets/mobilenet_v1.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

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

                Function inception_resnet_v2_base has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def inception_resnet_v2_base(inputs,
                Severity: Minor
                Found in research/slim/nets/inception_resnet_v2.py - About 45 mins to fix

                  Function _conv has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                    def _conv(self, name, x, filter_size, in_filters, out_filters, strides):
                  Severity: Minor
                  Found in research/cognitive_planning/embedders.py - About 45 mins to fix

                    Function _add_gradients_summaries has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def _add_gradients_summaries(grads_and_vars):
                      """Add histogram summaries to gradients.
                    
                      Note: The summaries are also added to the SUMMARIES collection.
                    
                    
                    Severity: Minor
                    Found in research/slim/deployment/model_deploy.py - About 45 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

                    Function log_mel_spectrogram has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    def log_mel_spectrogram(data,
                    Severity: Minor
                    Found in research/audioset/vggish/mel_features.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

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

                        Function inception_resnet_v2_arg_scope has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        def inception_resnet_v2_arg_scope(
                        Severity: Minor
                        Found in research/slim/nets/inception_resnet_v2.py - About 45 mins to fix

                          Function preprocess_for_train has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def preprocess_for_train(image, height, width, bbox,
                                                   fast_mode=True,
                                                   scope=None,
                                                   add_image_summaries=True):
                            """Distort one image for training a network.
                          Severity: Minor
                          Found in research/cognitive_planning/preprocessing/inception_preprocessing.py - About 45 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

                                    if kernel_size.is_fully_defined():
                                      net = slim.avg_pool2d(net, kernel_size, padding='VALID',
                                                            scope='AvgPool_1a')
                                    else:
                                      net = tf.reduce_mean(
                          Severity: Major
                          Found in research/slim/nets/inception_v4.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                      if clone_loss is not None:
                                        clones_losses.append(clone_loss)
                                      # Only use regularization_losses for the first clone
                                      regularization_losses = None
                            Severity: Major
                            Found in research/slim/deployment/model_deploy.py - About 45 mins to fix

                              Function preprocess_image has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                              def preprocess_image(image, output_height, output_width, is_training=False,
                              Severity: Minor
                              Found in research/cognitive_planning/preprocessing/vgg_preprocessing.py - About 45 mins to fix

                                Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                  def __init__(self,
                                Severity: Minor
                                Found in research/cognitive_planning/tasks.py - About 45 mins to fix

                                  Function discriminator has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                  def discriminator(inputs,
                                  Severity: Minor
                                  Found in research/slim/nets/dcgan.py - About 45 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language