The same_function_helper.py file contains multiple functions that are reused all over the API.
CodeClimate has found the following issue:
Similar blocks of code found in 3 locations. Consider refactoring.
The following blocks of code may be replaced with a function that can be called multiple times.
def getQhawaxOnLoop(qhawax_name):
if(qhawaxExistBasedOnName(qhawax_name)):
return session.query(Qhawax.on_loop).filter_by(name=qhawax_name).one()[0]
return None
def getQhawaxStatus(qhawax_name):
if(qhawaxExistBasedOnName(qhawax_name)):
return session.query(Qhawax.state).filter_by(name=qhawax_name).one()[0]
return None
def queryQhawaxType(name):
if(qhawaxExistBasedOnName(name)):
return session.query(Qhawax.qhawax_type).filter_by(name=name).one()[0]
return None
The same_function_helper.py file contains multiple functions that are reused all over the API.
CodeClimate has found the following issue:
Similar blocks of code found in 3 locations. Consider refactoring.
The following blocks of code may be replaced with a function that can be called multiple times.