Showing 5,781 of 10,536 total issues
Function on_get
has 90 lines of code (exceeds 25 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)
Function on_get
has 90 lines of code (exceeds 25 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)
Function generate_excel
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def generate_excel(report,
name,
reporting_start_datetime_local,
reporting_end_datetime_local,
language):
- 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 25 (exceeds 5 allowed). Consider refactoring. 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)
- 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 25 (exceeds 5 allowed). Consider refactoring. Open
def on_get(req, resp, id_, lid):
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_FLOW_DIAGRAM_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_put
has a Cognitive Complexity of 25 (exceeds 5 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')
- 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_post
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def on_post(req, resp):
"""Handles POST requests"""
admin_control(req)
try:
raw_json = req.stream.read().decode('utf-8')
- 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_post
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def on_post(req, resp):
"""Handles POST requests"""
admin_control(req)
try:
raw_json = req.stream.read().decode('utf-8')
- 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 25 (exceeds 5 allowed). Consider refactoring. 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)
- 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 MockHttpExpectation
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
function MockHttpExpectation(expectedMethod, expectedUrl, expectedData, expectedHeaders,
expectedKeys) {
this.data = expectedData;
this.headers = expectedHeaders;
Function link
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function(scope, element, attrs) {
function getSettings(el) {
var settings = angular.copy(scope.options);
settings.element = el;
settings.series = scope.series;
Function handleRead
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
const handleRead = id => {
console.log('Mark As Read: ', id);
let isResponseOK = false;
fetch(APIBaseURL + '/webmessages/' + id, {
method: 'PUT',
File tenantbill.py
has 315 lines of code (exceeds 250 allowed). Consider refactoring. Open
import re
from datetime import datetime, timedelta, timezone
from decimal import Decimal
import falcon
import mysql.connector
File virtualmeterenergy.py
has 314 lines of code (exceeds 250 allowed). Consider refactoring. Open
import re
from datetime import datetime, timedelta, timezone
from decimal import Decimal
import falcon
import mysql.connector
Function handledelete
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
const handledelete = id => {
console.log('Delete: ', id);
let isResponseOK = false;
fetch(APIBaseURL + '/webmessages/' + id, {
method: 'DELETE',
Function handledelete
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
const handledelete = id => {
console.log('Delete: ', id);
let isResponseOK = false;
fetch(APIBaseURL + '/webmessages/' + id, {
method: 'DELETE',
Function handledelete
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
const handledelete = id => {
console.log('Delete: ', id);
let isResponseOK = false;
fetch(APIBaseURL + '/webmessages/' + id, {
method: 'DELETE',
Function compile
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
compile: function (tElement, tAttrs, $transclude) {
return function (scope, $element, attrs) {
var onloadExp = attrs['onload'] || '', autoScrollExp = attrs['autoscroll'], renderer = getRenderer(), inherited = $element.inheritedData('$uiView') || rootData, name = $interpolate(attrs['uiView'] || attrs['name'] || '')(scope) || '$default';
var previousEl, currentEl, currentScope, viewConfig;
var activeUIView = {
Function buildElement
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
$delegate.buildElement = function buildElement(type, path, params) {
var deferred = $q.defer(),
el,
loaded,
filesCache = $delegate._getFilesCache(),
Function X
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
X = function(b) {
if (Ha && !va)
switch (b) {
case "start":
Wa(0);