Showing 5,781 of 10,536 total issues
Consider simplifying this complex logical expression. Open
if (energy_meter_hourly is None or len(energy_meter_hourly) == 0) and \
(energy_virtual_meter_hourly is None or len(energy_virtual_meter_hourly) == 0) and \
(energy_offline_meter_hourly is None or len(energy_offline_meter_hourly) == 0) and \
(energy_combined_equipment_hourly is None or len(energy_combined_equipment_hourly) == 0) and \
(energy_equipment_hourly is None or len(energy_equipment_hourly) == 0) and \
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 \
Consider simplifying this complex logical expression. Open
if (energy_meter_hourly is None or len(energy_meter_hourly) == 0) and \
(energy_virtual_meter_hourly is None or len(energy_virtual_meter_hourly) == 0) and \
(energy_offline_meter_hourly is None or len(energy_offline_meter_hourly) == 0) and \
(energy_combined_equipment_hourly is None or len(energy_combined_equipment_hourly) == 0) and \
(energy_equipment_hourly is None or len(energy_equipment_hourly) == 0) and \
File BillingUserForm.js
has 360 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { Fragment, useContext } from 'react';
import WizardInput from './WizardInput';
import { Col, Row, UncontrolledTooltip } from 'reactstrap';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { AuthWizardContext } from '../../../context/Context';
Function generate_excel
has 116 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 generate_excel
has 116 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 Trace
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Trace = /** @class */ (function () {
/** @internal */
function Trace() {
/** @internal */
this._enabled = {};
Function renderSection
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
function renderSection(position) {
var sectionEl = $('<div class="fc-' + position + '"/>');
var buttonStr = options.header[position];
if (buttonStr) {
Function editEnergyStorageContainerLoad
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
$scope.editEnergyStorageContainerLoad = function(energystoragecontainerload) {
var modalInstance = $uibModal.open({
templateUrl: 'views/settings/energystoragecontainer/energystoragecontainerload.model.html',
controller: 'ModalEditEnergyStorageContainerLoadCtrl',
windowClass: "animated fadeIn",
Function on_get
has 115 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 115 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 main
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def main():
"""main"""
# create logger
logger = logging.getLogger('myems-modbus-tcp')
# specifies the lowest-severity log message a logger will handle,
- 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 31 (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 31 (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_put
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def on_put(req, resp, id_, lid):
"""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',
- 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 31 (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_put
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def on_put(req, resp, id_):
"""Handles PUT requests"""
admin_control(req)
if not id_.isdigit() or int(id_) <= 0:
- 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_delete
has a Cognitive Complexity of 31 (exceeds 5 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_NOTIFICATION_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 CanvasRenderer
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
var CanvasRenderer = function(el, options) {
var cachedBackground;
var canvas = document.createElement('canvas');
el.appendChild(canvas);
Function CanvasRenderer
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
var CanvasRenderer = function(el, options) {
var cachedBackground;
var canvas = document.createElement('canvas');
el.appendChild(canvas);