sjoerdk/anonapi

View on GitHub
anonapi/client.py

Summary

Maintainability
C
1 day
Test Coverage

File client.py has 537 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""Anonymization web API client. Can interface with Anonymization server to retrieve,
create, modify anonymization jobs
"""
from typing import Dict

Severity: Major
Found in anonapi/client.py - About 1 day to fix

    Function create_path_job has 9 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def create_path_job(
    Severity: Major
    Found in anonapi/client.py - About 1 hr to fix

      Function create_pacs_job has 9 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def create_pacs_job(
      Severity: Major
      Found in anonapi/client.py - About 1 hr to fix

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

            def parse_response(self, response: Response) -> Dict:
                """Extract a anonAPI dictionary from raw HTTP response
        
                Parameters
                ----------
        Severity: Minor
        Found in anonapi/client.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

        There are no issues that match your filters.

        Category
        Status