dmyersturnbull/mandos

View on GitHub

Showing 151 of 151 total issues

File entry_commands.py has 1006 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""
Run searches and write files.
"""

from __future__ import annotations
Severity: Major
Found in mandos/entry/entry_commands.py - About 2 days to fix

    File pubchem_data.py has 920 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    """
    PubChem data views and processors.
    """
    from __future__ import annotations
    
    
    Severity: Major
    Found in mandos/model/apis/pubchem_support/pubchem_data.py - About 2 days to fix

      File misc_commands.py has 591 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      """
      Command-line interface for mandos.
      """
      
      from __future__ import annotations
      Severity: Major
      Found in mandos/entry/misc_commands.py - About 1 day to fix

        File pubchem_models.py has 487 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        from __future__ import annotations
        
        import enum
        from dataclasses import dataclass
        from datetime import date
        Severity: Minor
        Found in mandos/model/apis/pubchem_support/pubchem_models.py - About 7 hrs to fix

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

          from __future__ import annotations
          
          import enum
          from collections import defaultdict
          from dataclasses import dataclass
          Severity: Minor
          Found in mandos/model/taxonomy.py - About 7 hrs to fix

            File plot_commands.py has 443 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            """
            Command-line interface for mandos.
            """
            
            from __future__ import annotations
            Severity: Minor
            Found in mandos/entry/plot_commands.py - About 6 hrs to fix

              File calc_commands.py has 407 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              """
              Command-line interface for mandos.
              """
              
              from __future__ import annotations
              Severity: Minor
              Found in mandos/entry/calc_commands.py - About 5 hrs to fix

                Taxonomy has 31 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class Taxonomy:
                    """
                    A taxonomic tree of organisms from UniProt.
                    Elements in the tree can be looked up by name or ID using ``__getitem__`` and ``get``.
                    """
                Severity: Minor
                Found in mandos/model/taxonomy.py - About 3 hrs to fix

                  File querying_pubchem_api.py has 326 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  """
                  PubChem querying API.
                  """
                  from __future__ import annotations
                  
                  
                  Severity: Minor
                  Found in mandos/model/apis/querying_pubchem_api.py - About 3 hrs to fix

                    File plots.py has 305 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    """
                    Plots.
                    """
                    import enum
                    from dataclasses import dataclass
                    Severity: Minor
                    Found in mandos/analysis/plots.py - About 3 hrs to fix

                      File chembl_target_graphs.py has 298 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      from __future__ import annotations
                      
                      import abc
                      import enum
                      from dataclasses import dataclass
                      Severity: Minor
                      Found in mandos/model/apis/chembl_support/chembl_target_graphs.py - About 3 hrs to fix

                        Function adjust_filename has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def adjust_filename(
                                cls,
                                to: Optional[Path],
                                default: Union[str, Path],
                                replace: bool,
                        Severity: Minor
                        Found in mandos/entry/utils/_arg_utils.py - About 2 hrs 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 depositor_pubmed_articles has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def depositor_pubmed_articles(self) -> FrozenSet[PubmedEntry]:
                                def split_mesh_headings(s: str) -> FrozenSet[Codes.MeshHeading]:
                                    # this is a nightmare
                                    # these fields are comma-delimited strings, but there are commas within each
                                    # all of the examples I've seen with this are for chem name cis/trans
                        Severity: Minor
                        Found in mandos/model/apis/pubchem_support/pubchem_data.py - About 2 hrs 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 5 allowed). Consider refactoring.
                        Open

                            def parse(
                                cls, lines: Sequence[str]
                            ) -> Tup[Set[TargetEdgeReqs], Mapping[TargetEdgeReqs, Acceptance]]:
                                pat_type = r"(@?[a-z_]+)"
                                pat_rel = r"([<>~=.*])"
                        Severity: Minor
                        Found in mandos/model/apis/chembl_support/target_traversal.py - About 2 hrs 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 cached_from_url has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def cached_from_url(
                                cls,
                                path: Optional[Path],
                                url: Optional[str],
                                *,
                        Severity: Minor
                        Found in mandos/model/utils/sources.py - About 2 hrs 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 a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def _process(self, lookup: str, binding: BindingHit, target: NestedDotDict) -> Sequence[GoHit]:
                                terms = set()
                                if target.get("target_components") is not None:
                                    for comp in target["target_components"]:
                                        if comp.get("target_component_xrefs") is not None:
                        Severity: Minor
                        Found in mandos/search/chembl/go_search.py - About 2 hrs 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 has 15 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def run(
                        Severity: Major
                        Found in mandos/entry/entry_commands.py - About 1 hr to fix

                          Function plot_tau has 15 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def plot_tau(
                          Severity: Major
                          Found in mandos/entry/plot_commands.py - About 1 hr to fix

                            Function plot_enrichment has 15 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                def plot_enrichment(
                            Severity: Major
                            Found in mandos/entry/plot_commands.py - About 1 hr to fix

                              Function run has 15 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  def run(
                              Severity: Major
                              Found in mandos/entry/entry_commands.py - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language