Showing 5,781 of 10,536 total issues

Function onSpaceCascaderChange has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  let onSpaceCascaderChange = (value, selectedOptions) => {
    setSelectedSpaceName(selectedOptions.map(o => o.label).join('/'));
    setSelectedSpaceID(value[value.length - 1]);

    let isResponseOK = false;
Severity: Minor
Found in myems-web/src/components/MyEMS/Monitoring/CombinedEquipments.js - About 1 hr to fix

    Function on_get has 43 lines of code (exceeds 25 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)
    Severity: Minor
    Found in myems-api/reports/meterrealtime.py - About 1 hr to fix

      Function on_post has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def on_post(req, resp, id_):
              """Handles POST requests"""
              admin_control(req)
              try:
                  raw_json = req.stream.read().decode('utf-8')
      Severity: Minor
      Found in myems-api/core/microgrid.py - About 1 hr to fix

        Function on_post has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def on_post(req, resp):
                """Handles POST requests"""
                admin_control(req)
                try:
                    raw_json = req.stream.read().decode('utf-8')
        Severity: Minor
        Found in myems-api/core/point.py - About 1 hr to fix

          Function on_post has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def on_post(req, resp):
                  """Handles POST requests"""
                  admin_control(req)
                  try:
                      raw_json = req.stream.read().decode('utf-8')
          Severity: Minor
          Found in myems-api/core/point.py - About 1 hr to fix

            Function on_post has 43 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def on_post(req, resp):
                    """Handles POST requests"""
                    admin_control(req)
                    try:
                        raw_json = req.stream.read().decode('utf-8')
            Severity: Minor
            Found in myems-api/core/store.py - About 1 hr to fix

              Function ParamTypes has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  var ParamTypes = /** @class */ (function () {
                      function ParamTypes() {
                          this.enqueue = true;
                          this.typeQueue = [];
                          this.defaultTypes = pick(ParamTypes.prototype, [
              Severity: Minor
              Found in myems-admin/js/ui-router/angular-ui-router.js - About 1 hr to fix

                Function resolvablesBuilder has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function resolvablesBuilder(state) {
                        /** convert resolve: {} and resolvePolicy: {} objects to an array of tuples */
                        var objects2Tuples = function (resolveObj, resolvePolicies) {
                            return Object.keys(resolveObj || {}).map(function (token) { return ({
                                token: token,
                Severity: Minor
                Found in myems-admin/js/ui-router/angular-ui-router.js - About 1 hr to fix

                  Function transitionTo has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          StateService.prototype.transitionTo = function (to, toParams, options) {
                              var _this = this;
                              if (toParams === void 0) { toParams = {}; }
                              if (options === void 0) { options = {}; }
                              var router = this.router;
                  Severity: Minor
                  Found in myems-admin/js/ui-router/angular-ui-router.js - About 1 hr to fix

                    Function $$AnimateCacheProvider has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    var $$AnimateCacheProvider = function() {
                    
                      var KEY = '$$ngAnimateParentKey';
                      var parentCounter = 0;
                      var cache = Object.create(null);
                    Severity: Minor
                    Found in myems-admin/js/angular/angular-animate.js - About 1 hr to fix

                      Function resize has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              resize: function resize(file, width, height, resizeMethod) {
                                var info = {
                                  srcX: 0,
                                  srcY: 0,
                                  srcWidth: file.width,
                      Severity: Minor
                      Found in myems-admin/js/plugins/dropzone/dropzone.js - About 1 hr to fix

                        Function isValidFile has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        Dropzone.isValidFile = function (file, acceptedFiles) {
                          if (!acceptedFiles) {
                            return true;
                          } // If there are no accepted mime types, it's OK
                        
                        
                        Severity: Minor
                        Found in myems-admin/js/plugins/dropzone/dropzone.js - About 1 hr to fix

                          Function set_up_html has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  Chosen.prototype.set_up_html = function() {
                                      var container_classes, container_props;
                                      container_classes = ["chosen-container"];
                                      container_classes.push("chosen-container-" + (this.is_multiple ? "multi" : "single"));
                                      if (this.inherit_select_classes && this.form_field.className) {
                          Severity: Minor
                          Found in myems-admin/js/plugins/chosen/chosen.jquery.js - About 1 hr to fix

                            Function expand has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                  this.expand = function(a) {
                                    var d = b.getItemFromChildElem(document.activeElement);
                                    b.expandList.length = [];
                                    b.expandIndentList.length = [];
                                    b.expandParentList.length = [];
                            Severity: Minor
                            Found in myems-admin/js/jcui/angular.integralui.treeview.min.js - About 1 hr to fix

                              Function editCombinedEquipment has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  $scope.editCombinedEquipment = function (combinedequipment) {
                                      var modalInstance = $uibModal.open({
                                          windowClass: "animated fadeIn",
                                          templateUrl: 'views/settings/combinedequipment/combinedequipment.model.html',
                                          controller: 'ModalEditCombinedEquipmentCtrl',

                                Function editEquipment has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    $scope.editEquipment = function(equipment) {
                                        var modalInstance = $uibModal.open({
                                            windowClass: "animated fadeIn",
                                            templateUrl: 'views/settings/equipment/equipment.model.html',
                                            controller: 'ModalEditEquipmentCtrl',

                                  Function addEnergyStorageContainer has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      $scope.addEnergyStorageContainer = function() {
                                          var modalInstance = $uibModal.open({
                                              templateUrl: 'views/settings/energystoragecontainer/energystoragecontainer.model.html',
                                              controller: 'ModalAddEnergyStorageContainerCtrl',
                                              windowClass: "animated fadeIn",

                                    Function editEnergyStoragePowerStation has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        $scope.editEnergyStoragePowerStation = function(energystoragepowerstation) {
                                            var modalInstance = $uibModal.open({
                                                windowClass: "animated fadeIn",
                                                templateUrl: 'views/settings/energystoragepowerstation/energystoragepowerstation.model.html',
                                                controller: 'ModalEditEnergyStoragePowerStationCtrl',

                                      Function addShopfloor has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          $scope.addShopfloor = function () {
                                              var modalInstance = $uibModal.open({
                                                  templateUrl: 'views/settings/shopfloor/shopfloor.model.html',
                                                  controller: 'ModalAddShopfloorCtrl',
                                                  windowClass: "animated fadeIn",

                                        Function editMicrogrid has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            $scope.editMicrogrid = function(microgrid) {
                                                var modalInstance = $uibModal.open({
                                                    windowClass: "animated fadeIn",
                                                    templateUrl: 'views/settings/microgrid/microgrid.model.html',
                                                    controller: 'ModalEditMicrogridCtrl',
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language