cgddrd/CS39440-major-project

View on GitHub

Showing 53 of 182 total issues

Function on_mouse_click has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def on_mouse_click(self, event):

        toolbar = plt.get_current_fig_manager().toolbar

        if toolbar.mode == '' and (event.xdata is not None and event.ydata is not None):

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 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 on_mouse_click has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def on_mouse_click(self, event):
    
            toolbar = plt.get_current_fig_manager().toolbar
    
            if toolbar.mode == '' and (event.xdata is not None and event.ydata is not None):
    Severity: Minor
    Found in src/perspective_calibration/perspective_calib.py - About 45 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 calc_lk_tracking_flow has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def calc_lk_tracking_flow(image1, image2, feature_params, lk_params, use_subpix=False):
    Severity: Minor
    Found in src/feature_tracking_motion_displacement/main.py - About 35 mins to fix

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

      def run_sim(folder_path, images, feature_params, lk_params, subpix_params):
      Severity: Minor
      Found in src/feature_tracking_motion_displacement/main.py - About 35 mins to fix

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

        def run_sim(folder_path, images, patch_height, patch_width, start_y):
        Severity: Minor
        Found in src/edge_template_matching_motion_displacement/main.py - About 35 mins to fix

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

              def __init__(self, match_name, match_type, match_id, format_string, reverse_score=False):
          Severity: Minor
          Found in final/technical_work/primary_experiments/python/tse/tse/tse_matchtype.py - About 35 mins to fix

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

            def calc_lk_tracking_flow(image1, image2, feature_params, lk_params, use_subpix=False):

              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):

                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

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

                      def __init__(self, match_name, match_type, match_id, format_string, reverse_score=False):
                  Severity: Minor
                  Found in src/tse/tse/tse_matchtype.py - About 35 mins to fix

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

                        def calc_line_points(start_point, end_point, start_point2, end_point2, max_y):
                            """
                            Calculates the straight-line coordinates between two pairs of corresponding points.
                    
                            :param start_point: The first start point.
                    Severity: Minor
                    Found in src/tse/tse/tse_geometry.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 calc_line_points has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def calc_line_points(start_point, end_point, start_point2, end_point2, max_y):
                            """
                            Calculates the straight-line coordinates between two pairs of corresponding points.
                    
                            :param start_point: The first start point.
                    Severity: Minor
                    Found in final/technical_work/primary_experiments/python/tse/tse/tse_geometry.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

                    Severity
                    Category
                    Status
                    Source
                    Language