Showing 5,781 of 10,536 total issues

Function getTextInfo has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    Canvas.prototype.getTextInfo = function(layer, text, font, angle, width) {

        var textStyle, layerCache, styleCache, info;

        // Cast the value to a string, in case we were given a number or such
Severity: Minor
Found in myems-admin/js/plugins/flot/jquery.flot.js - About 1 hr to fix

    Function start has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                    start: function(ev, ui) {
                        trigger('eventDragStart', eventElement, event, ev, ui);
                        hideEvents(event, eventElement);
                        origWidth = eventElement.width();
                        hoverListener.start(function(cell, origCell) {
    Severity: Minor
    Found in myems-admin/js/plugins/fullcalendar/fullcalendar.min.js - About 1 hr to fix

      Function tickFormatter has 41 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                          axis.tickFormatter = function (v, axis) {
      
                              var d = dateGenerator(v, axis.options);
      
                              // first check global format
      Severity: Minor
      Found in myems-admin/js/plugins/flot/jquery.flot.time.js - About 1 hr to fix

        Function addCombinedEquipment has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

          Function addEquipment has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

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

            Function addEnergyStoragePowerStation has 41 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

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

              Function editWindFarm has 41 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

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

                Function editPhotovoltaicPowerStation has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

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

                  Function addMicrogrid has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

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

                    Function addMicrogridHeatpump has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                          $scope.addMicrogridHeatpump = function() {
                    
                              var modalInstance = $uibModal.open({
                                  templateUrl: 'views/settings/microgrid/microgridheatpump.model.html',
                                  controller: 'ModalAddMicrogridHeatpumpCtrl',

                      Function deps has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                                      function ($ocLazyLoad) {
                                                          return $ocLazyLoad.load(['ui.checkbox', 'ui.select', 'toaster']).then(
                                                              function () {
                                                                  return $ocLazyLoad.load([{
                                                                      files: ['js/plugins/sweetalert/sweetalert.min.js', 'css/plugins/sweetalert/sweetalert.css']
                      Severity: Minor
                      Found in myems-admin/app/config.router.js - About 1 hr to fix

                        Function editMicrogridGrid has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                              $scope.editMicrogridGrid = function(microgridgrid) {
                                  var modalInstance = $uibModal.open({
                                      templateUrl: 'views/settings/microgrid/microgridgrid.model.html',
                                      controller: 'ModalEditMicrogridGridCtrl',
                                    windowClass: "animated fadeIn",

                          Function render has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            render() {
                              const { t } = this.props;
                          
                              return (
                                <Card className="mb-3 overflow-hidden" style={{ minWidth: '12rem', maxWidth: '25%' }}>
                          Severity: Minor
                          Found in myems-web/src/components/MyEMS/Space/RealtimeData.js - About 1 hr to fix

                            Function on_get has 41 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/spaceenvironmentmonitor.py - About 1 hr to fix

                              Function on_get has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  def on_get(req, resp):
                                      access_control(req)
                                      # Get user inforamtion
                                      user_uuid = str.strip(req.headers['USER-UUID'])
                                      cnx_user_db = mysql.connector.connect(**config.myems_user_db)
                              Severity: Minor
                              Found in myems-api/reports/microgridlist.py - About 1 hr to fix

                                Function on_get has 41 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/virtualmeterbatch.py - About 1 hr to fix

                                  Function on_get has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      def on_get(req, resp):
                                          access_control(req)
                                          # Get user inforamtion
                                          user_uuid = str.strip(req.headers['USER-UUID'])
                                          cnx_user_db = mysql.connector.connect(**config.myems_user_db)
                                  Severity: Minor
                                  Found in myems-api/reports/energystoragepowerstationlist.py - About 1 hr to fix

                                    Function on_get has 41 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/meterbatch.py - About 1 hr to fix

                                      Function on_post has 41 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/meter.py - About 1 hr to fix

                                        Function on_post has 41 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/energystoragecontainer.py - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language