tensorflow/models

View on GitHub
research/object_detection/inputs.py

Summary

Maintainability
F
1 wk
Test Coverage

File inputs.py has 1020 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: Major
Found in research/object_detection/inputs.py - About 2 days to fix

    Function transform_input_data has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
    Open

    def transform_input_data(tensor_dict,
                             model_preprocess_fn,
                             image_resizer_fn,
                             num_classes,
                             data_augmentation_fn=None,
    Severity: Minor
    Found in research/object_detection/inputs.py - About 4 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function pad_input_data_to_static_shapes has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
    Open

    def pad_input_data_to_static_shapes(tensor_dict,
                                        max_num_boxes,
                                        num_classes,
                                        spatial_image_shape=None,
                                        max_num_context_features=None,
    Severity: Minor
    Found in research/object_detection/inputs.py - About 3 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function get_reduce_to_frame_fn has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

    def get_reduce_to_frame_fn(input_reader_config, is_training):
      """Returns a function reducing sequence tensors to single frame tensors.
    
      If the input type is not TF_SEQUENCE_EXAMPLE, the tensors are passed through
      this function unchanged. Otherwise, when in training mode, a single frame is
    Severity: Minor
    Found in research/object_detection/inputs.py - About 3 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function transform_input_data has 12 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def transform_input_data(tensor_dict,
    Severity: Major
    Found in research/object_detection/inputs.py - About 1 hr to fix

      Function transform_input_data has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def transform_input_data(tensor_dict,
                               model_preprocess_fn,
                               image_resizer_fn,
                               num_classes,
                               data_augmentation_fn=None,
      Severity: Minor
      Found in research/object_detection/inputs.py - About 1 hr to fix

        Function pad_input_data_to_static_shapes has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def pad_input_data_to_static_shapes(tensor_dict,
        Severity: Major
        Found in research/object_detection/inputs.py - About 50 mins to fix

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

          def eval_input(eval_config, eval_input_config, model_config,
          Severity: Minor
          Found in research/object_detection/inputs.py - About 45 mins to fix

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

            def train_input(train_config, train_input_config,
            Severity: Minor
            Found in research/object_detection/inputs.py - About 45 mins to fix

              Function train_input has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              def train_input(train_config, train_input_config,
                              model_config, model=None, params=None, input_context=None):
                """Returns `features` and `labels` tensor dictionaries for training.
              
                Args:
              Severity: Minor
              Found in research/object_detection/inputs.py - About 35 mins to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function eval_input has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              def eval_input(eval_config, eval_input_config, model_config,
                             model=None, params=None, input_context=None):
                """Returns `features` and `labels` tensor dictionaries for evaluation.
              
                Args:
              Severity: Minor
              Found in research/object_detection/inputs.py - About 35 mins to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

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

              def _get_features_dict(input_dict, include_source_id=False):
                """Extracts features dict from input dict."""
              
                source_id = _replace_empty_string_with_random_number(
                    input_dict[fields.InputDataFields.source_id])
              Severity: Minor
              Found in research/object_detection/inputs.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

                if input_fields.groundtruth_keypoint_weights in tensor_dict:
                  tensor_shape = (
                      tensor_dict[input_fields.groundtruth_keypoint_weights].shape)
                  padding_shape = [max_num_boxes, shape_utils.get_dim_as_int(tensor_shape[1])]
                  padding_shapes[input_fields.
              Severity: Major
              Found in research/object_detection/inputs.py and 1 other location - About 2 hrs to fix
              research/object_detection/inputs.py on lines 518..522

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

              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

                if input_fields.groundtruth_keypoint_visibilities in tensor_dict:
                  tensor_shape = tensor_dict[input_fields.
                                             groundtruth_keypoint_visibilities].shape
                  padding_shape = [max_num_boxes, shape_utils.get_dim_as_int(tensor_shape[1])]
                  padding_shapes[input_fields.
              Severity: Major
              Found in research/object_detection/inputs.py and 1 other location - About 2 hrs to fix
              research/object_detection/inputs.py on lines 534..538

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

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

                if fields.InputDataFields.original_image in input_dict:
                  features[fields.InputDataFields.original_image] = input_dict[
                      fields.InputDataFields.original_image]
              Severity: Major
              Found in research/object_detection/inputs.py and 6 other locations - About 1 hr to fix
              research/object_detection/legacy/evaluator.py on lines 105..107
              research/object_detection/inputs.py on lines 740..742
              research/object_detection/inputs.py on lines 743..745
              research/object_detection/inputs.py on lines 746..748
              research/object_detection/inputs.py on lines 749..751
              research/object_detection/model_lib.py on lines 671..673

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

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

                if fields.InputDataFields.image_additional_channels in input_dict:
                  features[fields.InputDataFields.image_additional_channels] = input_dict[
                      fields.InputDataFields.image_additional_channels]
              Severity: Major
              Found in research/object_detection/inputs.py and 6 other locations - About 1 hr to fix
              research/object_detection/legacy/evaluator.py on lines 105..107
              research/object_detection/inputs.py on lines 737..739
              research/object_detection/inputs.py on lines 743..745
              research/object_detection/inputs.py on lines 746..748
              research/object_detection/inputs.py on lines 749..751
              research/object_detection/model_lib.py on lines 671..673

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

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

                if fields.InputDataFields.valid_context_size in input_dict:
                  features[fields.InputDataFields.valid_context_size] = input_dict[
                      fields.InputDataFields.valid_context_size]
              Severity: Major
              Found in research/object_detection/inputs.py and 6 other locations - About 1 hr to fix
              research/object_detection/legacy/evaluator.py on lines 105..107
              research/object_detection/inputs.py on lines 737..739
              research/object_detection/inputs.py on lines 740..742
              research/object_detection/inputs.py on lines 743..745
              research/object_detection/inputs.py on lines 749..751
              research/object_detection/model_lib.py on lines 671..673

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

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

                if fields.InputDataFields.context_features_image_id_list in input_dict:
                  features[fields.InputDataFields.context_features_image_id_list] = (
                      input_dict[fields.InputDataFields.context_features_image_id_list])
              Severity: Major
              Found in research/object_detection/inputs.py and 6 other locations - About 1 hr to fix
              research/object_detection/legacy/evaluator.py on lines 105..107
              research/object_detection/inputs.py on lines 737..739
              research/object_detection/inputs.py on lines 740..742
              research/object_detection/inputs.py on lines 743..745
              research/object_detection/inputs.py on lines 746..748
              research/object_detection/model_lib.py on lines 671..673

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

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

                if fields.InputDataFields.context_features in input_dict:
                  features[fields.InputDataFields.context_features] = input_dict[
                      fields.InputDataFields.context_features]
              Severity: Major
              Found in research/object_detection/inputs.py and 6 other locations - About 1 hr to fix
              research/object_detection/legacy/evaluator.py on lines 105..107
              research/object_detection/inputs.py on lines 737..739
              research/object_detection/inputs.py on lines 740..742
              research/object_detection/inputs.py on lines 746..748
              research/object_detection/inputs.py on lines 749..751
              research/object_detection/model_lib.py on lines 671..673

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

              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

                if model is None:
                  model_preprocess_fn = INPUT_BUILDER_UTIL_MAP['model_build'](
                      model_config, is_training=True).preprocess
                else:
                  model_preprocess_fn = model.preprocess
              Severity: Major
              Found in research/object_detection/inputs.py and 1 other location - About 1 hr to fix
              research/object_detection/inputs.py on lines 1030..1034

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

              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

                if model is None:
                  model_preprocess_fn = INPUT_BUILDER_UTIL_MAP['model_build'](
                      model_config, is_training=False).preprocess
                else:
                  model_preprocess_fn = model.preprocess
              Severity: Major
              Found in research/object_detection/inputs.py and 1 other location - About 1 hr to fix
              research/object_detection/inputs.py on lines 861..865

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

              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

                if input_fields.image_additional_channels in tensor_dict:
                  num_additional_channels = shape_utils.get_dim_as_int(tensor_dict[
                      input_fields.image_additional_channels].shape[2])
              Severity: Major
              Found in research/object_detection/inputs.py and 1 other location - About 1 hr to fix
              research/object_detection/inputs.py on lines 451..453

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

              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

                if input_fields.image in tensor_dict:
                  num_channels = shape_utils.get_dim_as_int(
                      tensor_dict[input_fields.image].shape[2])
              Severity: Major
              Found in research/object_detection/inputs.py and 1 other location - About 1 hr to fix
              research/object_detection/inputs.py on lines 444..446

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

              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_train_input_fn(train_config, train_input_config,
                                        model_config):
                """Creates a train `input` function for `Estimator`.
              
                Args:
              Severity: Minor
              Found in research/object_detection/inputs.py and 1 other location - About 45 mins to fix
              research/object_detection/inputs.py on lines 917..933

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

              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_eval_input_fn(eval_config, eval_input_config, model_config):
                """Creates an eval `input` function for `Estimator`.
              
                Args:
                  eval_config: An eval_pb2.EvalConfig.
              Severity: Minor
              Found in research/object_detection/inputs.py and 1 other location - About 45 mins to fix
              research/object_detection/inputs.py on lines 755..772

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

              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