Showing 5,781 of 10,536 total issues
Function on_post
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def on_post(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_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):
try:
raw_json = req.stream.read().decode('utf-8')
new_values = json.loads(raw_json)
except Exception as ex:
- 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
File energystoragecontainerfirecontrol.controller.js
has 274 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
app.controller('EnergyStorageContainerFirecontrolController', function(
$scope,
$rootScope,
Function update
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
function update() {
var mainEl = angular.element(element);
mainEl.append(graphEl);
mainEl.empty();
var graphEl = $compile('<div></div>')(scope);
Function link
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function(scope, elm, attrs, controller) {
var sources = scope.eventSources,
sourcesChanged = false,
eventSourcesWatcher = controller.changeWatcher(sources, controller.sourcesFingerprint),
Function plotLine
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
function plotLine(datapoints, xoffset, yoffset, axisx, axisy) {
var points = datapoints.points,
ps = datapoints.pointsize,
prevx = null, prevy = null;
Function Map
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
jvm.Map = function(params) {
var map = this,
e;
this.params = jvm.$.extend(true, {}, jvm.Map.defaultParams, params);
Function CustomerDetail
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
const CustomerDetail = () => {
const { loading, data: customer } = useFakeFetch(rawCustomer);
const { id, email, createdAt, description, vat_no, email_to, address, cell, invoice_prefix } = customer;
return (
Function ReactBootstrapTable2
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ReactBootstrapTable2 = () => {
const [data, setData] = useState({ items: getItems(10), selected: getItems(5, 10) });
const id2List = {
droppable: 'items',
Function UsersAndFeed
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
const UsersAndFeed = () => {
const VideoPostContent = rawFeeds.find(feed => {
return Object.keys(feed.content).includes('video');
});
const GalleryPostContent = rawFeeds.find(feed => {
Function Charts
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Charts = props => {
const pointid = props.pointid;
const pointname = props.pointname;
const namewithid = pointname + ' ( ID: ' + pointid + ' )';
const optionData = props.data;
Function on_put
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def on_put(req, resp, id_, lid):
"""Handles PUT requests"""
admin_control(req)
try:
raw_json = req.stream.read().decode('utf-8')
File angular-messages.js
has 272 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* @license AngularJS v1.8.3
* (c) 2010-2020 Google LLC. http://angularjs.org
* License: MIT
*/
Function initDefaultTypes
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
function initDefaultTypes() {
var makeDefaultType = function (def) {
var valToString = function (val) { return (val != null ? val.toString() : val); };
var defaultTypeBase = {
encode: valToString,
Function UrlMatcher
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
function UrlMatcher(pattern, paramTypes, paramFactory, config) {
var _this = this;
/** @internal */
this._cache = { path: [this] };
/** @internal */
Function TargetState
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
var TargetState = /** @class */ (function () {
/**
* The TargetState constructor
*
* Note: Do not construct a `TargetState` manually.
Function factory
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
function factory(angular, Dropzone){
angular.module('thatisuday.dropzone', []).provider('dropzoneOps', function(){
/*
* Add default options here
Function Navs
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Navs = () => {
return (
<Fragment>
<PageHeader
title="Navs"