Showing 5,781 of 10,536 total issues
Function on_put
has a Cognitive Complexity of 33 (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
File energystoragecontainerload.controller.js
has 370 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
app.controller('EnergyStorageContainerLoadController', function(
$scope,
$rootScope,
Function on_get
has 122 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 editEnergyStorageContainerGrid
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
$scope.editEnergyStorageContainerGrid = function(energystoragecontainergrid) {
var modalInstance = $uibModal.open({
templateUrl: 'views/settings/energystoragecontainer/energystoragecontainergrid.model.html',
controller: 'ModalEditEnergyStorageContainerGridCtrl',
windowClass: "animated fadeIn",
Function UserForm
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
const UserForm = () => {
const { isRTL } = useContext(AppContext);
const { user, setUser, step, setStep } = useContext(AuthWizardContext);
const { register, handleSubmit, errors, watch } = useForm();
Function on_post
has 121 lines of code (exceeds 25 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')
prototype
has 37 functions (exceeds 20 allowed). Consider refactoring. Open
jvm.Map.prototype = {
transX: 0,
transY: 0,
scale: 1,
baseTransX: 0,
File OfflineMeterInput.js
has 368 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { Fragment, useEffect, useState } from 'react';
import {
Breadcrumb,
BreadcrumbItem,
Button,
File energystoragepowerstationcollectionenergy.py
has 367 lines of code (exceeds 250 allowed). Consider refactoring. Open
from datetime import datetime, timedelta, timezone
from decimal import Decimal
import falcon
import mysql.connector
import simplejson as json
Function addEnergyStorageContainerGrid
has 120 lines of code (exceeds 25 allowed). Consider refactoring. Open
$scope.addEnergyStorageContainerGrid = function() {
var modalInstance = $uibModal.open({
templateUrl: 'views/settings/energystoragecontainer/energystoragecontainergrid.model.html',
controller: 'ModalAddEnergyStorageContainerGridCtrl',
Function on_get
has 120 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 120 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 Sb
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Sb = function(b, c) {
var d = a.currentList[b],
g = a.defaultStyle.item.general.normal,
e = a.getCurrentItemStyle(d, a.getObjState(d));
d = '<li class="' + g;
Function addEnergyStorageContainerLoad
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
$scope.addEnergyStorageContainerLoad = function() {
var modalInstance = $uibModal.open({
templateUrl: 'views/settings/energystoragecontainer/energystoragecontainerload.model.html',
controller: 'ModalAddEnergyStorageContainerLoadCtrl',
windowClass: "animated fadeIn",
Function on_post
has a Cognitive Complexity of 32 (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_put
has a Cognitive Complexity of 32 (exceeds 5 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')
- 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 118 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_put
has 118 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')
Consider simplifying this complex logical expression. Open
if (b)
switch (b.type) {
case "item":
v &&
!a.isItemFixed(b) &&
Consider simplifying this complex logical expression. Open
if (meter_list is None or len(meter_list) == 0) and \
(virtual_meter_list is None or len(virtual_meter_list) == 0) and \
(offline_meter_list is None or len(offline_meter_list) == 0) and \
(combined_equipment_list is None or len(combined_equipment_list) == 0) and \
(equipment_list is None or len(equipment_list) == 0) and \