Showing 10 of 10 total issues
File model.py
has 260 lines of code (exceeds 250 allowed). Consider refactoring. Open
from abc import ABC, abstractmethod
from typing import Dict
import matplotlib.pyplot as plt
import numpy as np
Function _node_trace
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def _node_trace(
graph: nx.Graph,
positions: Dict[str, np.ndarray],
size: int,
font_size: int,
- Read upRead up
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 __init__
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__( # pylint: disable=too-many-arguments
Function __init__
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, n, tau) -> None: # pylint: disable=invalid-name
"""Initialize the class"""
# Check the argument n
if isinstance(n, int):
- Read upRead up
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 _edge_trace
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _edge_trace(
Function qrobot_template
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def qrobot_template(X, y, a=1, flag=True, f=None, **kwargs):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__( # pylint: disable=too-many-arguments
Function _target_vector_check
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _target_vector_check(self, target_vector) -> list:
"""This method ensures that a `target_vector` for the model
is an `n`-dimensional vector (where `n` is the model's dimension).
Raises
- Read upRead up
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 graph
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def graph(status_dict: dict) -> nx.DiGraph:
"""Given the Redis status dictionary, generate a `networkx` directed graph
containing all the units connected as nodes.
Args:
- Read upRead up
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 _write_edge
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _write_edge(graph: nx.Graph, node_id: str, key: str, value: Any):
"""Link units in the network by adding the respective edges."""
if " in_qunits" in key:
in_qunits = json.loads(value)
for _, in_qunit in in_qunits.items():
- Read upRead up
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"