Showing 5,781 of 10,536 total issues

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

    def on_get(req, resp, id_, gid):
        access_control(req)
        if not id_.isdigit() or int(id_) <= 0:
            raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                                   description='API.INVALID_MICROGRID_ID')
Severity: Minor
Found in myems-api/core/microgrid.py - About 1 hr to fix

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

        def on_get(req, resp, id_, eid):
            access_control(req)
            if not id_.isdigit() or int(id_) <= 0:
                raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                                       description='API.INVALID_MICROGRID_ID')
    Severity: Minor
    Found in myems-api/core/microgrid.py - About 1 hr to fix

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

          def on_get(req, resp, id_):
              access_control(req)
              if not id_.isdigit() or int(id_) <= 0:
                  raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                                         description='API.INVALID_WIND_FARM_ID')
      Severity: Minor
      Found in myems-api/core/windfarm.py - About 1 hr to fix

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

            def on_get(req, resp):
                access_control(req)
                cnx = mysql.connector.connect(**config.myems_system_db)
                cursor = cnx.cursor()
        
        
        Severity: Minor
        Found in myems-api/core/microgrid.py - About 1 hr to fix

          Function on_put has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def on_put(req, resp, id_, sid):
                  """Handles PUT 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_get has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def on_get(req, resp, id_, bid):
                    access_control(req)
                    if not id_.isdigit() or int(id_) <= 0:
                        raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                                               description='API.INVALID_MICROGRID_ID')
            Severity: Minor
            Found in myems-api/core/microgrid.py - About 1 hr to fix

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

                  def on_get(req, resp, id_):
                      access_control(req)
                      if not id_.isdigit() or int(id_) <= 0:
                          raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                                                 description='API.INVALID_MICROGRID_ID')
              Severity: Minor
              Found in myems-api/core/microgrid.py - About 1 hr to fix

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

                    def on_get(req, resp, id_, pid):
                        access_control(req)
                        if not id_.isdigit() or int(id_) <= 0:
                            raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                                                   description='API.INVALID_MICROGRID_ID')
                Severity: Minor
                Found in myems-api/core/microgrid.py - About 1 hr to fix

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

                      def on_get(req, resp, id_):
                          access_control(req)
                          if not id_.isdigit() or int(id_) <= 0:
                              raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                                                     description='API.INVALID_WIND_FARM_ID')
                  Severity: Minor
                  Found in myems-api/core/windfarm.py - About 1 hr to fix

                    Function on_put has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

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

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

                          def on_get(req, resp):
                              access_control(req)
                              cnx = mysql.connector.connect(**config.myems_system_db)
                              cursor = cnx.cursor()
                      
                      
                      Severity: Minor
                      Found in myems-api/core/windfarm.py - About 1 hr to fix

                        Function on_delete has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            def on_delete(req, resp, id_):
                                admin_control(req)
                                if not id_.isdigit() or int(id_) <= 0:
                                    raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                                                           description='API.INVALID_ENERGY_CATEGORY_ID')
                        Severity: Minor
                        Found in myems-api/core/energycategory.py - About 1 hr to fix

                          Function on_get has 26 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/core/virtualmeter.py - About 1 hr to fix

                            Function on_get has 26 lines of code (exceeds 25 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

                              Function on_get has 26 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/core/store.py - About 1 hr to fix

                                Function on_get has 26 lines of code (exceeds 25 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

                                  Function _defineEvent has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                          TransitionService.prototype._defineEvent = function (name, hookPhase, hookOrder, criteriaMatchPath, reverseSort, getResultHandler, getErrorHandler, synchronous) {
                                  Severity: Major
                                  Found in myems-admin/js/ui-router/angular-ui-router.js - About 1 hr to fix

                                    Consider simplifying this complex logical expression.
                                    Open

                                              if (qrcode.isDark(row, col)
                                                  && !qrcode.isDark(row, col + 1)
                                                  &&  qrcode.isDark(row, col + 2)
                                                  &&  qrcode.isDark(row, col + 3)
                                                  &&  qrcode.isDark(row, col + 4)
                                    Severity: Major
                                    Found in myems-admin/js/angular/qrcode.js - About 1 hr to fix

                                      Function TransitionEventType has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                              function TransitionEventType(name, hookPhase, hookOrder, criteriaMatchPath, reverseSort, getResultHandler, getErrorHandler, synchronous) {
                                      Severity: Major
                                      Found in myems-admin/js/ui-router/angular-ui-router.js - About 1 hr to fix

                                        Consider simplifying this complex logical expression.
                                        Open

                                                  if (qrcode.isDark(row, col)
                                                      && !qrcode.isDark(row + 1, col)
                                                      &&  qrcode.isDark(row + 2, col)
                                                      &&  qrcode.isDark(row + 3, col)
                                                      &&  qrcode.isDark(row + 4, col)
                                        Severity: Major
                                        Found in myems-admin/js/angular/qrcode.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language