Showing 66 of 66 total issues
Function insert_measurement
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def insert_measurement(self, component_type, component_arg, metric_name, timestamp, value):
Function broadcast_new_measurement
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def broadcast_new_measurement(cls, component_type: str, component_arg: str, metric: str, timestamp: int,
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, uri=None, http_method=None, headers=None, params=None, body=None):
Function read_measurement_from_queue
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def read_measurement_from_queue(component, metric, args=None, blocking=False,
Function __get_api_paths
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __get_api_paths(cls, base_api_path, sub_paths, version, is_current):
Function hardwareAdded
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def hardwareAdded(hardware):
print(hardware.Name)
print(hardware.GetReport())
for sensor in hardware.Sensors:
print(typeList[sensor.SensorType])
- 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_error
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def write_error(self, status_code, **kwargs) -> None:
"""
Overrides the built-in function to implement custom error responses.
If in debug mode and caused by an uncaught exception this will add the stacktrace to the error response.
- 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 __is_mandatory_parameter_valid
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def __is_mandatory_parameter_valid(self, mandatory_parameter):
parameter_name = mandatory_parameter[0]
verification_function = mandatory_parameter[1]
params = self._request_holder.get_params()
- 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 _put
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _put(self) -> bool:
request_body = self._request_holder.get_body()
component_metrics_dict = self.__get_all_component_metrics()
- 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 get_measurement
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_measurement(self, component, metric, args):
'''
Retrieves a measurement from the measuring source
given the component, metric and optionally arguments
'''
- 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 rate_update_valid
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def rate_update_valid(rate_update):
"""
Checks the given rate_update for the correct data structure
Returns True if it has the right structure
"""
- 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 get_cpu_measurement
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_cpu_measurement(self, metric, args):
"""
Updates the hardware class for the specified cpu (not cores, whole cpu socket)
and returns the value for the specified metric
"""
- 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 False
Avoid too many return
statements within this function. Open
return self.cpuinfo.get_cpu_info()["count"]
Avoid too many return
statements within this function. Open
return None
Avoid too many return
statements within this function. Open
return False
Avoid too many return
statements within this function. Open
return self.KEEP_PROCESSING()
Avoid too many return
statements within this function. Open
return None
Function __read_limit_header
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __read_limit_header(self, headers):
if "limit" in headers:
try:
limit = int(headers["limit"])
- 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 __parse_component_metrics_dict_to_list
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __parse_component_metrics_dict_to_list(cls, component_metric_dict: dict) -> list:
component_metric_list = []
for component_type in component_metric_dict:
for component_arg in component_metric_dict[component_type]:
- 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"