Showing 5,781 of 10,536 total issues
Function on_get
has 131 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 131 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 131 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)
File energystoragecontainerhvac.controller.js
has 384 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
app.controller('EnergyStorageContainerHVACController', function(
$scope,
$rootScope,
File textmessage.py
has 384 lines of code (exceeds 250 allowed). Consider refactoring. Open
from datetime import datetime, timedelta, timezone
import falcon
import mysql.connector
import simplejson as json
from core.useractivity import user_logger, admin_control
Function Header
has 130 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Header(calendar, options) {
var t = this;
// exports
Function generate_excel
has 130 lines of code (exceeds 25 allowed). Consider refactoring. Open
def generate_excel(report,
name,
base_period_start_datetime_local,
base_period_end_datetime_local,
reporting_start_datetime_local,
Function TransitionService
has 128 lines of code (exceeds 25 allowed). Consider refactoring. Open
var TransitionService = /** @class */ (function () {
/** @internal */
function TransitionService(_router) {
/** @internal */
this._transitionCount = 0;
File space.controller.js
has 380 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
app.controller('SpaceController', function (
$scope,
$rootScope,
File energystoragepowerstationreportingparameters.py
has 380 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 generate_excel
has 128 lines of code (exceeds 25 allowed). Consider refactoring. Open
def generate_excel(report,
name,
base_period_start_datetime_local,
base_period_end_datetime_local,
reporting_start_datetime_local,
Function on_get
has a Cognitive Complexity of 34 (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 get_energy_category_tariffs
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
def get_energy_category_tariffs(cost_center_id, energy_category_id, start_datetime_utc, end_datetime_utc):
# todo: verify parameters
if cost_center_id is None:
return dict()
- 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 get_energy_item_tariffs
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
def get_energy_item_tariffs(cost_center_id, energy_item_id, start_datetime_utc, end_datetime_utc):
# todo: verify parameters
if cost_center_id is None:
return dict()
- 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 get_energy_category_tariffs
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
def get_energy_category_tariffs(cost_center_id, energy_category_id, start_datetime_utc, end_datetime_utc):
# todo: validate parameters
if cost_center_id is None:
return dict()
- 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 34 (exceeds 5 allowed). Consider refactoring. Open
def on_put(req, resp, id_):
"""Handles PUT requests"""
access_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 get_energy_category_peak_types
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
def get_energy_category_peak_types(cost_center_id, energy_category_id, start_datetime_utc, end_datetime_utc):
# todo: validate parameters
if cost_center_id is None:
return dict()
- 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 user_logger
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
def user_logger(func):
"""
Decorator for logging user activities
:param func: the decorated function
:return: the decorator
- 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 34 (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 Main
has 127 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Main = props => {
const [isFluid, setIsFluid] = useState(getItemFromStore('isFluid', settings.isFluid));
const [isRTL, setIsRTL] = useState(getItemFromStore('isRTL', settings.isRTL));
const [isDark, setIsDark] = useState(getItemFromStore('isDark', settings.isDark));
const [isTopNav, setIsTopNav] = useState(getItemFromStore('isTopNav', settings.isTopNav));