tensorflow/models

View on GitHub
research/deeplab/core/resnet_v1_beta_test.py

Summary

Maintainability
F
3 wks
Test Coverage

File resnet_v1_beta_test.py has 498 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Lint as: python2, python3
# Copyright 2018 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.
Severity: Minor
Found in research/deeplab/core/resnet_v1_beta_test.py - About 7 hrs to fix

    ResnetCompleteNetworkTest has 24 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class ResnetCompleteNetworkTest(tf.test.TestCase):
      """Tests with complete small ResNet v1 networks."""
    
      def _resnet_small_lite_bottleneck(self,
                                        inputs,
    Severity: Minor
    Found in research/deeplab/core/resnet_v1_beta_test.py - About 2 hrs to fix

      Function _resnet_small has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        def _resnet_small(self,
      Severity: Major
      Found in research/deeplab/core/resnet_v1_beta_test.py - About 1 hr to fix

        Function _resnet_small_lite_bottleneck has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          def _resnet_small_lite_bottleneck(self,
        Severity: Major
        Found in research/deeplab/core/resnet_v1_beta_test.py - About 1 hr to fix

          Avoid deeply nested control flow statements.
          Open

                      if output_stride is None:
                        factor = 1
                      else:
                        factor = nominal_stride // output_stride
                      output = resnet_utils.subsample(output, factor)
          Severity: Major
          Found in research/deeplab/core/resnet_v1_beta_test.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                        if output_stride is None:
                          factor = 1
                        else:
                          factor = nominal_stride // output_stride
                        output = resnet_utils.subsample(output, factor)
            Severity: Major
            Found in research/deeplab/core/resnet_v1_beta_test.py - About 45 mins to fix

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

                def testAtrousFullyConvolutionalValues(self):
                  """Verify dense feature extraction with atrous convolution."""
                  nominal_stride = 32
                  for output_stride in [4, 8, 16, 32, None]:
                    with slim.arg_scope(resnet_utils.resnet_arg_scope()):
              Severity: Major
              Found in research/deeplab/core/resnet_v1_beta_test.py and 4 other locations - About 2 days to fix
              research/deeplab/core/resnet_v1_beta_test.py on lines 228..258
              research/deeplab/core/xception_test.py on lines 362..392
              research/slim/nets/resnet_v1_test.py on lines 468..492
              research/slim/nets/resnet_v2_test.py on lines 385..411

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

              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 testAtrousFullyConvolutionalValuesWithLiteBottleneck(self):
                  """Verify dense feature extraction with atrous convolution."""
                  nominal_stride = 32
                  for output_stride in [4, 8, 16, 32, None]:
                    with slim.arg_scope(resnet_utils.resnet_arg_scope()):
              Severity: Major
              Found in research/deeplab/core/resnet_v1_beta_test.py and 4 other locations - About 2 days to fix
              research/deeplab/core/resnet_v1_beta_test.py on lines 475..503
              research/deeplab/core/xception_test.py on lines 362..392
              research/slim/nets/resnet_v1_test.py on lines 468..492
              research/slim/nets/resnet_v2_test.py on lines 385..411

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

              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 testUnknownBatchSize(self):
                  batch = 2
                  height, width = 65, 65
                  global_pool = True
                  num_classes = 10
              Severity: Major
              Found in research/deeplab/core/resnet_v1_beta_test.py and 2 other locations - About 1 day to fix
              research/deeplab/core/resnet_v1_beta_test.py on lines 261..280
              research/deeplab/core/xception_test.py on lines 395..414

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

              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 testUnknownBatchSizeWithLiteBottleneck(self):
                  batch = 2
                  height, width = 65, 65
                  global_pool = True
                  num_classes = 10
              Severity: Major
              Found in research/deeplab/core/resnet_v1_beta_test.py and 2 other locations - About 1 day to fix
              research/deeplab/core/resnet_v1_beta_test.py on lines 506..524
              research/deeplab/core/xception_test.py on lines 395..414

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

              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 testAtrousFullyConvolutionalUnknownHeightWidthWithLiteBottleneck(self):
                  batch = 2
                  height, width = 65, 65
                  global_pool = False
                  output_stride = 8
              Severity: Major
              Found in research/deeplab/core/resnet_v1_beta_test.py and 4 other locations - About 1 day to fix
              research/deeplab/core/resnet_v1_beta_test.py on lines 543..560
              research/deeplab/core/xception_test.py on lines 434..452
              research/slim/nets/resnet_v1_test.py on lines 530..547
              research/slim/nets/resnet_v2_test.py on lines 450..467

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

              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 testAtrousFullyConvolutionalUnknownHeightWidth(self):
                  batch = 2
                  height, width = 65, 65
                  global_pool = False
                  output_stride = 8
              Severity: Major
              Found in research/deeplab/core/resnet_v1_beta_test.py and 4 other locations - About 1 day to fix
              research/deeplab/core/resnet_v1_beta_test.py on lines 300..318
              research/deeplab/core/xception_test.py on lines 434..452
              research/slim/nets/resnet_v1_test.py on lines 530..547
              research/slim/nets/resnet_v2_test.py on lines 450..467

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

              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 testFullyConvolutionalUnknownHeightWidthWithLiteBottleneck(self):
                  batch = 2
                  height, width = 65, 65
                  global_pool = False
                  inputs = create_test_input(batch, None, None, 3)
              Severity: Major
              Found in research/deeplab/core/resnet_v1_beta_test.py and 4 other locations - About 1 day to fix
              research/deeplab/core/resnet_v1_beta_test.py on lines 526..541
              research/deeplab/core/xception_test.py on lines 416..432
              research/slim/nets/resnet_v1_test.py on lines 515..528
              research/slim/nets/resnet_v2_test.py on lines 434..448

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

              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 testFullyConvolutionalUnknownHeightWidth(self):
                  batch = 2
                  height, width = 65, 65
                  global_pool = False
                  inputs = create_test_input(batch, None, None, 3)
              Severity: Major
              Found in research/deeplab/core/resnet_v1_beta_test.py and 4 other locations - About 1 day to fix
              research/deeplab/core/resnet_v1_beta_test.py on lines 282..298
              research/deeplab/core/xception_test.py on lines 416..432
              research/slim/nets/resnet_v1_test.py on lines 515..528
              research/slim/nets/resnet_v2_test.py on lines 434..448

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

              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 testAtrousFullyConvolutionalEndpointShapes(self):
                  global_pool = False
                  num_classes = 10
                  output_stride = 8
                  inputs = create_test_input(2, 321, 321, 3)
              Severity: Major
              Found in research/deeplab/core/resnet_v1_beta_test.py and 1 other location - About 1 day to fix
              research/deeplab/core/resnet_v1_beta_test.py on lines 205..226

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

              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 testAtrousFullyConvolutionalEndpointShapesWithLiteBottleneck(self):
                  global_pool = False
                  num_classes = 10
                  output_stride = 8
                  inputs = create_test_input(2, 321, 321, 3)
              Severity: Major
              Found in research/deeplab/core/resnet_v1_beta_test.py and 1 other location - About 1 day to fix
              research/deeplab/core/resnet_v1_beta_test.py on lines 453..473

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

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

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

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

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

              Refactorings

              Further Reading

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

                def testFullyConvolutionalEndpointShapesWithLiteBottleneck(self):
                  global_pool = False
                  num_classes = 10
                  inputs = create_test_input(2, 321, 321, 3)
                  with slim.arg_scope(resnet_utils.resnet_arg_scope()):
              Severity: Major
              Found in research/deeplab/core/resnet_v1_beta_test.py and 5 other locations - About 1 day to fix
              research/deeplab/core/resnet_v1_beta_test.py on lines 163..182
              research/deeplab/core/resnet_v1_beta_test.py on lines 413..431
              research/deeplab/core/resnet_v1_beta_test.py on lines 433..451
              research/deeplab/core/xception_test.py on lines 298..317
              research/deeplab/core/xception_test.py on lines 319..338

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

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

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

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

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

              Refactorings

              Further Reading

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

                def testFullyConvolutionalEndpointShapes(self):
                  global_pool = False
                  num_classes = 10
                  inputs = create_test_input(2, 321, 321, 3)
                  with slim.arg_scope(resnet_utils.resnet_arg_scope()):
              Severity: Major
              Found in research/deeplab/core/resnet_v1_beta_test.py and 5 other locations - About 1 day to fix
              research/deeplab/core/resnet_v1_beta_test.py on lines 163..182
              research/deeplab/core/resnet_v1_beta_test.py on lines 184..203
              research/deeplab/core/resnet_v1_beta_test.py on lines 413..431
              research/deeplab/core/xception_test.py on lines 298..317
              research/deeplab/core/xception_test.py on lines 319..338

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

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

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

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

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

              Refactorings

              Further Reading

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

                def testClassificationShapes(self):
                  global_pool = True
                  num_classes = 10
                  inputs = create_test_input(2, 224, 224, 3)
                  with slim.arg_scope(resnet_utils.resnet_arg_scope()):
              Severity: Major
              Found in research/deeplab/core/resnet_v1_beta_test.py and 5 other locations - About 1 day to fix
              research/deeplab/core/resnet_v1_beta_test.py on lines 163..182
              research/deeplab/core/resnet_v1_beta_test.py on lines 184..203
              research/deeplab/core/resnet_v1_beta_test.py on lines 433..451
              research/deeplab/core/xception_test.py on lines 298..317
              research/deeplab/core/xception_test.py on lines 319..338

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

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

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

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

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

              Refactorings

              Further Reading

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

                def testClassificationShapesWithLiteBottleneck(self):
                  global_pool = True
                  num_classes = 10
                  inputs = create_test_input(2, 224, 224, 3)
                  with slim.arg_scope(resnet_utils.resnet_arg_scope()):
              Severity: Major
              Found in research/deeplab/core/resnet_v1_beta_test.py and 5 other locations - About 1 day to fix
              research/deeplab/core/resnet_v1_beta_test.py on lines 184..203
              research/deeplab/core/resnet_v1_beta_test.py on lines 413..431
              research/deeplab/core/resnet_v1_beta_test.py on lines 433..451
              research/deeplab/core/xception_test.py on lines 298..317
              research/deeplab/core/xception_test.py on lines 319..338

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

              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 testClassificationEndPoints(self):
                  global_pool = True
                  num_classes = 10
                  inputs = create_test_input(2, 224, 224, 3)
                  with slim.arg_scope(resnet_utils.resnet_arg_scope()):
              Severity: Major
              Found in research/deeplab/core/resnet_v1_beta_test.py and 1 other location - About 1 day to fix
              research/deeplab/core/resnet_v1_beta_test.py on lines 127..142

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

              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 testClassificationEndPointsWithLiteBottleneck(self):
                  global_pool = True
                  num_classes = 10
                  inputs = create_test_input(2, 224, 224, 3)
                  with slim.arg_scope(resnet_utils.resnet_arg_scope()):
              Severity: Major
              Found in research/deeplab/core/resnet_v1_beta_test.py and 1 other location - About 1 day to fix
              research/deeplab/core/resnet_v1_beta_test.py on lines 320..334

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

              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 create_test_input(batch, height, width, channels):
                """Create test input tensor."""
                if None in [batch, height, width, channels]:
                  return tf.placeholder(tf.float32, (batch, height, width, channels))
                else:
              Severity: Major
              Found in research/deeplab/core/resnet_v1_beta_test.py and 1 other location - About 7 hrs to fix
              research/deeplab/core/nas_network_test.py on lines 36..47

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

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

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

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

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

              Refactorings

              Further Reading

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

                  with self.assertRaisesRegexp(ValueError, 'Invalid groups'):
                    with slim.arg_scope(
                        resnet_v1_beta.resnet_arg_scope(normalization_method='group')):
                      with slim.arg_scope([slim.group_norm], groups=32):
                        _, _ = self._resnet_small(
              Severity: Major
              Found in research/deeplab/core/resnet_v1_beta_test.py and 1 other location - About 2 hrs to fix
              research/deeplab/core/resnet_v1_beta_test.py on lines 355..359

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

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

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

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

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

              Refactorings

              Further Reading

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

                  with slim.arg_scope(
                      resnet_v1_beta.resnet_arg_scope(normalization_method='group')):
                    with slim.arg_scope([slim.group_norm], groups=1):
                      logits, end_points = self._resnet_small(
                          inputs, num_classes, global_pool=global_pool, scope='resnet')
              Severity: Major
              Found in research/deeplab/core/resnet_v1_beta_test.py and 1 other location - About 2 hrs to fix
              research/deeplab/core/resnet_v1_beta_test.py on lines 371..376

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

              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