tensorflow/models

View on GitHub
research/slim/nets/nasnet/nasnet_test.py

Summary

Maintainability
F
3 wks
Test Coverage

File nasnet_test.py has 368 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/nasnet/nasnet_test.py - About 4 hrs to fix

    Function testUseBoundedAcitvationCifarModel has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

      def testUseBoundedAcitvationCifarModel(self):
        batch_size = 1
        height, width = 32, 32
        num_classes = 10
        for use_bounded_activation in (True, False):
    Severity: Minor
    Found in research/slim/nets/nasnet/nasnet_test.py - About 25 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

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

      def testAllEndPointsShapesCifarModel(self):
        batch_size = 5
        height, width = 32, 32
        num_classes = 10
        inputs = tf.random.uniform((batch_size, height, width, 3))
    Severity: Major
    Found in research/slim/nets/nasnet/nasnet_test.py and 1 other location - About 3 days to fix
    research/slim/nets/nasnet/nasnet_test.py on lines 226..266

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

    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 testAllEndPointsShapesLargeModel(self):
        batch_size = 5
        height, width = 331, 331
        num_classes = 1000
        inputs = tf.random.uniform((batch_size, height, width, 3))
    Severity: Major
    Found in research/slim/nets/nasnet/nasnet_test.py and 1 other location - About 3 days to fix
    research/slim/nets/nasnet/nasnet_test.py on lines 118..158

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

    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 testBuildLogitsLargeModel(self):
        batch_size = 5
        height, width = 331, 331
        num_classes = 1000
        inputs = tf.random.uniform((batch_size, height, width, 3))
    Severity: Major
    Found in research/slim/nets/nasnet/nasnet_test.py and 4 other locations - About 1 day to fix
    research/slim/nets/nasnet/nasnet_test.py on lines 28..43
    research/slim/nets/nasnet/nasnet_test.py on lines 45..60
    research/slim/nets/nasnet/pnasnet_test.py on lines 28..43
    research/slim/nets/nasnet/pnasnet_test.py on lines 45..60

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

    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 testBuildLogitsMobileModel(self):
        batch_size = 5
        height, width = 224, 224
        num_classes = 1000
        inputs = tf.random.uniform((batch_size, height, width, 3))
    Severity: Major
    Found in research/slim/nets/nasnet/nasnet_test.py and 4 other locations - About 1 day to fix
    research/slim/nets/nasnet/nasnet_test.py on lines 28..43
    research/slim/nets/nasnet/nasnet_test.py on lines 62..77
    research/slim/nets/nasnet/pnasnet_test.py on lines 28..43
    research/slim/nets/nasnet/pnasnet_test.py on lines 45..60

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

    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 testBuildLogitsCifarModel(self):
        batch_size = 5
        height, width = 32, 32
        num_classes = 10
        inputs = tf.random.uniform((batch_size, height, width, 3))
    Severity: Major
    Found in research/slim/nets/nasnet/nasnet_test.py and 4 other locations - About 1 day to fix
    research/slim/nets/nasnet/nasnet_test.py on lines 45..60
    research/slim/nets/nasnet/nasnet_test.py on lines 62..77
    research/slim/nets/nasnet/pnasnet_test.py on lines 28..43
    research/slim/nets/nasnet/pnasnet_test.py on lines 45..60

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

    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 testUseBoundedAcitvationCifarModel(self):
        batch_size = 1
        height, width = 32, 32
        num_classes = 10
        for use_bounded_activation in (True, False):
    Severity: Major
    Found in research/slim/nets/nasnet/nasnet_test.py and 1 other location - About 1 day to fix
    research/slim/nets/nasnet/pnasnet_test.py on lines 238..252

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

      def testBuildPreLogitsLargeModel(self):
        batch_size = 5
        height, width = 331, 331
        num_classes = None
        inputs = tf.random.uniform((batch_size, height, width, 3))
    Severity: Major
    Found in research/slim/nets/nasnet/nasnet_test.py and 4 other locations - About 1 day to fix
    research/slim/nets/nasnet/nasnet_test.py on lines 79..90
    research/slim/nets/nasnet/nasnet_test.py on lines 92..103
    research/slim/nets/nasnet/pnasnet_test.py on lines 82..93
    research/slim/nets/nasnet/pnasnet_test.py on lines 95..106

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

    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 testBuildPreLogitsCifarModel(self):
        batch_size = 5
        height, width = 32, 32
        num_classes = None
        inputs = tf.random.uniform((batch_size, height, width, 3))
    Severity: Major
    Found in research/slim/nets/nasnet/nasnet_test.py and 4 other locations - About 1 day to fix
    research/slim/nets/nasnet/nasnet_test.py on lines 92..103
    research/slim/nets/nasnet/nasnet_test.py on lines 105..116
    research/slim/nets/nasnet/pnasnet_test.py on lines 82..93
    research/slim/nets/nasnet/pnasnet_test.py on lines 95..106

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

    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 testBuildPreLogitsMobileModel(self):
        batch_size = 5
        height, width = 224, 224
        num_classes = None
        inputs = tf.random.uniform((batch_size, height, width, 3))
    Severity: Major
    Found in research/slim/nets/nasnet/nasnet_test.py and 4 other locations - About 1 day to fix
    research/slim/nets/nasnet/nasnet_test.py on lines 79..90
    research/slim/nets/nasnet/nasnet_test.py on lines 105..116
    research/slim/nets/nasnet/pnasnet_test.py on lines 82..93
    research/slim/nets/nasnet/pnasnet_test.py on lines 95..106

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

    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 testNoAuxHeadCifarModel(self):
        batch_size = 5
        height, width = 32, 32
        num_classes = 10
        for use_aux_head in (True, False):
    Severity: Major
    Found in research/slim/nets/nasnet/nasnet_test.py and 4 other locations - About 1 day to fix
    research/slim/nets/nasnet/nasnet_test.py on lines 211..224
    research/slim/nets/nasnet/nasnet_test.py on lines 268..281
    research/slim/nets/nasnet/pnasnet_test.py on lines 180..193
    research/slim/nets/nasnet/pnasnet_test.py on lines 195..208

    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 testNoAuxHeadLargeModel(self):
        batch_size = 5
        height, width = 331, 331
        num_classes = 1000
        for use_aux_head in (True, False):
    Severity: Major
    Found in research/slim/nets/nasnet/nasnet_test.py and 4 other locations - About 1 day to fix
    research/slim/nets/nasnet/nasnet_test.py on lines 160..173
    research/slim/nets/nasnet/nasnet_test.py on lines 211..224
    research/slim/nets/nasnet/pnasnet_test.py on lines 180..193
    research/slim/nets/nasnet/pnasnet_test.py on lines 195..208

    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 testNoAuxHeadMobileModel(self):
        batch_size = 5
        height, width = 224, 224
        num_classes = 1000
        for use_aux_head in (True, False):
    Severity: Major
    Found in research/slim/nets/nasnet/nasnet_test.py and 4 other locations - About 1 day to fix
    research/slim/nets/nasnet/nasnet_test.py on lines 160..173
    research/slim/nets/nasnet/nasnet_test.py on lines 268..281
    research/slim/nets/nasnet/pnasnet_test.py on lines 180..193
    research/slim/nets/nasnet/pnasnet_test.py on lines 195..208

    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 testOverrideHParamsLargeModel(self):
        batch_size = 5
        height, width = 331, 331
        num_classes = 1000
        inputs = tf.random.uniform((batch_size, height, width, 3))
    Severity: Major
    Found in research/slim/nets/nasnet/nasnet_test.py and 4 other locations - About 1 day to fix
    research/slim/nets/nasnet/nasnet_test.py on lines 333..345
    research/slim/nets/nasnet/nasnet_test.py on lines 347..359
    research/slim/nets/nasnet/pnasnet_test.py on lines 210..222
    research/slim/nets/nasnet/pnasnet_test.py on lines 224..236

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

    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 testOverrideHParamsCifarModel(self):
        batch_size = 5
        height, width = 32, 32
        num_classes = 10
        inputs = tf.random.uniform((batch_size, height, width, 3))
    Severity: Major
    Found in research/slim/nets/nasnet/nasnet_test.py and 4 other locations - About 1 day to fix
    research/slim/nets/nasnet/nasnet_test.py on lines 347..359
    research/slim/nets/nasnet/nasnet_test.py on lines 361..373
    research/slim/nets/nasnet/pnasnet_test.py on lines 210..222
    research/slim/nets/nasnet/pnasnet_test.py on lines 224..236

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

    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 testOverrideHParamsMobileModel(self):
        batch_size = 5
        height, width = 224, 224
        num_classes = 1000
        inputs = tf.random.uniform((batch_size, height, width, 3))
    Severity: Major
    Found in research/slim/nets/nasnet/nasnet_test.py and 4 other locations - About 1 day to fix
    research/slim/nets/nasnet/nasnet_test.py on lines 333..345
    research/slim/nets/nasnet/nasnet_test.py on lines 361..373
    research/slim/nets/nasnet/pnasnet_test.py on lines 210..222
    research/slim/nets/nasnet/pnasnet_test.py on lines 224..236

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

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

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

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

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

    Refactorings

    Further Reading

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

        with tf.variable_scope('on_cpu'), tf.device('/cpu:0'):
          with slim.arg_scope(nasnet.nasnet_mobile_arg_scope()):
            nasnet.build_nasnet_mobile(inputs, num_classes)
    Severity: Major
    Found in research/slim/nets/nasnet/nasnet_test.py and 1 other location - About 1 hr to fix
    research/slim/nets/nasnet/nasnet_test.py on lines 293..295

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

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

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

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

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

    Refactorings

    Further Reading

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

        with tf.variable_scope('on_gpu'), tf.device('/gpu:0'):
          with slim.arg_scope(nasnet.nasnet_mobile_arg_scope()):
            nasnet.build_nasnet_mobile(inputs, num_classes)
    Severity: Major
    Found in research/slim/nets/nasnet/nasnet_test.py and 1 other location - About 1 hr to fix
    research/slim/nets/nasnet/nasnet_test.py on lines 290..292

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

    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

        for v in tf.get_collection(
            tf.GraphKeys.GLOBAL_VARIABLES, scope='on_gpu'):
          self.assertDeviceEqual(v.device, '/gpu:0')
    Severity: Major
    Found in research/slim/nets/nasnet/nasnet_test.py and 5 other locations - About 30 mins to fix
    research/slim/nets/inception_resnet_v2_test.py on lines 211..213
    research/slim/nets/inception_resnet_v2_test.py on lines 214..216
    research/slim/nets/inception_v4_test.py on lines 162..164
    research/slim/nets/inception_v4_test.py on lines 165..167
    research/slim/nets/nasnet/nasnet_test.py on lines 296..298

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

    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

        for v in tf.get_collection(
            tf.GraphKeys.GLOBAL_VARIABLES, scope='on_cpu'):
          self.assertDeviceEqual(v.device, '/cpu:0')
    Severity: Major
    Found in research/slim/nets/nasnet/nasnet_test.py and 5 other locations - About 30 mins to fix
    research/slim/nets/inception_resnet_v2_test.py on lines 211..213
    research/slim/nets/inception_resnet_v2_test.py on lines 214..216
    research/slim/nets/inception_v4_test.py on lines 162..164
    research/slim/nets/inception_v4_test.py on lines 165..167
    research/slim/nets/nasnet/nasnet_test.py on lines 299..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 32.

    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