tensorflow/models

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

Summary

Maintainability
F
3 wks
Test Coverage

File mobilenet_v1_test.py has 467 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright 2017 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/mobilenet_v1_test.py - About 7 hrs to fix

    MobilenetV1Test has 22 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class MobilenetV1Test(tf.test.TestCase):
    
      def testBuildClassificationNetwork(self):
        batch_size = 5
        height, width = 224, 224
    Severity: Minor
    Found in research/slim/nets/mobilenet_v1_test.py - About 2 hrs to fix

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

        def testOutputStride16BuildAndCheckAllEndPointsUptoConv2d_13(self):
          batch_size = 5
          height, width = 224, 224
          output_stride = 16
      
      
      Severity: Major
      Found in research/slim/nets/mobilenet_v1_test.py and 1 other location - About 4 days to fix
      research/slim/nets/mobilenet_v1_test.py on lines 236..288

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

        def testOutputStride8BuildAndCheckAllEndPointsUptoConv2d_13(self):
          batch_size = 5
          height, width = 224, 224
          output_stride = 8
      
      
      Severity: Major
      Found in research/slim/nets/mobilenet_v1_test.py and 1 other location - About 4 days to fix
      research/slim/nets/mobilenet_v1_test.py on lines 182..234

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

        def testGlobalPoolUnknownImageShape(self):
          tf.reset_default_graph()
          batch_size = 1
          height, width = 250, 300
          num_classes = 1000
      Severity: Major
      Found in research/slim/nets/mobilenet_v1_test.py and 2 other locations - About 1 day to fix
      research/slim/nets/inception_v1_test.py on lines 191..209
      research/slim/nets/inception_v2_test.py on lines 303..321

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

        def testUnknownImageShape(self):
          tf.reset_default_graph()
          batch_size = 2
          height, width = 224, 224
          num_classes = 1000
      Severity: Major
      Found in research/slim/nets/mobilenet_v1_test.py and 2 other locations - About 1 day to fix
      research/slim/nets/inception_v1_test.py on lines 172..189
      research/slim/nets/inception_v2_test.py on lines 284..301

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

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

        def testBuildEndPointsWithDepthMultiplierGreaterThanOne(self):
          batch_size = 5
          height, width = 224, 224
          num_classes = 1000
      
      
      Severity: Major
      Found in research/slim/nets/mobilenet_v1_test.py and 4 other locations - About 1 day to fix
      research/slim/nets/inception_v2_test.py on lines 129..147
      research/slim/nets/inception_v2_test.py on lines 149..167
      research/slim/nets/inception_v3_test.py on lines 158..176
      research/slim/nets/inception_v3_test.py on lines 178..196

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

        def testUnknowBatchSize(self):
          batch_size = 1
          height, width = 224, 224
          num_classes = 1000
      
      
      Severity: Major
      Found in research/slim/nets/mobilenet_v1_test.py and 3 other locations - About 1 day to fix
      research/slim/nets/inception_v1_test.py on lines 211..226
      research/slim/nets/inception_v2_test.py on lines 323..338
      research/slim/nets/inception_v3_test.py on lines 260..275

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

        def testTrainEvalWithReuse(self):
          train_batch_size = 5
          eval_batch_size = 2
          height, width = 150, 150
          num_classes = 1000
      Severity: Major
      Found in research/slim/nets/mobilenet_v1_test.py and 2 other locations - About 1 day to fix
      research/slim/nets/inception_v1_test.py on lines 243..258
      research/slim/nets/inception_v2_test.py on lines 355..370

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

        def testBuildClassificationNetwork(self):
          batch_size = 5
          height, width = 224, 224
          num_classes = 1000
      
      
      Severity: Major
      Found in research/slim/nets/mobilenet_v1_test.py and 3 other locations - About 1 day to fix
      research/slim/nets/inception_v1_test.py on lines 30..43
      research/slim/nets/inception_v2_test.py on lines 30..43
      research/slim/nets/inception_v3_test.py on lines 30..43

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

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

        def testHalfSizeImages(self):
          batch_size = 5
          height, width = 112, 112
          num_classes = 1000
      
      
      Severity: Major
      Found in research/slim/nets/mobilenet_v1_test.py and 4 other locations - About 1 day to fix
      research/slim/nets/inception_v2_test.py on lines 242..254
      research/slim/nets/inception_v3_test.py on lines 209..221
      research/slim/nets/inception_v4_test.py on lines 169..180
      research/slim/nets/inception_v4_test.py on lines 182..193

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

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

        def testBuildPreLogitsNetwork(self):
          batch_size = 5
          height, width = 224, 224
          num_classes = None
      
      
      Severity: Major
      Found in research/slim/nets/mobilenet_v1_test.py and 4 other locations - About 1 day to fix
      research/slim/nets/inception_v1_test.py on lines 45..55
      research/slim/nets/inception_v2_test.py on lines 45..55
      research/slim/nets/inception_v3_test.py on lines 45..55
      research/slim/nets/inception_v4_test.py on lines 47..56

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

        def testEvaluation(self):
          batch_size = 2
          height, width = 224, 224
          num_classes = 1000
      
      
      Severity: Major
      Found in research/slim/nets/mobilenet_v1_test.py and 3 other locations - About 1 day to fix
      research/slim/nets/inception_v1_test.py on lines 228..241
      research/slim/nets/inception_v2_test.py on lines 340..353
      research/slim/nets/inception_v3_test.py on lines 277..290

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

        def testBatchNormScopeDoesHasIsTrainingWhenItsNotNone(self):
          sc = mobilenet_v1.mobilenet_v1_arg_scope(is_training=True)
          self.assertIn('is_training', sc[slim.arg_scope_func_key(slim.batch_norm)])
          sc = mobilenet_v1.mobilenet_v1_arg_scope(is_training=False)
          self.assertIn('is_training', sc[slim.arg_scope_func_key(slim.batch_norm)])
      Severity: Major
      Found in research/slim/nets/mobilenet_v1_test.py and 1 other location - About 7 hrs to fix
      research/slim/nets/mobilenet/mobilenet_v2_test.py on lines 203..209

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

          for index, endpoint in enumerate(endpoints):
            with tf.Graph().as_default():
              inputs = tf.random.uniform((batch_size, height, width, 3))
              out_tensor, end_points = mobilenet_v1.mobilenet_v1_base(
                  inputs, final_endpoint=endpoint)
      Severity: Major
      Found in research/slim/nets/mobilenet_v1_test.py and 3 other locations - About 7 hrs to fix
      research/slim/nets/inception_v1_test.py on lines 81..88
      research/slim/nets/inception_v3_test.py on lines 83..90
      research/slim/nets/inception_v4_test.py on lines 143..150

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

        def testLogitsNotSqueezed(self):
          num_classes = 25
          images = tf.random.uniform([1, 224, 224, 3])
          logits, _ = mobilenet_v1.mobilenet_v1(images,
                                                num_classes=num_classes,
      Severity: Major
      Found in research/slim/nets/mobilenet_v1_test.py and 3 other locations - About 6 hrs to fix
      research/slim/nets/inception_v1_test.py on lines 260..270
      research/slim/nets/inception_v2_test.py on lines 372..382
      research/slim/nets/inception_v3_test.py on lines 310..320

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

        def testRaiseValueErrorWithInvalidDepthMultiplier(self):
          batch_size = 5
          height, width = 224, 224
          num_classes = 1000
      
      
      Severity: Major
      Found in research/slim/nets/mobilenet_v1_test.py and 2 other locations - About 5 hrs to fix
      research/slim/nets/inception_v2_test.py on lines 169..178
      research/slim/nets/inception_v3_test.py on lines 198..207

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

        def testBatchNormScopeDoesNotHaveIsTrainingWhenItsSetToNone(self):
          sc = mobilenet_v1.mobilenet_v1_arg_scope(is_training=None)
          self.assertNotIn('is_training', sc[slim.arg_scope_func_key(
              slim.batch_norm)])
      Severity: Major
      Found in research/slim/nets/mobilenet_v1_test.py and 1 other location - About 1 hr to fix
      research/slim/nets/mobilenet/mobilenet_v2_test.py on lines 198..201

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

          endpoints = ['Conv2d_0',
                       'Conv2d_1_depthwise', 'Conv2d_1_pointwise',
                       'Conv2d_2_depthwise', 'Conv2d_2_pointwise',
                       'Conv2d_3_depthwise', 'Conv2d_3_pointwise',
                       'Conv2d_4_depthwise', 'Conv2d_4_pointwise',
      Severity: Major
      Found in research/slim/nets/mobilenet_v1_test.py and 3 other locations - About 35 mins to fix
      research/cvt_text/base/embeddings.py on lines 48..56
      research/object_detection/models/keras_models/mobilenet_v1_tf2_test.py on lines 46..60
      research/slim/nets/mobilenet_v1_test.py on lines 66..79

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

          expected_endpoints = ['Conv2d_0',
                                'Conv2d_1_depthwise', 'Conv2d_1_pointwise',
                                'Conv2d_2_depthwise', 'Conv2d_2_pointwise',
                                'Conv2d_3_depthwise', 'Conv2d_3_pointwise',
                                'Conv2d_4_depthwise', 'Conv2d_4_pointwise',
      Severity: Major
      Found in research/slim/nets/mobilenet_v1_test.py and 3 other locations - About 35 mins to fix
      research/cvt_text/base/embeddings.py on lines 48..56
      research/object_detection/models/keras_models/mobilenet_v1_tf2_test.py on lines 46..60
      research/slim/nets/mobilenet_v1_test.py on lines 85..98

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

      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