Showing 5,781 of 10,536 total issues
Function on_put
has a Cognitive Complexity of 14 (exceeds 5 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')
- 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 14 (exceeds 5 allowed). Consider refactoring. Open
def on_post(req, resp, id_):
"""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 14 (exceeds 5 allowed). Consider refactoring. Open
def on_post(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')
- 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 14 (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 14 (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 htmlSanitizeWriterImpl
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function htmlSanitizeWriterImpl(buf, uriValidator) {
var ignoreCurrentElement = false;
var out = bind(buf, buf.push);
return {
start: function(tag, attrs) {
Function $get
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.$get = ['$$animateJs', '$$AnimateRunner', function($$animateJs, $$AnimateRunner) {
return function initDriverFn(animationDetails) {
if (animationDetails.from && animationDetails.to) {
var fromAnimation = prepareAnimation(animationDetails.from);
var toAnimation = prepareAnimation(animationDetails.to);
Function inject
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
window.inject = angular.mock.inject = function() {
var blockFns = Array.prototype.slice.call(arguments, 0);
var errorForStack = new Error('Declaration Location');
// IE10+ and PhanthomJS do not set stack trace information, until the error is thrown
if (!errorForStack.stack) {
Function position
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
position: function() {
var options = this.options;
var origin = this.el.offsetParent().offset();
var width = this.el.outerWidth();
var height = this.el.outerHeight();
Function show
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
ClockPicker.prototype.show = function(e){
// Not show again
if (this.isShown) {
return;
}
Function _invokeQueue
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _invokeQueue(providers, queue, moduleName, reconfig) {
if (!queue) {
return;
}
Function uiBrCpfCnpjMask
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function uiBrCpfCnpjMask() {
function applyCpfCnpjMask (value) {
if(!value) {
return value;
}
Function b
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
var b = q(function() {
if (0 < a.currentList.length) {
v = k.$new();
v.data = Fb();
v.checkBoxStyle = a.options.checkBoxSettings.style;
Function editEnergyStorageContainer
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
$scope.editEnergyStorageContainer = function(energystoragecontainer) {
var modalInstance = $uibModal.open({
windowClass: "animated fadeIn",
templateUrl: 'views/settings/energystoragecontainer/energystoragecontainer.model.html',
controller: 'ModalEditEnergyStorageContainerCtrl',
Function editShopfloor
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
$scope.editShopfloor = function(shopfloor) {
var modalInstance = $uibModal.open({
windowClass: "animated fadeIn",
templateUrl: 'views/settings/shopfloor/shopfloor.model.html',
controller: 'ModalEditShopfloorCtrl',
Function addSpace
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
$scope.addSpace = function () {
var modalInstance = $uibModal.open({
templateUrl: 'views/settings/space/space.model.html',
controller: 'ModalAddSpaceCtrl',
windowClass: "animated fadeIn",
Function addMicrogridPowerconversionsystem
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
$scope.addMicrogridPowerconversionsystem = function() {
var modalInstance = $uibModal.open({
templateUrl: 'views/settings/microgrid/microgridpowerconversionsystem.model.html',
controller: 'ModalAddMicrogridPowerconversionsystemCtrl',
Function editMicrogridBattery
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
$scope.editMicrogridBattery = function(microgridbattery) {
var modalInstance = $uibModal.open({
templateUrl: 'views/settings/microgrid/microgridbattery.model.html',
controller: 'ModalEditMicrogridBatteryCtrl',
windowClass: "animated fadeIn",
Function render
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { t } = this.props;
const chartData = {
...this.state.chartData,
datasets: [
Function onSpaceCascaderChange
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
let onSpaceCascaderChange = (value, selectedOptions) => {
setSelectedSpaceName(selectedOptions.map(o => o.label).join('/'));
setSelectedSpaceID(value[value.length - 1]);
let isResponseOK = false;