Showing 5,781 of 10,536 total issues
Function on_get
has a Cognitive Complexity of 12 (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_get
has a Cognitive Complexity of 12 (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_get
has a Cognitive Complexity of 12 (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_get
has a Cognitive Complexity of 12 (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 getLZWRaster
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
var getLZWRaster = function(lzwMinCodeSize) {
var clearCode = 1 << lzwMinCodeSize;
var endCode = (1 << lzwMinCodeSize) + 1;
var bitLength = lzwMinCodeSize + 1;
Function $AriaProvider
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function $AriaProvider() {
var config = {
ariaHidden: true,
ariaChecked: true,
ariaReadonly: true,
Function CoordinateGrid
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function CoordinateGrid(buildFunc) {
var t = this;
var rows;
var cols;
Function isBrowserSupported
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Dropzone.isBrowserSupported = function () {
var capableBrowser = true;
if (window.File && window.FileReader && window.FileList && window.Blob && window.FormData && document.querySelector) {
if (!("classList" in document.createElement("a"))) {
Function render
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Canvas.prototype.render = function() {
var cache = this._textCache;
// For each text layer, add elements marked as active that haven't
Function drawAxisLabels
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function drawAxisLabels() {
$.each(allAxes(), function (_, axis) {
var box = axis.box,
legacyStyles = axis.direction + "Axis " + axis.direction + axis.n + "Axis",
Function createOrUpdateDetailRow
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
}, r.createOrUpdateDetailRow = function(t) {
var a, i = e(t),
o = i.next(),
n = [];
if (i.data("detail_created") === !0) return !0;
Function showPicker
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function showPicker() {
if (picker) {
return;
}
// create picker element
Function exportToJSON
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.exportToJSON = function(d, a, c) {
c = c ? c : null;
var h = !1 !== a ? b.getFullList() : b.dataObj.getList();
d = d
? d
Function deleteTextMessage
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
$scope.deleteTextMessage = function(textmessage) {
SweetAlert.swal({
title: $translate.instant("SWEET.TITLE"),
text: $translate.instant("SWEET.TEXT"),
type: "warning",
Function importPoint
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
$scope.importPoint = function() {
var modalInstance = $uibModal.open({
templateUrl: 'views/common/import.html',
controller: 'ModalImportCtrl',
windowClass: "animated fadeIn",
Function importCombinedEquipment
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
$scope.importCombinedEquipment = function() {
var modalInstance = $uibModal.open({
templateUrl: 'views/common/import.html',
controller: 'ModalImportCtrl',
windowClass: "animated fadeIn",
Function importGateway
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
$scope.importGateway = function() {
var modalInstance = $uibModal.open({
templateUrl: 'views/common/import.html',
controller: 'ModalImportCtrl',
windowClass: "animated fadeIn",
Function deleteCommand
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
$scope.deleteCommand=function(command){
SweetAlert.swal({
title: $translate.instant("SWEET.TITLE"),
text: $translate.instant("SWEET.TEXT"),
type: "warning",
Function pairMeter
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
$scope.pairMeter=function(dragEl,dropEl){
var tem_uuid = angular.element('#' + dragEl);
if (angular.isDefined(tem_uuid.scope().equipmentmeter)) {
return;
}
Function editApiKey
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
$scope.editApiKey = function (apiKey) {
var modalInstance = $uibModal.open({
windowClass: "animated fadeIn",
templateUrl: 'views/users/apikey/apikey.model.html',
controller: 'ModalEditApiKeyCtrl',