Showing 5,781 of 10,536 total issues
Function on_put
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
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_post
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
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
File combinedequipment.controller.js
has 287 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
'use strict';
app.controller('CombinedEquipmentController', function (
$scope,
$rootScope,
File microgriddashboard.py
has 287 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
from datetime import datetime, timedelta, timezone
from decimal import Decimal
import falcon
import mysql.connector
import simplejson as json
Function listen
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.listen = function () {
// bind MouseWheel
var s = this, mwTimerStop, mwTimerRelease,
mw = function (e) {
e.preventDefault();
Function buildSkeleton
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function buildSkeleton() {
var headerClass = tm + "-widget-header";
var contentClass = tm + "-widget-content";
var s;
var d;
Function findNearbyItem
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function findNearbyItem(mouseX, mouseY, seriesFilter) {
var maxDistance = options.grid.mouseActiveRadius,
smallestDistance = maxDistance * maxDistance + 1,
item = null, foundPoint = false, i, j, ps;
Function chart
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
angles.chart = function (type) {
return {
restrict: "A",
scope: {
data: "=",
Function nb
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
nb = function(b, c, d, e) {
var g =
(d && !e) ||
(b ? 0 != b[a.options.dataFields.showCheckBox] : !1);
if (d && a.options.showExpandBoxes && 1 == a.options.showLines)
Function beginLoad
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
a.beginLoad = function(a) {
if (!va)
switch (
((va = !0),
a
File equipment.controller.js
has 286 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
'use strict';
app.controller('EquipmentController', function(
$scope,
$rootScope,
File MyEMSRoutes.js
has 286 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import { Redirect, Route, Switch } from 'react-router-dom';
// import Activity from '../components/page/Activity';
// import Associations from '../components/page/Associations';
// import Billing from '../components/page/Billing';
Function module
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
return function module(name, requires, configFn) {
var info = {};
var assertNotHasOwnProperty = function(name, context) {
Function a
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function a() {
var e = this;
e.name = "Footable Filter", e.init = function(a) {
if (e.footable = a, a.options.filter.enabled === !0) {
if (t(a.table).data("filter") === !1) return;
Function pathSvgToVml
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
jvm.VMLPathElement.pathSvgToVml = function(path) {
var cx = 0, cy = 0, ctrlx, ctrly;
path = path.replace(/(-?\d+)e(-?\d+)/g, '0');
return path.replace(/([MmLlHhVvCcSs])\s*((?:-?\d*(?:\.\d+)?\s*,?\s*)+)/g, function(segment, letter, coords, index){
Function b
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var b = q(function() {
P = m[0].offsetWidth - 6;
sa = m[0].offsetHeight - 4;
C.css("top", H[0].offsetHeight + 2 + "px");
sa = G ? sa - A[0].offsetHeight : sa - 4;
File shopfloor.controller.js
has 285 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
'use strict';
app.controller('ShopfloorController', function (
$scope,
$rootScope,
Function generate_excel
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def generate_excel(report, name, reporting_start_datetime_local, reporting_end_datetime_local, language):
trans = get_translation(language)
trans.install()
_ = trans.gettext
Function on_post
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def on_post(req, resp, id_):
"""Handles POST requests"""
admin_control(req)
try:
raw_json = req.stream.read().decode('utf-8')
File MeterRealtime.js
has 284 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React, { Fragment, useEffect, useState } from 'react';
import {
Breadcrumb,
BreadcrumbItem,
Card,