KarrLab/wc_utils

View on GitHub

Showing 93 of 115 total issues

Avoid deeply nested control flow statements.
Open

                    if i2 in used2:
                        continue
                    try:
Severity: Major
Found in wc_utils/util/types.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                        for line in lines:
                            output.append(indent + line)
                    else:
    Severity: Major
    Found in wc_utils/util/string.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                          if not keep_trailing_blank_lines:
                              delete_trailing_blanks(lines)
                          for line in lines:
      Severity: Major
      Found in wc_utils/util/string.py - About 45 mins to fix

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

            def write_cell(self, xls_worksheet, sheet_name, i_row, i_col, value, format):
        Severity: Minor
        Found in wc_utils/workbook/io.py - About 45 mins to fix

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

          def rfind_nth(s, sub, n, start=0, end=float('inf')):
          Severity: Minor
          Found in wc_utils/util/string.py - About 35 mins to fix

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

                def write_worksheet(self, sheet_name, data, style=None, validation=None, protected=False):
            Severity: Minor
            Found in wc_utils/workbook/io.py - About 35 mins to fix

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

              def find_nth(s, sub, n, start=0, end=float('inf')):
              Severity: Minor
              Found in wc_utils/util/string.py - About 35 mins to fix

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

                    def apply_validation(self, ws, first_row, first_col, last_row, last_col):
                Severity: Minor
                Found in wc_utils/workbook/io.py - About 35 mins to fix

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

                  def convert(source, destination, worksheet_order=None, style=None, ignore_extra_sheets=True):
                  Severity: Minor
                  Found in wc_utils/workbook/io.py - About 35 mins to fix

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

                        def write_worksheet(self, sheet_name, data, style=None, validation=None, protected=False):
                    Severity: Minor
                    Found in wc_utils/workbook/io.py - About 35 mins to fix

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

                          def __init__(self, value, alpha=None, center_of_mass=None):
                              """ Initialize an ExponentialMovingAverage.
                      
                              Args:
                                  value (:obj:`float`): initial average value
                      Severity: Minor
                      Found in wc_utils/util/stats.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 any_checker has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def any_checker(value):
                          ''' Convert value to its built-in data type if possible
                      
                          Convert a string value to its built-in data type (integer, float, boolean, str
                          or list of these) if possible
                      Severity: Minor
                      Found in wc_utils/config/core.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 remove_empty_final_cols has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def remove_empty_final_cols(self):
                              """ Remove empty final columns """
                              max_col = 0
                              for row in self:
                                  for i_rev_col, cell in enumerate(reversed(row)):
                      Severity: Minor
                      Found in wc_utils/workbook/core.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 get_repo has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def get_repo(path='.', search_parent_directories=True):
                          """ Get a Git repository given the path to a file it contains
                      
                          Args:
                              path (:obj:`str`): path to file or directory in a Git repository; if `path` doesn't exist
                      Severity: Minor
                      Found in wc_utils/util/git.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 get_major_micro_species has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def get_major_micro_species(structure_or_structures, in_format, out_format,
                                                  ph=7.4, major_tautomer=False, keep_hydrogens=False, dearomatize=False):
                          """ Get the major protonation state of one or more compounds at a specific pH.
                      
                          Args:
                      Severity: Minor
                      Found in wc_utils/util/chem/marvin.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 __init__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def __init__(self, sources, config, result):
                              """
                              Args:
                                  sources (:obj:`list` of :obj:`str`): list of sources of configuration values
                                  config (:obj:`configobj.ConfigObj`): configuration
                      Severity: Minor
                      Found in wc_utils/config/core.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

                      Avoid too many return statements within this function.
                      Open

                                          return units1_expr.compare(units2_expr, operator.eq) or \
                      Severity: Major
                      Found in wc_utils/util/units.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                        return True
                        Severity: Major
                        Found in wc_utils/util/units.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                              return False
                          Severity: Major
                          Found in wc_utils/util/units.py - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                return is_string(value)
                            Severity: Major
                            Found in wc_utils/config/core.py - About 30 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language