tensorflow/models

View on GitHub
official/legacy/image_classification/vgg/vgg_model.py

Summary

Maintainability
C
1 day
Test Coverage

Function vgg16 has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def vgg16(num_classes,
          batch_size=None,
          use_l2_regularizer=True,
          batch_norm_decay=0.9,
          batch_norm_epsilon=1e-5):
Severity: Major
Found in official/legacy/image_classification/vgg/vgg_model.py - About 2 hrs to fix

    Function vgg16 has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def vgg16(num_classes,
    Severity: Minor
    Found in official/legacy/image_classification/vgg/vgg_model.py - About 35 mins to fix

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

        if tf_keras.backend.image_data_format() == 'channels_first':
          x = layers.Permute((3, 1, 2))(x)
          bn_axis = 1
        else:  # channels_last
          bn_axis = 3
      Severity: Major
      Found in official/legacy/image_classification/vgg/vgg_model.py and 1 other location - About 1 hr to fix
      official/legacy/image_classification/resnet/resnet_model.py on lines 261..265

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 46.

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

        x = layers.Conv2D(
            128, (3, 3),
            padding='same',
            kernel_regularizer=_gen_l2_regularizer(use_l2_regularizer),
      Severity: Major
      Found in official/legacy/image_classification/vgg/vgg_model.py and 12 other locations - About 35 mins to fix
      official/legacy/image_classification/vgg/vgg_model.py on lines 62..65
      official/legacy/image_classification/vgg/vgg_model.py on lines 75..78
      official/legacy/image_classification/vgg/vgg_model.py on lines 104..107
      official/legacy/image_classification/vgg/vgg_model.py on lines 120..123
      official/legacy/image_classification/vgg/vgg_model.py on lines 133..136
      official/legacy/image_classification/vgg/vgg_model.py on lines 146..149
      official/legacy/image_classification/vgg/vgg_model.py on lines 162..165
      official/legacy/image_classification/vgg/vgg_model.py on lines 175..178
      official/legacy/image_classification/vgg/vgg_model.py on lines 188..191
      official/legacy/image_classification/vgg/vgg_model.py on lines 204..207
      official/legacy/image_classification/vgg/vgg_model.py on lines 217..220
      official/legacy/image_classification/vgg/vgg_model.py on lines 230..233

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

        x = layers.Conv2D(
            256, (3, 3),
            padding='same',
            kernel_regularizer=_gen_l2_regularizer(use_l2_regularizer),
      Severity: Major
      Found in official/legacy/image_classification/vgg/vgg_model.py and 12 other locations - About 35 mins to fix
      official/legacy/image_classification/vgg/vgg_model.py on lines 62..65
      official/legacy/image_classification/vgg/vgg_model.py on lines 75..78
      official/legacy/image_classification/vgg/vgg_model.py on lines 91..94
      official/legacy/image_classification/vgg/vgg_model.py on lines 104..107
      official/legacy/image_classification/vgg/vgg_model.py on lines 120..123
      official/legacy/image_classification/vgg/vgg_model.py on lines 146..149
      official/legacy/image_classification/vgg/vgg_model.py on lines 162..165
      official/legacy/image_classification/vgg/vgg_model.py on lines 175..178
      official/legacy/image_classification/vgg/vgg_model.py on lines 188..191
      official/legacy/image_classification/vgg/vgg_model.py on lines 204..207
      official/legacy/image_classification/vgg/vgg_model.py on lines 217..220
      official/legacy/image_classification/vgg/vgg_model.py on lines 230..233

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

        x = layers.Conv2D(
            512, (3, 3),
            padding='same',
            kernel_regularizer=_gen_l2_regularizer(use_l2_regularizer),
      Severity: Major
      Found in official/legacy/image_classification/vgg/vgg_model.py and 12 other locations - About 35 mins to fix
      official/legacy/image_classification/vgg/vgg_model.py on lines 62..65
      official/legacy/image_classification/vgg/vgg_model.py on lines 75..78
      official/legacy/image_classification/vgg/vgg_model.py on lines 91..94
      official/legacy/image_classification/vgg/vgg_model.py on lines 104..107
      official/legacy/image_classification/vgg/vgg_model.py on lines 120..123
      official/legacy/image_classification/vgg/vgg_model.py on lines 133..136
      official/legacy/image_classification/vgg/vgg_model.py on lines 146..149
      official/legacy/image_classification/vgg/vgg_model.py on lines 162..165
      official/legacy/image_classification/vgg/vgg_model.py on lines 188..191
      official/legacy/image_classification/vgg/vgg_model.py on lines 204..207
      official/legacy/image_classification/vgg/vgg_model.py on lines 217..220
      official/legacy/image_classification/vgg/vgg_model.py on lines 230..233

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

        x = layers.Conv2D(
            512, (3, 3),
            padding='same',
            kernel_regularizer=_gen_l2_regularizer(use_l2_regularizer),
      Severity: Major
      Found in official/legacy/image_classification/vgg/vgg_model.py and 12 other locations - About 35 mins to fix
      official/legacy/image_classification/vgg/vgg_model.py on lines 62..65
      official/legacy/image_classification/vgg/vgg_model.py on lines 75..78
      official/legacy/image_classification/vgg/vgg_model.py on lines 91..94
      official/legacy/image_classification/vgg/vgg_model.py on lines 104..107
      official/legacy/image_classification/vgg/vgg_model.py on lines 120..123
      official/legacy/image_classification/vgg/vgg_model.py on lines 133..136
      official/legacy/image_classification/vgg/vgg_model.py on lines 146..149
      official/legacy/image_classification/vgg/vgg_model.py on lines 162..165
      official/legacy/image_classification/vgg/vgg_model.py on lines 175..178
      official/legacy/image_classification/vgg/vgg_model.py on lines 188..191
      official/legacy/image_classification/vgg/vgg_model.py on lines 217..220
      official/legacy/image_classification/vgg/vgg_model.py on lines 230..233

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

        x = layers.Conv2D(
            512, (3, 3),
            padding='same',
            kernel_regularizer=_gen_l2_regularizer(use_l2_regularizer),
      Severity: Major
      Found in official/legacy/image_classification/vgg/vgg_model.py and 12 other locations - About 35 mins to fix
      official/legacy/image_classification/vgg/vgg_model.py on lines 62..65
      official/legacy/image_classification/vgg/vgg_model.py on lines 75..78
      official/legacy/image_classification/vgg/vgg_model.py on lines 91..94
      official/legacy/image_classification/vgg/vgg_model.py on lines 104..107
      official/legacy/image_classification/vgg/vgg_model.py on lines 120..123
      official/legacy/image_classification/vgg/vgg_model.py on lines 133..136
      official/legacy/image_classification/vgg/vgg_model.py on lines 146..149
      official/legacy/image_classification/vgg/vgg_model.py on lines 162..165
      official/legacy/image_classification/vgg/vgg_model.py on lines 175..178
      official/legacy/image_classification/vgg/vgg_model.py on lines 188..191
      official/legacy/image_classification/vgg/vgg_model.py on lines 204..207
      official/legacy/image_classification/vgg/vgg_model.py on lines 230..233

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

        x = layers.Conv2D(
            64, (3, 3),
            padding='same',
            kernel_regularizer=_gen_l2_regularizer(use_l2_regularizer),
      Severity: Major
      Found in official/legacy/image_classification/vgg/vgg_model.py and 12 other locations - About 35 mins to fix
      official/legacy/image_classification/vgg/vgg_model.py on lines 62..65
      official/legacy/image_classification/vgg/vgg_model.py on lines 91..94
      official/legacy/image_classification/vgg/vgg_model.py on lines 104..107
      official/legacy/image_classification/vgg/vgg_model.py on lines 120..123
      official/legacy/image_classification/vgg/vgg_model.py on lines 133..136
      official/legacy/image_classification/vgg/vgg_model.py on lines 146..149
      official/legacy/image_classification/vgg/vgg_model.py on lines 162..165
      official/legacy/image_classification/vgg/vgg_model.py on lines 175..178
      official/legacy/image_classification/vgg/vgg_model.py on lines 188..191
      official/legacy/image_classification/vgg/vgg_model.py on lines 204..207
      official/legacy/image_classification/vgg/vgg_model.py on lines 217..220
      official/legacy/image_classification/vgg/vgg_model.py on lines 230..233

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

        x = layers.Conv2D(
            64, (3, 3),
            padding='same',
            kernel_regularizer=_gen_l2_regularizer(use_l2_regularizer),
      Severity: Major
      Found in official/legacy/image_classification/vgg/vgg_model.py and 12 other locations - About 35 mins to fix
      official/legacy/image_classification/vgg/vgg_model.py on lines 75..78
      official/legacy/image_classification/vgg/vgg_model.py on lines 91..94
      official/legacy/image_classification/vgg/vgg_model.py on lines 104..107
      official/legacy/image_classification/vgg/vgg_model.py on lines 120..123
      official/legacy/image_classification/vgg/vgg_model.py on lines 133..136
      official/legacy/image_classification/vgg/vgg_model.py on lines 146..149
      official/legacy/image_classification/vgg/vgg_model.py on lines 162..165
      official/legacy/image_classification/vgg/vgg_model.py on lines 175..178
      official/legacy/image_classification/vgg/vgg_model.py on lines 188..191
      official/legacy/image_classification/vgg/vgg_model.py on lines 204..207
      official/legacy/image_classification/vgg/vgg_model.py on lines 217..220
      official/legacy/image_classification/vgg/vgg_model.py on lines 230..233

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

        x = layers.Conv2D(
            256, (3, 3),
            padding='same',
            kernel_regularizer=_gen_l2_regularizer(use_l2_regularizer),
      Severity: Major
      Found in official/legacy/image_classification/vgg/vgg_model.py and 12 other locations - About 35 mins to fix
      official/legacy/image_classification/vgg/vgg_model.py on lines 62..65
      official/legacy/image_classification/vgg/vgg_model.py on lines 75..78
      official/legacy/image_classification/vgg/vgg_model.py on lines 91..94
      official/legacy/image_classification/vgg/vgg_model.py on lines 104..107
      official/legacy/image_classification/vgg/vgg_model.py on lines 133..136
      official/legacy/image_classification/vgg/vgg_model.py on lines 146..149
      official/legacy/image_classification/vgg/vgg_model.py on lines 162..165
      official/legacy/image_classification/vgg/vgg_model.py on lines 175..178
      official/legacy/image_classification/vgg/vgg_model.py on lines 188..191
      official/legacy/image_classification/vgg/vgg_model.py on lines 204..207
      official/legacy/image_classification/vgg/vgg_model.py on lines 217..220
      official/legacy/image_classification/vgg/vgg_model.py on lines 230..233

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

        x = layers.Conv2D(
            512, (3, 3),
            padding='same',
            kernel_regularizer=_gen_l2_regularizer(use_l2_regularizer),
      Severity: Major
      Found in official/legacy/image_classification/vgg/vgg_model.py and 12 other locations - About 35 mins to fix
      official/legacy/image_classification/vgg/vgg_model.py on lines 62..65
      official/legacy/image_classification/vgg/vgg_model.py on lines 75..78
      official/legacy/image_classification/vgg/vgg_model.py on lines 91..94
      official/legacy/image_classification/vgg/vgg_model.py on lines 104..107
      official/legacy/image_classification/vgg/vgg_model.py on lines 120..123
      official/legacy/image_classification/vgg/vgg_model.py on lines 133..136
      official/legacy/image_classification/vgg/vgg_model.py on lines 146..149
      official/legacy/image_classification/vgg/vgg_model.py on lines 175..178
      official/legacy/image_classification/vgg/vgg_model.py on lines 188..191
      official/legacy/image_classification/vgg/vgg_model.py on lines 204..207
      official/legacy/image_classification/vgg/vgg_model.py on lines 217..220
      official/legacy/image_classification/vgg/vgg_model.py on lines 230..233

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

        x = layers.Conv2D(
            256, (3, 3),
            padding='same',
            kernel_regularizer=_gen_l2_regularizer(use_l2_regularizer),
      Severity: Major
      Found in official/legacy/image_classification/vgg/vgg_model.py and 12 other locations - About 35 mins to fix
      official/legacy/image_classification/vgg/vgg_model.py on lines 62..65
      official/legacy/image_classification/vgg/vgg_model.py on lines 75..78
      official/legacy/image_classification/vgg/vgg_model.py on lines 91..94
      official/legacy/image_classification/vgg/vgg_model.py on lines 104..107
      official/legacy/image_classification/vgg/vgg_model.py on lines 120..123
      official/legacy/image_classification/vgg/vgg_model.py on lines 133..136
      official/legacy/image_classification/vgg/vgg_model.py on lines 162..165
      official/legacy/image_classification/vgg/vgg_model.py on lines 175..178
      official/legacy/image_classification/vgg/vgg_model.py on lines 188..191
      official/legacy/image_classification/vgg/vgg_model.py on lines 204..207
      official/legacy/image_classification/vgg/vgg_model.py on lines 217..220
      official/legacy/image_classification/vgg/vgg_model.py on lines 230..233

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

        x = layers.Conv2D(
            128, (3, 3),
            padding='same',
            kernel_regularizer=_gen_l2_regularizer(use_l2_regularizer),
      Severity: Major
      Found in official/legacy/image_classification/vgg/vgg_model.py and 12 other locations - About 35 mins to fix
      official/legacy/image_classification/vgg/vgg_model.py on lines 62..65
      official/legacy/image_classification/vgg/vgg_model.py on lines 75..78
      official/legacy/image_classification/vgg/vgg_model.py on lines 91..94
      official/legacy/image_classification/vgg/vgg_model.py on lines 120..123
      official/legacy/image_classification/vgg/vgg_model.py on lines 133..136
      official/legacy/image_classification/vgg/vgg_model.py on lines 146..149
      official/legacy/image_classification/vgg/vgg_model.py on lines 162..165
      official/legacy/image_classification/vgg/vgg_model.py on lines 175..178
      official/legacy/image_classification/vgg/vgg_model.py on lines 188..191
      official/legacy/image_classification/vgg/vgg_model.py on lines 204..207
      official/legacy/image_classification/vgg/vgg_model.py on lines 217..220
      official/legacy/image_classification/vgg/vgg_model.py on lines 230..233

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

        x = layers.Conv2D(
            512, (3, 3),
            padding='same',
            kernel_regularizer=_gen_l2_regularizer(use_l2_regularizer),
      Severity: Major
      Found in official/legacy/image_classification/vgg/vgg_model.py and 12 other locations - About 35 mins to fix
      official/legacy/image_classification/vgg/vgg_model.py on lines 62..65
      official/legacy/image_classification/vgg/vgg_model.py on lines 75..78
      official/legacy/image_classification/vgg/vgg_model.py on lines 91..94
      official/legacy/image_classification/vgg/vgg_model.py on lines 104..107
      official/legacy/image_classification/vgg/vgg_model.py on lines 120..123
      official/legacy/image_classification/vgg/vgg_model.py on lines 133..136
      official/legacy/image_classification/vgg/vgg_model.py on lines 146..149
      official/legacy/image_classification/vgg/vgg_model.py on lines 162..165
      official/legacy/image_classification/vgg/vgg_model.py on lines 175..178
      official/legacy/image_classification/vgg/vgg_model.py on lines 204..207
      official/legacy/image_classification/vgg/vgg_model.py on lines 217..220
      official/legacy/image_classification/vgg/vgg_model.py on lines 230..233

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

        x = layers.Conv2D(
            512, (3, 3),
            padding='same',
            kernel_regularizer=_gen_l2_regularizer(use_l2_regularizer),
      Severity: Major
      Found in official/legacy/image_classification/vgg/vgg_model.py and 12 other locations - About 35 mins to fix
      official/legacy/image_classification/vgg/vgg_model.py on lines 62..65
      official/legacy/image_classification/vgg/vgg_model.py on lines 75..78
      official/legacy/image_classification/vgg/vgg_model.py on lines 91..94
      official/legacy/image_classification/vgg/vgg_model.py on lines 104..107
      official/legacy/image_classification/vgg/vgg_model.py on lines 120..123
      official/legacy/image_classification/vgg/vgg_model.py on lines 133..136
      official/legacy/image_classification/vgg/vgg_model.py on lines 146..149
      official/legacy/image_classification/vgg/vgg_model.py on lines 162..165
      official/legacy/image_classification/vgg/vgg_model.py on lines 175..178
      official/legacy/image_classification/vgg/vgg_model.py on lines 188..191
      official/legacy/image_classification/vgg/vgg_model.py on lines 204..207
      official/legacy/image_classification/vgg/vgg_model.py on lines 217..220

      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