LucaCappelletti94/pyadigraph

View on GitHub

Showing 9 of 9 total issues

File pyadigraph.py has 340 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import networkx as nx
from typing import Dict, Tuple, List, Union
import os


Severity: Minor
Found in pyadigraph/pyadigraph.py - About 4 hrs to fix

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

        def __init__(self,
    Severity: Major
    Found in pyadigraph/pyadigraph.py - About 2 hrs to fix

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

          def add_graph(
      Severity: Major
      Found in pyadigraph/pyadigraph.py - About 1 hr to fix

        Function _adigraph has 13 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def _adigraph(
        Severity: Major
        Found in pyadigraph/pyadigraph.py - About 1 hr to fix

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

              def _edges(self, edges: List[Tuple[str, str]], weights: Dict[str, float], colors: Dict[str, str], default_color: str, widths: Dict[str, float], labels: Dict[str, str], directed: bool)->str:
          Severity: Major
          Found in pyadigraph/pyadigraph.py - About 50 mins to fix

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

                def _vertices(self, vertices: List[str], layout: Dict[str, Tuple[float, float]], colors: Dict[str, str], default_color: str, widths: Dict[str, float], labels: Dict[str, str])->str:
            Severity: Minor
            Found in pyadigraph/pyadigraph.py - About 45 mins to fix

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

                  def _vertex(self, vertex: str, x: float, y: float, color: str, width: float, label: str)->str:
              Severity: Minor
              Found in pyadigraph/pyadigraph.py - About 45 mins to fix

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

                    def _edge(self, start: str, end: str, weight: float, color: str, width: float, label: str)->str:
                Severity: Minor
                Found in pyadigraph/pyadigraph.py - About 45 mins to fix

                  Function __init__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def __init__(self,
                                   row_size: int=2,
                                   vertices_color_fallback: str="",
                                   edges_color_fallback: str="",
                                   layout: Dict[str, Tuple[float, float]]=None,
                  Severity: Minor
                  Found in pyadigraph/pyadigraph.py - About 35 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