Showing 5,781 of 10,536 total issues
Consider simplifying this complex logical expression. Open
if 'parameters' not in report.keys() or \
report['parameters'] is None or \
'names' not in report['parameters'].keys() or \
report['parameters']['names'] is None or \
len(report['parameters']['names']) == 0 or \
Consider simplifying this complex logical expression. Open
if 'parameters' not in report.keys() or \
report['parameters'] is None or \
'names' not in report['parameters'].keys() or \
report['parameters']['names'] is None or \
len(report['parameters']['names']) == 0 or \
Consider simplifying this complex logical expression. Open
if 'parameters' not in report.keys() or \
report['parameters'] is None or \
'names' not in report['parameters'].keys() or \
report['parameters']['names'] is None or \
len(report['parameters']['names']) == 0 or \
Consider simplifying this complex logical expression. Open
if 'parameters' not in report.keys() or \
report['parameters'] is None or \
'names' not in report['parameters'].keys() or \
report['parameters']['names'] is None or \
len(report['parameters']['names']) == 0 or \
File EnergyStoragePowerStationTable.js
has 277 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { Fragment, createRef, useContext } from 'react';
import paginationFactory, { PaginationProvider } from 'react-bootstrap-table2-paginator';
import BootstrapTable from 'react-bootstrap-table-next';
import Badge from 'reactstrap/es/Badge';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
Function UrlRuleFactory
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
var UrlRuleFactory = /** @class */ (function () {
function UrlRuleFactory(router) {
this.router = router;
}
UrlRuleFactory.prototype.compile = function (str) {
Function UrlService
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
var UrlService = /** @class */ (function () {
/** @internal */
function UrlService(/** @internal */ router) {
var _this = this;
this.router = router;
Function processSeries
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
var processSeries = function(series, seriesOld) {
var i;
var ids = [];
if(series) {
Function Dropzone
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Dropzone(el, options) {
var _this;
_classCallCheck(this, Dropzone);
Function sortAnimations
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
function sortAnimations(animations) {
var tree = { children: [] };
var i, lookup = new $$Map();
// this is done first beforehand so that the map
File datasource.controller.js
has 275 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
app.controller('DataSourceController', function(
$scope,
$rootScope,
Function updateDataFields
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.updateDataFields = function(d) {
b.options.dataFields = d
? {
allowDrag: d.allowDrag ? d.allowDrag : "allowDrag",
allowDrop: d.allowDrop ? d.allowDrop : "allowDrop",
Function deps
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ($ocLazyLoad) {
return $ocLazyLoad.load(['ui.select', 'ui.checkbox', 'toaster', 'datepicker']).then(
function () {
return $ocLazyLoad.load([{
files: ['js/plugins/sweetalert/sweetalert.min.js','css/plugins/sweetalert/sweetalert.css']
Function CarouselExample
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
const CarouselExample = () => {
const carouselExample = `function carouselExample (){
const [activeIndex, setActiveIndex] = useState(0);
const [animating, setAnimating] = useState(false);
File energycategory.py
has 275 lines of code (exceeds 250 allowed). Consider refactoring. Open
import uuid
import falcon
import mysql.connector
import simplejson as json
from core.useractivity import user_logger, admin_control, access_control, api_key_control
Function isValidFile
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
Dropzone.isValidFile = function (file, acceptedFiles) {
if (!acceptedFiles) {
return true;
} // If there are no accepted mime types, it's OK
- 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 ItemDashboard
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
const ItemDashboard = ({ setRedirect, setRedirectUrl, t }) => {
const [activeTabLeft, setActiveTabLeft] = useState('1');
const toggleTabLeft = tab => {
if (activeTabLeft !== tab) setActiveTabLeft(tab);
};
- 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 19 (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 on_post
has a Cognitive Complexity of 19 (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 19 (exceeds 5 allowed). Consider refactoring. Open
def on_get(req, resp):
access_control(req)
start_datetime_local = req.params.get('startdatetime')
end_datetime_local = req.params.get('enddatetime')
status = req.params.get('status')
- 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"