File type_transforms.py
has 573 lines of code (exceeds 250 allowed). Consider refactoring. Open
import copy
import inspect
import logging
import time
from collections import deque
Function init_vhdl_type
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def init_vhdl_type(name, current_val, initial_val=None, parent=None):
from pyha.conversion.conversion import RecursiveConverter
if type(current_val) == int or type(current_val) == np.int64:
return VHDLInt(name, current_val, initial_val, parent)
elif type(current_val) == bool or type(current_val) == np.bool_:
- 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 __log_none_bounds
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def __log_none_bounds(self):
def get_full_var_name():
ret = []
node = self
- 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 __log_none_bounds
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def __log_none_bounds(self):
def get_full_var_name():
ret = []
node = self
- 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 _pyha_reset
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _pyha_reset(self, prefix='self', filter_func=None):
if filter_func:
if not filter_func(self):
return ''
ret = ''
- 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 _pyha_reset
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _pyha_reset(self, prefix='self', filter_func=None) -> str:
if filter_func:
if not filter_func(self):
return ''
- 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
Avoid too many return
statements within this function. Open
return init_vhdl_type(name, PyhaList(current_val.tolist()), PyhaList(initial_val.tolist()), parent)
Avoid too many return
statements within this function. Open
return VHDLList(name, list(current_val), list(initial_val), parent)
Avoid too many return
statements within this function. Open
return VHDLSfix(name, current_val, initial_val, parent)
Avoid too many return
statements within this function. Open
return current_val._pyha_converter(name, current_val, initial_val, parent)
Avoid too many return
statements within this function. Open
return None
Avoid too many return
statements within this function. Open
return VHDLEnum(name, current_val, initial_val, parent)
Avoid too many return
statements within this function. Open
return VHDLList(name, current_val, initial_val, parent)
Avoid too many return
statements within this function. Open
return None
Avoid too many return
statements within this function. Open
return None
Avoid too many return
statements within this function. Open
return VHDLComplex(name, current_val, initial_val, parent)
Avoid too many return
statements within this function. Open
return init_vhdl_type(name, PyhaList(current_val), PyhaList(initial_val), parent)
Avoid too many return
statements within this function. Open
return None # see #216
Avoid too many return
statements within this function. Open
return VHDLList(name, list(current_val), list(current_val), parent)
Avoid too many return
statements within this function. Open
return VHDLModule(name, current_val, initial_val, parent)