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)
Severity: Minor
Found in myems-api/core/space.py - About 1 hr to fix

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)
Severity: Minor
Found in myems-api/core/store.py - About 1 hr to fix

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)
Severity: Minor
Found in myems-api/core/store.py - About 1 hr to fix

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)
Severity: Minor
Found in myems-api/core/store.py - About 1 hr to fix

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;
Severity: Minor
Found in myems-admin/js/angular/qrcode.js - About 1 hr to fix

    Function $AriaProvider has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function $AriaProvider() {
      var config = {
        ariaHidden: true,
        ariaChecked: true,
        ariaReadonly: true,
    Severity: Minor
    Found in myems-admin/js/angular/angular-aria.js - About 1 hr to fix

      Function CoordinateGrid has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function CoordinateGrid(buildFunc) {
      
              var t = this;
              var rows;
              var cols;
      Severity: Minor
      Found in myems-admin/js/plugins/fullcalendar/fullcalendar.min.js - About 1 hr to fix

        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"))) {
        Severity: Minor
        Found in myems-admin/js/plugins/dropzone/dropzone.js - About 1 hr to fix

          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
          Severity: Minor
          Found in myems-admin/js/plugins/flot/jquery.flot.js - About 1 hr to fix

            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",
            Severity: Minor
            Found in myems-admin/js/plugins/flot/jquery.flot.js - About 1 hr to fix

              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;
              Severity: Minor
              Found in myems-admin/js/plugins/footable/footable.all.min.js - About 1 hr to fix

                Function showPicker has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                                function showPicker() {
                                    if (picker) {
                                        return;
                                    }
                                    // create picker element
                Severity: Minor
                Found in myems-admin/js/plugins/datapicker/angular-datepicker.js - About 1 hr to fix

                  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
                  Severity: Minor
                  Found in myems-admin/js/jcui/angular.integralui.treeview.min.js - About 1 hr to fix

                    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",
                      Severity: Minor
                      Found in myems-admin/app/controllers/settings/datasource/point.controller.js - About 1 hr to fix

                        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",
                          Severity: Minor
                          Found in myems-admin/app/controllers/settings/gateway/gateway.controller.js - About 1 hr to fix

                            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",
                            Severity: Minor
                            Found in myems-admin/app/controllers/settings/command/command.controller.js - About 1 hr to fix

                              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',
                                Severity: Minor
                                Found in myems-admin/app/controllers/users/apikey/apikey.controller.js - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language