dmyersturnbull/mandos

View on GitHub

Showing 151 of 151 total issues

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

    def _guess_pk(self, desc: str) -> Optional[str]:
        match = _re("^The (.+)").search(desc)
        if match is not None and match.group(1) is not None:
            split = _re("can be").split(match.group(1))
            if len(split) == 2:
Severity: Minor
Found in mandos/search/pubchem/drugbank_ddi_search.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 _read_hits has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def _read_hits(self, path: Path) -> Sequence[AbstractHit]:
        hits = HitDf.read_file(path)
        keys = hits["search_key"].unique()
        bad_excludes = [e for e in self.exclude if e not in keys]
        if len(bad_excludes) > 0:
Severity: Minor
Found in mandos/analysis/distances.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 fill has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def fill(
Severity: Minor
Found in mandos/entry/misc_commands.py - About 45 mins to fix

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

        def _get_pubchem(self, inchikey: Optional[str], cid: Optional[int]) -> Optional[CompoundStruct]:
            logger.info(f"Fetching PubChem {inchikey} / {cid}")
            api = Apis.Pubchem
            if cid is not None:
                # let it raise a CompoundNotFoundError
    Severity: Minor
    Found in mandos/entry/tools/fillers.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 _process has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def _process(
    Severity: Minor
    Found in mandos/entry/tools/fillers.py - About 45 mins to fix

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

          def _fail(self, e: BaseException, what: str, *, abort: bool) -> None:
              _err("")
              _err(f"--- {what} ---".upper())
              dump_path = None
              if not abort:
      Severity: Minor
      Found in mandos/cli.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 get_smart_taxonomy has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def get_smart_taxonomy(
      Severity: Minor
      Found in mandos/model/taxonomy_caches.py - About 45 mins to fix

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

            def __init__(
        Severity: Minor
        Found in mandos/search/chembl/_protein_search.py - About 45 mins to fix

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

              def build(
          Severity: Minor
          Found in mandos/entry/tools/multi_searches.py - About 35 mins to fix

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

                def export_copy(
            Severity: Minor
            Found in mandos/entry/misc_commands.py - About 35 mins to fix

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

                  def __init__(
              Severity: Minor
              Found in mandos/model/apis/querying_pubchem_api.py - About 35 mins to fix

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

                    def filter(
                Severity: Minor
                Found in mandos/entry/misc_commands.py - About 35 mins to fix

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

                      def __init__(
                  Severity: Minor
                  Found in mandos/model/searches.py - About 35 mins to fix

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

                        def create(
                    Severity: Minor
                    Found in mandos/analysis/concordance.py - About 35 mins to fix

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

                          def _predicate(
                      Severity: Minor
                      Found in mandos/search/pubchem/ctd_gene_search.py - About 35 mins to fix

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

                            def plot_heatmap(
                        Severity: Minor
                        Found in mandos/entry/plot_commands.py - About 35 mins to fix

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

                              def _make_df(
                          Severity: Minor
                          Found in mandos/analysis/enrichment.py - About 35 mins to fix

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

                                def __init__(
                            Severity: Minor
                            Found in mandos/analysis/distances.py - About 35 mins to fix

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

                                  def __init__(self, path: Path, compounds: Sequence[str], *, restart: bool, proceed: bool):
                              Severity: Minor
                              Found in mandos/model/search_caches.py - About 35 mins to fix

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

                                    def cached_from_url(
                                Severity: Minor
                                Found in mandos/model/utils/sources.py - About 35 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language