Showing 5,781 of 10,536 total issues
Function on_get
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def on_get(req, resp, id_, gid):
access_control(req)
if not id_.isdigit() or int(id_) <= 0:
raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
description='API.INVALID_MICROGRID_ID')
Function on_get
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def on_get(req, resp, id_, eid):
access_control(req)
if not id_.isdigit() or int(id_) <= 0:
raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
description='API.INVALID_MICROGRID_ID')
Function on_get
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def on_get(req, resp, id_):
access_control(req)
if not id_.isdigit() or int(id_) <= 0:
raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
description='API.INVALID_WIND_FARM_ID')
Function on_get
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def on_get(req, resp):
access_control(req)
cnx = mysql.connector.connect(**config.myems_system_db)
cursor = cnx.cursor()
Function on_put
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def on_put(req, resp, id_, sid):
"""Handles PUT requests"""
admin_control(req)
try:
raw_json = req.stream.read().decode('utf-8')
Function on_get
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def on_get(req, resp, id_, bid):
access_control(req)
if not id_.isdigit() or int(id_) <= 0:
raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
description='API.INVALID_MICROGRID_ID')
Function on_get
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def on_get(req, resp, id_):
access_control(req)
if not id_.isdigit() or int(id_) <= 0:
raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
description='API.INVALID_MICROGRID_ID')
Function on_get
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def on_get(req, resp, id_, pid):
access_control(req)
if not id_.isdigit() or int(id_) <= 0:
raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
description='API.INVALID_MICROGRID_ID')
Function on_get
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def on_get(req, resp, id_):
access_control(req)
if not id_.isdigit() or int(id_) <= 0:
raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
description='API.INVALID_WIND_FARM_ID')
Function on_put
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def on_put(req, resp, id_):
"""Handles PUT requests"""
admin_control(req)
try:
raw_json = req.stream.read().decode('utf-8')
Function on_get
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def on_get(req, resp):
access_control(req)
cnx = mysql.connector.connect(**config.myems_system_db)
cursor = cnx.cursor()
Function on_delete
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def on_delete(req, resp, id_):
admin_control(req)
if not id_.isdigit() or int(id_) <= 0:
raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
description='API.INVALID_ENERGY_CATEGORY_ID')
Function on_get
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def on_get(req, resp):
if 'API-KEY' not in req.headers or \
not isinstance(req.headers['API-KEY'], str) or \
len(str.strip(req.headers['API-KEY'])) == 0:
access_control(req)
Function on_get
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def on_get(req, resp, id_):
if 'API-KEY' not in req.headers or \
not isinstance(req.headers['API-KEY'], str) or \
len(str.strip(req.headers['API-KEY'])) == 0:
access_control(req)
Function on_get
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def on_get(req, resp):
if 'API-KEY' not in req.headers or \
not isinstance(req.headers['API-KEY'], str) or \
len(str.strip(req.headers['API-KEY'])) == 0:
access_control(req)
Function on_get
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def on_get(req, resp, id_):
if 'API-KEY' not in req.headers or \
not isinstance(req.headers['API-KEY'], str) or \
len(str.strip(req.headers['API-KEY'])) == 0:
access_control(req)
Function _defineEvent
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
TransitionService.prototype._defineEvent = function (name, hookPhase, hookOrder, criteriaMatchPath, reverseSort, getResultHandler, getErrorHandler, synchronous) {
Consider simplifying this complex logical expression. Open
Open
if (qrcode.isDark(row, col)
&& !qrcode.isDark(row, col + 1)
&& qrcode.isDark(row, col + 2)
&& qrcode.isDark(row, col + 3)
&& qrcode.isDark(row, col + 4)
Function TransitionEventType
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function TransitionEventType(name, hookPhase, hookOrder, criteriaMatchPath, reverseSort, getResultHandler, getErrorHandler, synchronous) {
Consider simplifying this complex logical expression. Open
Open
if (qrcode.isDark(row, col)
&& !qrcode.isDark(row + 1, col)
&& qrcode.isDark(row + 2, col)
&& qrcode.isDark(row + 3, col)
&& qrcode.isDark(row + 4, col)