pombo-lab/gamtools

View on GitHub

Showing 23 of 473 total issues

File pipeline.py has 476 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""
===================
The pipeline module
===================

Severity: Minor
Found in lib/gamtools/pipeline.py - About 7 hrs to fix

    File matrix.py has 451 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    """
    =================
    The matrix module
    =================
    
    
    Severity: Minor
    Found in lib/gamtools/matrix.py - About 6 hrs to fix

      File cosegregation.py has 444 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      """
      ========================
      The cosegregation module
      ========================
      
      
      Severity: Minor
      Found in lib/gamtools/cosegregation.py - About 6 hrs to fix

        File enrichment.py has 359 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        """
        =====================
        The enrichment module
        =====================
        
        
        Severity: Minor
        Found in lib/gamtools/enrichment.py - About 4 hrs to fix

          File main.py has 352 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          """
          ===============
          The main module
          ===============
          
          
          Severity: Minor
          Found in lib/gamtools/main.py - About 4 hrs to fix

            File call_windows.py has 299 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            """
            =======================
            The call_windows module
            =======================
            
            
            Severity: Minor
            Found in lib/gamtools/call_windows.py - About 3 hrs to fix

              InputFileMappingTasks has 26 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class InputFileMappingTasks():
                  """Class for generating doit tasks from command-line arguments.
              
                  GAMtools "process_nps" command generates a set of doit tasks at
                  runtime based on a set of parameters passed via the command-line.
              Severity: Minor
              Found in lib/gamtools/pipeline.py - About 3 hrs to fix

                Function parse_fastq_screen_output has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                def parse_fastq_screen_output(fastq_screen_output):
                    """
                    Parse the output of a single fastq_screen file.
                
                    :param file fastq_screen_output: Open file object containing \
                Severity: Minor
                Found in lib/gamtools/qc/screen.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 do_segregation_qc has 9 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def do_segregation_qc(segregation_table, slice_thickness, nuclear_radius, coverage_q=0.2, #pylint: disable=too-many-arguments
                Severity: Major
                Found in lib/gamtools/resolution.py - About 1 hr to fix

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

                  def process_file(filename):
                      """
                      Process a fastqc output file and calculate some summary statistics.
                      """
                  
                  
                  Severity: Minor
                  Found in lib/gamtools/qc/fastqc.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 convert_from_args has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def convert_from_args(args):
                      """Wrapper function to call convert from argparse"""
                  
                      if args.input_format is None:
                          args.input_format = detect_file_type(args.input_file)
                  Severity: Minor
                  Found in lib/gamtools/matrix.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 get_detection_efficiency has 8 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  def get_detection_efficiency(segregation_table, slice_thickness, #pylint: disable=too-many-arguments
                  Severity: Major
                  Found in lib/gamtools/resolution.py - About 1 hr to fix

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

                    def threshold_file(input_file, output_file, #pylint: disable=too-many-arguments
                    Severity: Major
                    Found in lib/gamtools/call_windows.py - About 50 mins to fix

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

                      def convert(input_file, input_format, #pylint: disable=too-many-arguments
                      Severity: Major
                      Found in lib/gamtools/matrix.py - About 50 mins to fix

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

                        def do_segregation_qc(segregation_table, slice_thickness, nuclear_radius, coverage_q=0.2, #pylint: disable=too-many-arguments
                                              skip_chroms=None, genome_size=None, plexity=1, only_visible=True):
                            """
                            Check that a GAM dataset has sufficient quality and depth.  Specifically,
                            check that 80% of genomic windows have been detected at least 20 times
                        Severity: Minor
                        Found in lib/gamtools/resolution.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 parse_module has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def parse_module(fastqc_module):
                            """
                            Parse a fastqc module from the table format to a line format (list).
                            Input is list containing the module. One list-item per line. E.g.:
                        
                        
                        Severity: Minor
                        Found in lib/gamtools/qc/fastqc.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 create_doit_tasks has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def create_doit_tasks(self):
                                """Generator function that yields doit tasks."""
                        
                                tasks = []
                                task_generators = []
                        Severity: Minor
                        Found in lib/gamtools/pipeline.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 matrix_from_args has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def matrix_from_args(args):
                            """Extract parameters from an argparse namespace object and pass them to
                            create_and_save_contact_matrix.
                            """
                        
                        
                        Severity: Minor
                        Found in lib/gamtools/cosegregation.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 do_enrichment has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        def do_enrichment(
                        Severity: Minor
                        Found in lib/gamtools/enrichment.py - About 35 mins to fix

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

                          def create_and_save_contact_matrix(segregation_file, location_strings,
                          Severity: Minor
                          Found in lib/gamtools/cosegregation.py - About 35 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language