Showing 5,781 of 10,536 total issues

Function link has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        link: function(scope, elem, attrs) {
            // 生成随机字符串作为验证码
            function generateCode() {
            var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
            var codeLength = 5;
Severity: Minor
Found in myems-admin/app/directives/directives.js - About 1 hr to fix

    Function QuillEditorExample has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const QuillEditorExample = () => {
      return (
        <Fragment>
          <PageHeader
            title="WYSIWYG Editor"
    Severity: Minor
    Found in myems-web/src/components/plugins/Quill.js - About 1 hr to fix

      Function Inbox has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const Inbox = () => {
        // Hook
        const { data: paginationData, meta: paginationMeta, handler: paginationHandler } = usePagination(emailIds, 10);
        const {
          selectedItems,
      Severity: Minor
      Found in myems-web/src/components/email/Inbox.js - About 1 hr to fix

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

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

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

              Function on_get has 27 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_ENERGY_STORAGE_CONTAINER_ID')
              Severity: Minor
              Found in myems-api/core/energystoragecontainer.py - About 1 hr to fix

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

                    def on_get(req, resp, id_, lid):
                        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_ENERGY_STORAGE_CONTAINER_ID')
                Severity: Minor
                Found in myems-api/core/energystoragecontainer.py - About 1 hr to fix

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

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

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

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

                        Function on_post has 27 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_delete has 27 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_USER_ID')
                          Severity: Minor
                          Found in myems-api/core/user.py - About 1 hr to fix

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

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

                                      TemplateFactory.prototype.makeComponentTemplate = function (uiView, context, component, bindings) {
                                          bindings = bindings || {};
                                          // Bind once prefix
                                          var prefix = ng.version.minor >= 3 ? '::' : '';
                                          // Convert to kebob name. Add x- prefix if the string starts with `x-` or `data-`
                              Severity: Minor
                              Found in myems-admin/js/ui-router/angular-ui-router.js - About 1 hr to fix

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

                                  function serialize(object) {
                                    var out;
                                
                                    if (angular.isElement(object)) {
                                      object = angular.element(object);
                                Severity: Minor
                                Found in myems-admin/js/angular/angular-mocks.js - About 1 hr to fix

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

                                  angular.mock.$ExceptionHandlerProvider = function() {
                                    var handler;
                                  
                                    /**
                                     * @ngdoc method
                                  Severity: Minor
                                  Found in myems-admin/js/angular/angular-mocks.js - About 1 hr to fix

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

                                        compile: function(elem, attr) {
                                          if (attr.hasOwnProperty(ARIA_DISABLE_ATTR)) return;
                                    
                                          var fn = $parse(attr.ngClick);
                                          return function(scope, elem, attr) {
                                    Severity: Minor
                                    Found in myems-admin/js/angular/angular-aria.js - About 1 hr to fix

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

                                          function split_meta_hash( meta_string ) {
                                              var meta = meta_string.split( "" ),
                                                  parts = [ "" ],
                                                  in_quotes = false;
                                      
                                      
                                      Severity: Minor
                                      Found in myems-admin/js/plugins/bootstrap-markdown/markdown.js - About 1 hr to fix

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

                                                function drawSeriesBars(series) {
                                                    function plotBars(datapoints, barLeft, barRight, fillStyleCallback, axisx, axisy) {
                                                        var points = datapoints.points, ps = datapoints.pointsize;
                                        
                                                        for (var i = 0; i < points.length; i += ps) {
                                        Severity: Minor
                                        Found in myems-admin/js/plugins/flot/jquery.flot.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language