vanheeringen-lab/gimmemotifs

View on GitHub

Showing 79 of 82 total issues

Avoid too many return statements within this function.
Open

                    return self.pvalue(
Severity: Major
Found in gimmemotifs/comparison.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                        return "unknown"
    Severity: Major
    Found in gimmemotifs/utils.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                          return "narrowpeak"
      Severity: Major
      Found in gimmemotifs/utils.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                            return self.max_total(
        Severity: Major
        Found in gimmemotifs/comparison.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

              return "unknown"
          Severity: Major
          Found in gimmemotifs/utils.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                        return 30
            Severity: Major
            Found in gimmemotifs/comparison.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                                  return self.max_subtotal(
              Severity: Major
              Found in gimmemotifs/comparison.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                            return metric(m1, m2)
                Severity: Major
                Found in gimmemotifs/comparison.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                              return 22
                  Severity: Major
                  Found in gimmemotifs/comparison.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return length
                    Severity: Major
                    Found in gimmemotifs/comparison.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return "region"
                      Severity: Major
                      Found in gimmemotifs/utils.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                    return "bed"
                        Severity: Major
                        Found in gimmemotifs/utils.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                              return self.max_total(m1.pfm, m2.pfm, metric, combine)
                          Severity: Major
                          Found in gimmemotifs/comparison.py - About 30 mins to fix

                            Function check_bed_file has a Cognitive Complexity of 16 (exceeds 15 allowed). Consider refactoring.
                            Open

                            def check_bed_file(fname):
                                """Check if the inputfile is a valid bed-file"""
                                if not os.path.exists(fname):
                                    logger.error(f"Inputfile {fname} does not exist!")
                                    sys.exit(1)
                            Severity: Minor
                            Found in gimmemotifs/motif/validation.py - About 25 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 pp_predict_motifs has a Cognitive Complexity of 16 (exceeds 15 allowed). Consider refactoring.
                            Open

                            def pp_predict_motifs(
                                fastafile,
                                outfile,
                                analysis="small",
                                organism="hg19",
                            Severity: Minor
                            Found in gimmemotifs/motif/prediction.py - About 25 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_cutoff has a Cognitive Complexity of 16 (exceeds 15 allowed). Consider refactoring.
                            Open

                            def parse_cutoff(motifs, cutoff, default=0.9):
                                """Provide either a file with one cutoff per motif or a single cutoff
                                returns a hash with motif id as key and cutoff as value
                                """
                                cutoffs = {}
                            Severity: Minor
                            Found in gimmemotifs/scanner/utils.py - About 25 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 factor2orthogroups has a Cognitive Complexity of 16 (exceeds 15 allowed). Consider refactoring.
                            Open

                            def factor2orthogroups(factor, references, database, strategy):
                                """
                                Returns all the orthogroups a factor belongs to. This is NOT a trivial task.
                            
                                Some of the factors shouldn't be considered (blacklisted), some have an
                            Severity: Minor
                            Found in gimmemotifs/orthologs.py - About 25 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 pfmfile_location has a Cognitive Complexity of 16 (exceeds 15 allowed). Consider refactoring.
                            Open

                            def pfmfile_location(infile=None):
                                """Return the path to the pfmfile"""
                                config = MotifConfig()
                            
                                if infile is None:
                            Severity: Minor
                            Found in gimmemotifs/utils.py - About 25 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 has a Cognitive Complexity of 16 (exceeds 15 allowed). Consider refactoring.
                            Open

                                def parse(self, fname):
                                    """
                                    Convert RPMCMC output to motifs
                            
                                    Parameters
                            Severity: Minor
                            Found in gimmemotifs/tools/rpmcmc.py - About 25 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