Showing 5,781 of 10,536 total issues
Function on_post
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
Open
def on_post(req, resp):
"""Handles POST requests"""
admin_control(req)
try:
- 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 microgrid.controller.js
has 309 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
'use strict';
app.controller('MicrogridController', function(
$scope,
$rootScope,
File Typography.js
has 309 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React, { Fragment } from 'react';
import { Card, CardHeader, CardBody, Row, Col } from 'reactstrap';
import PageHeader from '../common/PageHeader';
import FalconEditor from '../common/FalconEditor';
import FalconCardHeader from '../common/FalconCardHeader';
Function draggableDayEvent
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function draggableDayEvent(event, eventElement, seg) {
var isStart = seg.isStart;
var origWidth;
var revert;
var allDay = true;
Function handledelete
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const handledelete = id => {
console.log('Delete: ', id);
let isResponseOK = false;
fetch(APIBaseURL + '/webmessages/' + id, {
method: 'DELETE',
Function handleCodeSubmit
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const handleCodeSubmit = e => {
setIsDisabled(true);
let isResponseOK = false;
e.preventDefault();
let subject = 'Forgot Password';
Function Avatars
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Avatars = () => {
return (
<Fragment>
<PageHeader
title="Avatar"
Function handleSubmit
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const handleSubmit = e => {
e.preventDefault();
console.log('handleSubmit');
console.log(priority);
console.log(status);
Function handleSubmit
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const handleSubmit = e => {
e.preventDefault();
console.log('handleSubmit');
console.log(priority);
console.log(status);
Function handleSubmit
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const handleSubmit = e => {
e.preventDefault();
console.log('handleSubmit');
console.log(priority);
console.log(status);
Function on_get
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
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 angular-resource.js
has 308 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* @license AngularJS v1.8.3
* (c) 2010-2020 Google LLC. http://angularjs.org
* License: MIT
*/
File jquery.flot.time.js
has 308 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* Pretty handling of time axes.
Copyright (c) 2007-2014 IOLA and Ole Laursen.
Licensed under the MIT license.
File energystoragepowerstation.controller.js
has 308 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
'use strict';
app.controller('EnergyStoragePowerStationController', function(
$scope,
$rootScope,
Function getOption
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const getOption = (data, isDark) => {
const grays = getGrays(isDark);
return {
tooltip: {
triggerOn: 'mousemove',
Function setupModuleLoader
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function setupModuleLoader(window) {
var $injectorMinErr = minErr('$injector');
var ngMinErr = minErr('ng');
File orders.js
has 304 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import {v4 as uuid} from 'uuid';
const result = [
{
id: uuid().split('-')[0],
Function handledelete
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const handledelete = id => {
console.log('Delete: ', id);
let isResponseOK = false;
fetch(APIBaseURL + '/webmessages/' + id, {
method: 'DELETE',
File metersubmetersbalance.py
has 303 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import re
from datetime import datetime, timedelta, timezone
from decimal import Decimal
import falcon
import mysql.connector
Function getElements
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
Open
Dropzone.getElements = function (els, name) {
var el, elements;
if (els instanceof Array) {
elements = [];
- 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"