amenezes/discovery-client

View on GitHub

Showing 8 of 8 total issues

Function catalog has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

def catalog(services, datacenters, nodes, verbose):
    """Catalog API."""
    table = Table.grid(padding=(0, 1))
    table.add_column(style="cyan", justify="right")
    table.add_column(style="magenta")
Severity: Minor
Found in discovery/cli/__init__.py - About 1 hr 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 http has 10 arguments (exceeds 4 allowed). Consider refactoring.
Open

def http(
Severity: Major
Found in discovery/checks.py - About 1 hr to fix

    Function __init__ has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def __init__(
            self,
            client: Optional[Union[AIOHTTPEngine, HTTPXEngine]] = None,
            *args,
            **kwargs,
    Severity: Minor
    Found in discovery/client.py - About 1 hr to fix

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

          def __init__(
      Severity: Major
      Found in discovery/api/operator.py - About 1 hr to fix

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

            def __init__(
        Severity: Major
        Found in discovery/api/acl.py - About 50 mins to fix

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

          def health(argument, node, service, state, verbose):
          Severity: Minor
          Found in discovery/cli/__init__.py - About 35 mins to fix

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

            def docker(
            Severity: Minor
            Found in discovery/checks.py - About 35 mins to fix

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

                  def __init__(
              Severity: Minor
              Found in discovery/api/agent.py - About 35 mins to fix
                Severity
                Category
                Status
                Source
                Language