Showing 5,781 of 10,536 total issues
Function on_get
has 32 lines of code (exceeds 25 allowed). Consider refactoring. 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_ENERGY_STORAGE_CONTAINER_ID')
Function on_delete
has 32 lines of code (exceeds 25 allowed). Consider refactoring. 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_OFFLINE_METER_ID')
Function on_post
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def on_post(req, resp):
"""Handles POST requests"""
admin_control(req)
try:
raw_json = req.stream.read().decode('utf-8')
Function on_put
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def on_put(req, resp, id_):
"""Handles PUT requests"""
admin_control(req)
try:
raw_json = req.stream.read().decode('utf-8')
Function on_put
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def on_put(req, resp, id_, lid):
"""Handles PUT requests"""
admin_control(req)
try:
raw_json = req.stream.read().decode('utf-8')
Function on_put
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def on_put(req, resp, id_, pid):
"""Handles PUT requests"""
admin_control(req)
try:
raw_json = req.stream.read().decode('utf-8')
Function on_put
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def on_put(req, resp, id_, gid):
"""Handles PUT requests"""
admin_control(req)
try:
raw_json = req.stream.read().decode('utf-8')
Function on_put
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def on_put(req, resp, id_):
"""Handles PUT requests"""
admin_control(req)
if not id_.isdigit() or int(id_) <= 0:
raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
Function on_put
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def on_put(req, resp, id_, eid):
"""Handles PUT requests"""
admin_control(req)
try:
raw_json = req.stream.read().decode('utf-8')
Function on_put
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def on_put(req, resp, id_):
"""Handles PUT requests"""
admin_control(req)
if not id_.isdigit() or int(id_) <= 0:
raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
Function $httpBackend
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
function $httpBackend(method, url, data, callback, headers, timeout, withCredentials, responseType, eventHandlers, uploadEventHandlers) {
Function drawImageIOSFix
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
var drawImageIOSFix = function drawImageIOSFix(ctx, img, sx, sy, sw, sh, dx, dy, dw, dh) {
Function Fault
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const Fault = ({ setRedirect, setRedirectUrl, t }) => {
let current_moment = moment();
// Query Parameters
const [priority, setPriority] = useState('all');
- 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 LoginForm
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const LoginForm = ({ setRedirect, hasLabel, layout, t }) => {
// State
const [email, setEmail] = useState(getItemFromStore('email', ''));
const [password, setPassword] = useState('');
const [code, setCode] = useState('');
- 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 WorkOrderRepair
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const WorkOrderRepair = ({ setRedirect, setRedirectUrl, t }) => {
let current_moment = moment();
// Query Parameters
const [priority, setPriority] = useState('all');
- 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 WorkOrderInstallation
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const WorkOrderInstallation = ({ setRedirect, setRedirectUrl, t }) => {
let current_moment = moment();
// Query Parameters
const [priority, setPriority] = useState('all');
- 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 WorkOrderInspection
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const WorkOrderInspection = ({ setRedirect, setRedirectUrl, t }) => {
let current_moment = moment();
// Query Parameters
const [priority, setPriority] = useState('all');
- 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 on_get
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. 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)
- 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 on_get
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. 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_ENERGY_STORAGE_CONTAINER_ID')
- 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 on_get
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. 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_ENERGY_STORAGE_CONTAINER_ID')
- 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"