matteoferla/Python_SmallWorld_API

View on GitHub

Showing 5 of 5 total issues

Function search_many has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    def search_many(self,
                    query: Union[Sequence[Any], Mapping[str, Any]],
                    db: str,
                    **other_parameters) -> pd.DataFrame:
        """
Severity: Minor
Found in smallworld_api/__init__.py - About 3 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 skip has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

def skip(app, what, name, obj, would_skip, options):
Severity: Minor
Found in docs/source/conf.py - About 45 mins to fix

    Function submit_query has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def submit_query(self, params) -> Dict[str, Any]:
            """
            The first step.
            """
            try:
    Severity: Minor
    Found in smallworld_api/search.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 search has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def search(self, query: Any, db: str, **other_parameters) -> pd.DataFrame:
            """
            The query can be 
            
            * a single SMILES,
    Severity: Minor
    Found in smallworld_api/__init__.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 search_smiles has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def search_smiles(self,
                          smiles: str,
                          db: str,
                          **other_parameters) -> pd.DataFrame:
            """
    Severity: Minor
    Found in smallworld_api/__init__.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