tensorflow/models

View on GitHub
research/object_detection/builders/dataset_builder_test.py

Summary

Maintainability
F
2 wks
Test Coverage

File dataset_builder_test.py has 575 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/builders/dataset_builder_test.py - About 1 day to fix

    Function create_tf_record has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

      def create_tf_record(self, has_additional_channels=False, num_shards=1,
                           num_examples_per_shard=1):
    
        def dummy_jpeg_fn():
          image_tensor = np.random.randint(255, size=(4, 5, 3)).astype(np.uint8)
    Severity: Minor
    Found in research/object_detection/builders/dataset_builder_test.py - About 1 hr 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 test_sample_all_data(self):
        tf_record_path = self.create_tf_record(num_examples_per_shard=2)
    
        input_reader_text_proto = """
          shuffle: false
    Severity: Major
    Found in research/object_detection/builders/dataset_builder_test.py and 1 other location - About 1 day to fix
    research/object_detection/builders/dataset_builder_test.py on lines 395..420

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

    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 test_sample_one_of_n_shards(self):
        tf_record_path = self.create_tf_record(num_examples_per_shard=4)
    
        input_reader_text_proto = """
          shuffle: false
    Severity: Major
    Found in research/object_detection/builders/dataset_builder_test.py and 1 other location - About 1 day to fix
    research/object_detection/builders/dataset_builder_test.py on lines 368..393

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

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

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

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

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

    Refactorings

    Further Reading

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

      def test_read_dataset_sample_from_datasets_weights_equal_weight(self):
        """Ensure that the files' values are equally-weighted."""
        config = input_reader_pb2.InputReader()
        config.num_readers = 2
        config.shuffle = False
    Severity: Major
    Found in research/object_detection/builders/dataset_builder_test.py and 3 other locations - About 1 day to fix
    research/object_detection/builders/dataset_builder_test.py on lines 579..599
    research/object_detection/builders/dataset_builder_test.py on lines 601..619
    research/object_detection/builders/dataset_builder_test.py on lines 621..639

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

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

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

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

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

    Refactorings

    Further Reading

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

      def test_read_dataset_sample_from_datasets_weights_zero_weight(self):
        """Ensure that the files' values are equally-weighted."""
        config = input_reader_pb2.InputReader()
        config.num_readers = 2
        config.shuffle = False
    Severity: Major
    Found in research/object_detection/builders/dataset_builder_test.py and 3 other locations - About 1 day to fix
    research/object_detection/builders/dataset_builder_test.py on lines 559..577
    research/object_detection/builders/dataset_builder_test.py on lines 579..599
    research/object_detection/builders/dataset_builder_test.py on lines 621..639

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

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

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

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

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

    Refactorings

    Further Reading

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

      def test_read_dataset_sample_from_datasets_weights_unbalanced(self):
        """Ensure that the files' values are equally-weighted."""
        config = input_reader_pb2.InputReader()
        config.num_readers = 2
        config.shuffle = False
    Severity: Major
    Found in research/object_detection/builders/dataset_builder_test.py and 3 other locations - About 1 day to fix
    research/object_detection/builders/dataset_builder_test.py on lines 559..577
    research/object_detection/builders/dataset_builder_test.py on lines 579..599
    research/object_detection/builders/dataset_builder_test.py on lines 601..619

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

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

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

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

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

    Refactorings

    Further Reading

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

      def test_read_dataset_sample_from_datasets_weights_non_normalized(self):
        """Ensure that the values are equally-weighted when not normalized."""
        config = input_reader_pb2.InputReader()
        config.num_readers = 2
        config.shuffle = False
    Severity: Major
    Found in research/object_detection/builders/dataset_builder_test.py and 3 other locations - About 1 day to fix
    research/object_detection/builders/dataset_builder_test.py on lines 559..577
    research/object_detection/builders/dataset_builder_test.py on lines 601..619
    research/object_detection/builders/dataset_builder_test.py on lines 621..639

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

    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 test_reduce_num_reader(self):
        config = input_reader_pb2.InputReader()
        config.num_readers = 10
        config.shuffle = False
    
    
    Severity: Major
    Found in research/object_detection/builders/dataset_builder_test.py and 1 other location - About 6 hrs to fix
    research/object_detection/builders/dataset_builder_test.py on lines 641..656

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

    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 test_read_dataset(self):
        config = input_reader_pb2.InputReader()
        config.num_readers = 1
        config.shuffle = False
    
    
    Severity: Major
    Found in research/object_detection/builders/dataset_builder_test.py and 1 other location - About 6 hrs to fix
    research/object_detection/builders/dataset_builder_test.py on lines 659..674

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

    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

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

          sequence_example_serialized = seq_example_util.make_sequence_example(
              dataset_name='video_dataset',
              video_id='video',
              encoded_images=encoded_images,
              image_height=image_height,
    Severity: Major
    Found in research/object_detection/builders/dataset_builder_test.py and 2 other locations - About 5 hrs to fix
    research/object_detection/builders/decoder_builder_test.py on lines 96..116
    research/object_detection/builders/input_reader_builder_tf1_test.py on lines 90..110

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

    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 graph_fn():
          images = tf.cast(tf.random.uniform(
              [num_frames, image_height, image_width, 3],
              maxval=256,
              dtype=tf.int32), dtype=tf.uint8)
    Severity: Major
    Found in research/object_detection/builders/dataset_builder_test.py and 1 other location - About 4 hrs to fix
    research/object_detection/builders/decoder_builder_test.py on lines 79..86

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

    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 test_raises_error_with_no_input_paths(self):
        input_reader_text_proto = """
          shuffle: false
          num_readers: 1
          load_instance_masks: true
    Severity: Major
    Found in research/object_detection/builders/dataset_builder_test.py and 1 other location - About 2 hrs to fix
    research/object_detection/utils/label_map_util_test.py on lines 388..414

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 53.

    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

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

        def one_hot_class_encoding_fn(tensor_dict):
          tensor_dict[fields.InputDataFields.groundtruth_classes] = tf.one_hot(
              tensor_dict[fields.InputDataFields.groundtruth_classes] - 1, depth=3)
          return tensor_dict
    Severity: Major
    Found in research/object_detection/builders/dataset_builder_test.py and 1 other location - About 2 hrs to fix
    research/object_detection/builders/dataset_builder_test.py on lines 301..304

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

    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

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

        def one_hot_class_encoding_fn(tensor_dict):
          tensor_dict[fields.InputDataFields.groundtruth_classes] = tf.one_hot(
              tensor_dict[fields.InputDataFields.groundtruth_classes] - 1, depth=3)
          return tensor_dict
    Severity: Major
    Found in research/object_detection/builders/dataset_builder_test.py and 1 other location - About 2 hrs to fix
    research/object_detection/builders/dataset_builder_test.py on lines 339..342

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

    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

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

          try:
            # Dynamically try to load the tf v2 lookup, falling back to contrib
            lookup = tf.compat.v2.lookup
            hash_table_class = tf.compat.v2.lookup.StaticHashTable
          except AttributeError:
    Severity: Major
    Found in research/object_detection/builders/dataset_builder_test.py and 3 other locations - About 1 hr to fix
    research/object_detection/data_decoders/tf_example_decoder.py on lines 96..102
    research/object_detection/data_decoders/tf_example_decoder.py on lines 316..322
    research/object_detection/data_decoders/tf_sequence_example_decoder.py on lines 70..76

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 43.

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

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

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

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

    Refactorings

    Further Reading

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

    def _get_labelmap_path():
      """Returns an absolute path to label map file."""
      parent_path = os.path.dirname(tf.resource_loader.get_data_files_path())
      return os.path.join(parent_path, 'data',
                          'pet_label_map.pbtxt')
    Severity: Major
    Found in research/object_detection/builders/dataset_builder_test.py and 2 other locations - About 1 hr to fix
    research/object_detection/builders/decoder_builder_test.py on lines 34..38
    research/object_detection/builders/input_reader_builder_tf1_test.py on lines 33..37

    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

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

            if has_additional_channels:
              additional_channels_key = 'image/additional_channels/encoded'
              features[additional_channels_key] = dataset_util.bytes_list_feature(
                  [encoded_additional_channels_jpeg] * 2)
    Severity: Minor
    Found in research/object_detection/builders/dataset_builder_test.py and 1 other location - About 40 mins to fix
    research/object_detection/builders/decoder_builder_test.py on lines 70..73

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

    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