cgddrd/CS39440-major-project

View on GitHub

Showing 53 of 182 total issues

Function main has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def main():

    parser = argparse.ArgumentParser()

    parser.add_argument('--image-height', dest="image_height", type=int, default=480)

    Function main has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def main():
    
        parser = argparse.ArgumentParser()
    
        parser.add_argument('--image-height', dest="image_height", type=int, default=480)
    Severity: Minor
    Found in src/eval_image_gen/eval_image_gen/main.py - About 1 hr to fix

      Function run_sim has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

      def run_sim(images, feature_params, lk_params, subpix_params):
      
          count = 0
      
          # Create some random colors

      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 start_tests has 10 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def start_tests(image_pairs, patch_sizes, match_methods, config_file, use_scaling=False, scale_centre=True, exhaustive_search=False, use_hsv=True, strip_luminance=True, plot_results=False):

        Function run_sim has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        def run_sim(folder_path, images, feature_params, lk_params, subpix_params):
        
            count = 0
        
            # Create some random colors
        Severity: Minor
        Found in src/feature_tracking_motion_displacement/main.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

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

            def read_file(file_path, split_delimiter=None, start_position=0):
                """
                Loads in a collection of tuple data from a configuration file.
        
                :param file_path: The path of the file to be read.
        Severity: Minor
        Found in src/tse/tse/tse_fileio.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

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

            def read_file(file_path, split_delimiter=None, start_position=0):
                """
                Loads in a collection of tuple data from a configuration file.
        
                :param file_path: The path of the file to be read.

        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 draw_arrow has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def draw_arrow(image, p, q, color, arrow_magnitude=9, thickness=1, line_type=8, shift=0):

          Function draw_arrow has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def draw_arrow(image, p, q, color, arrow_magnitude=9, thickness=1, line_type=8, shift=0):
          Severity: Major
          Found in src/feature_tracking_motion_displacement/main.py - About 1 hr to fix

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

                def grade_smoothness(self):
            
                    current_point = self.get_value(0)[0]
                    prev_point = self.get_value(-1)[0]
                    second_point = self.get_value(-2)[0]
            Severity: Minor
            Found in src/feature_tracking_motion_displacement/tracked_feature.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 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 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.
            
            

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

                def grade_smoothness(self):
            
                    current_point = self.get_value(0)[0]
                    prev_point = self.get_value(-1)[0]
                    second_point = self.get_value(-2)[0]

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

              def main():
              
                  parser = argparse.ArgumentParser()
              
                  # Specify the properties for all of the accepted command-line parameters.
              Severity: Minor
              Found in src/template_matching_scaling/main.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 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 __init__ has 6 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):

                  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_patches_flow has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  def calc_lk_patches_flow(image1, image2, feature_params, patch_size, max_val_threshold, use_subpix=False):
                  Severity: Minor
                  Found in src/feature_tracking_motion_displacement/main.py - About 45 mins to fix

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

                    def main():
                    
                        parser = argparse.ArgumentParser()
                    
                        # Specify the properties for all of the accepted command-line parameters.

                    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