cgddrd/CS39440-major-project

View on GitHub
src/template_matching_scaling/template_matching.py

Summary

Maintainability
F
2 wks
Test Coverage

Function template_matching_roi_scale_centre has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

    def template_matching_roi_scale_centre(self, template_patch, template_patch_origin, match_method, exhaustive_search=False):
        """
        Performs template matching using either an exhaustive or non-exhaustive search within a localised search column spanning from the current row
        to the bottom of the image. Geometric scaling of the template patch is performed relative to its centre.

Severity: Minor
Found in src/template_matching_scaling/template_matching.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 template_matching_roi_scale_top has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

    def template_matching_roi_scale_top(self, template_patch, template_patch_origin, match_method, exhaustive_search=False):
        """
        Performs template matching using either an exhaustive or non-exhaustive search within a localised search column spanning from the current row
        to the bottom of the image. Geometric scaling of the template patch is performed relative to its top origin.

Severity: Minor
Found in src/template_matching_scaling/template_matching.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 template_matching_roi_no_scale has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    def template_matching_roi_no_scale(self, template_patch, template_patch_origin, match_method, exhaustive_search=False):
        """
        Performs template matching using either an exhaustive or non-exhaustive search within a localised search column spanning from the current row
        to the bottom of the image. No scaling is performed.

Severity: Minor
Found in src/template_matching_scaling/template_matching.py - About 2 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

File template_matching.py has 279 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""

Module Name: TemplateMatching

Description: Performs each template matching experiment based upon the parameters passed in by the test rig.
Severity: Minor
Found in src/template_matching_scaling/template_matching.py - About 2 hrs to fix

    Function run_template_search has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def run_template_search(self, patch_height, match_method, use_scaling=False, scale_centre=False, exhaustive_search=False, plot_results=False):
            """
            Moves through each image row, performing template matching search down through a localised search column originating from the current row to
            the bottom of the image.
    
    
    Severity: Minor
    Found in src/template_matching_scaling/template_matching.py - About 55 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 __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__(self, image_one_file_path, image_two_file_path, calibration_data_file_path, plot_axis, use_hsv_colour_space=True, strip_luminance=True, demo_mode=False):
    Severity: Major
    Found in src/template_matching_scaling/template_matching.py - About 50 mins to fix

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

          def run_template_search(self, patch_height, match_method, use_scaling=False, scale_centre=False, exhaustive_search=False, plot_results=False):
      Severity: Minor
      Found in src/template_matching_scaling/template_matching.py - About 45 mins to fix

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

            def plot(self, data_x, data_y, plot_format, plot_name, max_boundary_offset=0):
        Severity: Minor
        Found in src/template_matching_scaling/template_matching.py - About 35 mins to fix

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

              def template_matching_roi_no_scale(self, template_patch, template_patch_origin, match_method, exhaustive_search=False):
                  """
                  Performs template matching using either an exhaustive or non-exhaustive search within a localised search column spanning from the current row
                  to the bottom of the image. No scaling is performed.
          
          
          Severity: Major
          Found in src/template_matching_scaling/template_matching.py and 1 other location - About 3 days to fix
          final/technical_work/primary_experiments/python/template_matching_scaling/template_matching.py on lines 128..209

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

          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 run_template_search(self, patch_height, match_method, use_scaling=False, scale_centre=False, exhaustive_search=False, plot_results=False):
                  """
                  Moves through each image row, performing template matching search down through a localised search column originating from the current row to
                  the bottom of the image.
          
          
          Severity: Major
          Found in src/template_matching_scaling/template_matching.py and 1 other location - About 2 days to fix
          final/technical_work/primary_experiments/python/template_matching_scaling/template_matching.py on lines 62..126

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

          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 plot_results(self, results, match_method):
                  """
                  Plots the results of the current test to a new graph using the 'Matplotlib' library.
          
                  :param results: The current template patch that we wish to try and locate in the second image.
          Severity: Major
          Found in src/template_matching_scaling/template_matching.py and 1 other location - About 1 day to fix
          final/technical_work/primary_experiments/python/template_matching_scaling/template_matching.py on lines 416..443

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

          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 prev_current_window_scaled_coords is None:
                          current_window_scaled_coords = TSEPoint((image_centre_x - patch_half_width), i), TSEPoint((image_centre_x + patch_half_width), i + template_patch_height)
          
                      else:
          
          
          Severity: Major
          Found in src/template_matching_scaling/template_matching.py and 1 other location - About 1 day to fix
          final/technical_work/primary_experiments/python/template_matching_scaling/template_matching.py on lines 363..372

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

          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 match_method.match_type == tse_match_methods.DISTANCE_ED:
                          score, extracted_window = TSEImageUtils.calc_ed_template_match_score_scaled_compiled(template_patch, scaled_search_window)
          
                          if self._demo_mode:
                            cv2.imshow("Extracted Window", extracted_window)
          Severity: Major
          Found in src/template_matching_scaling/template_matching.py and 1 other location - About 7 hrs to fix
          src/template_matching_scaling/template_matching.py on lines 287..299

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

          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 match_method.match_type == tse_match_methods.DISTANCE_ED:
                          score, extracted_window = TSEImageUtils.calc_ed_template_match_score_scaled_compiled(template_patch, scaled_search_window)
          
                          if self._demo_mode:
                            cv2.imshow("Extracted Patch - IMG 2", extracted_window)
          Severity: Major
          Found in src/template_matching_scaling/template_matching.py and 1 other location - About 7 hrs to fix
          src/template_matching_scaling/template_matching.py on lines 391..403

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

          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 prev_current_window_scaled_coords is None:
          
                          # Locate the centre pixel coordinate that will define the origin of the geometric scaling procedure.
                          current_window_scaled_coords = TSEPoint((image_centre_x - patch_half_width), i), TSEPoint((image_centre_x + patch_half_width), i + template_patch_height)
          
          
          Severity: Major
          Found in src/template_matching_scaling/template_matching.py and 1 other location - About 7 hrs to fix
          final/technical_work/primary_experiments/python/template_matching_scaling/template_matching.py on lines 259..270

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

          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 use_hsv_colour_space:
          
                      if strip_luminance:
                          self._img1_target_color_space = TSEImageUtils.convert_hsv_and_remove_luminance(self._img1_raw)
                          self._img2_target_colour_space = TSEImageUtils.convert_hsv_and_remove_luminance(self._img2_raw)
          Severity: Major
          Found in src/template_matching_scaling/template_matching.py and 1 other location - About 6 hrs to fix
          final/technical_work/primary_experiments/python/template_matching_scaling/template_matching.py on lines 37..50

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

          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 plot(self, data_x, data_y, plot_format, plot_name, max_boundary_offset=0):
                  """
                  Sets up the graph for the current test, and plots the results via the 'Matplotlib' library.
          
                  :param data_x: The data to be plotted along the X-axis (i.e. the row number)
          Severity: Major
          Found in src/template_matching_scaling/template_matching.py and 1 other location - About 5 hrs to fix
          final/technical_work/primary_experiments/python/template_matching_scaling/template_matching.py on lines 445..463

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

          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

                      if match_method.reverse_score:
          
                          if best_score == -1 or score < best_score:
                              best_score = score
                              best_position += 1
          Severity: Major
          Found in src/template_matching_scaling/template_matching.py and 3 other locations - About 4 hrs to fix
          final/technical_work/primary_experiments/python/template_matching_scaling/template_matching.py on lines 289..305
          final/technical_work/primary_experiments/python/template_matching_scaling/template_matching.py on lines 390..406
          src/template_matching_scaling/template_matching.py on lines 406..422

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

          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

                      if match_method.reverse_score:
          
                          if best_score == -1 or score < best_score:
                              best_score = score
                              best_position += 1
          Severity: Major
          Found in src/template_matching_scaling/template_matching.py and 3 other locations - About 4 hrs to fix
          final/technical_work/primary_experiments/python/template_matching_scaling/template_matching.py on lines 289..305
          final/technical_work/primary_experiments/python/template_matching_scaling/template_matching.py on lines 390..406
          src/template_matching_scaling/template_matching.py on lines 302..318

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

          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 load_calibration_data(self, file_path):
          
                  raw_data = TSEFileIO.read_file(file_path, split_delimiter=",", start_position=1)
                  return dict(TSEDataUtils.string_2d_list_to_int_2d_list(raw_data))
          Severity: Major
          Found in src/template_matching_scaling/template_matching.py and 1 other location - About 1 hr to fix
          final/technical_work/primary_experiments/python/template_matching_scaling/template_matching.py on lines 57..60

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 38.

          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

                      if i >= (template_patch_origin.y + 1):
                          last_width = self._calibration_lookup_table[i - 1]
          Severity: Major
          Found in src/template_matching_scaling/template_matching.py and 3 other locations - About 55 mins to fix
          final/technical_work/primary_experiments/python/template_matching_scaling/template_matching.py on lines 247..248
          final/technical_work/primary_experiments/python/template_matching_scaling/template_matching.py on lines 351..352
          src/template_matching_scaling/template_matching.py on lines 249..250

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

          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

                      if i >= (template_patch_origin.y + 1):
                          last_width = self._calibration_lookup_table[i - 1]
          Severity: Major
          Found in src/template_matching_scaling/template_matching.py and 3 other locations - About 55 mins to fix
          final/technical_work/primary_experiments/python/template_matching_scaling/template_matching.py on lines 247..248
          final/technical_work/primary_experiments/python/template_matching_scaling/template_matching.py on lines 351..352
          src/template_matching_scaling/template_matching.py on lines 364..365

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

          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