petspats/pyha

View on GitHub

Showing 164 of 164 total issues

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

def get_object(node):
    """ Parse rebaron AtomTrailers node into Python object (taken from ongoing conversion object)
     Works for object and local scope """

    if len(node) > 1 and (node[0].value == 'self' or node[0].value == 'self_next'):
Severity: Minor
Found in pyha/conversion/redbaron_transforms.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 resize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def resize(fix: Sfix, left=0, right=-17, size_res=None, overflow_style='wrap', round_style='truncate', wrap_is_ok=False,
           signed=None) -> Sfix:
    """
    Resize fixed point number.

Severity: Minor
Found in pyha/common/fixed_point.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 plot_time_domain has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def plot_time_domain(simulations, name='Time domain'):
    simulations["MODEL"] = np.array(simulations["MODEL"])
    simulations["HARDWARE"] = np.array(simulations["HARDWARE"])
    if is_float(simulations["MODEL"][0]):
        fig, ax = plt.subplots(2, sharex="all", figsize=figsize, gridspec_kw={'height_ratios': [4, 2]})
Severity: Minor
Found in pyha/simulation/plotter.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 to_vhdl has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def to_vhdl(self):
        try:
            os.makedirs(self.output_dir)
        except:
            pass
Severity: Minor
Found in pyha/conversion/conversion.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