matiasmenares/Nissboard

View on GitHub
dashboard/core/output.py

Summary

Maintainability
B
4 hrs
Test Coverage

Showing 6 of 6 total issues

Function emit_response has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

def emit_response(self):
response = []
nissan_consult = False
for output in self.output_obs:
if output.channel_input.analog_input_id != None:
Severity: Minor
Found in dashboard/core/output.py - About 1 hr to fix

Function set_consult_value has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def set_consult_value(self, consult_response, responses):
data_response = []
for response in consult_response:
for out_channel in self.output_obs:
if out_channel.channel_input.nissan_input_id != None:
Severity: Minor
Found in dashboard/core/output.py - About 1 hr to fix

Function set_nissan_consult has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

def set_nissan_consult(self, response):
if self.consult.running:
consult_response = self.consult.consume_data()
if consult_response != None:
parsed_response = self.set_consult_value(consult_response, response)
Severity: Minor
Found in dashboard/core/output.py - About 45 mins to fix

Function linear_function has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

def linear_function(self, x, in_min, in_max, out_min, out_max):
Severity: Minor
Found in dashboard/core/output.py - About 35 mins to fix

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

    def __init__(self, socketoi, serial, analog_path, consult_path, enviroment):
    Severity: Minor
    Found in dashboard/core/output.py - About 35 mins to fix

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

      def flatten_list(self,_2d_list):
      flat_list = []
      for element in _2d_list:
      if type(element) is list:
      for item in element:
      Severity: Minor
      Found in dashboard/core/output.py - About 35 mins to fix

      There are no issues that match your filters.

      Category
      Status