Showing 5,781 of 10,536 total issues

Function fetchFireControlDetails has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const fetchFireControlDetails = () => {
    let url = APIBaseURL + '/reports/energystoragepowerstationdetails/' + selectedStation + '/firecontrol'
    console.log('fetchFireControlDetails with url:' + url);
    let isResponseOK = false;
    fetch(url, {

    Function UpdatedComponent has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      const UpdatedComponent = props => {
        // State
        const [bgProps, setBgProps] = useState(null);
    
        return (
    Severity: Minor
    Found in myems-web/src/hoc/withAuthSplit.js - About 1 hr to fix

      Function worker has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def worker(virtual_point):
          cnx_historical_db = None
          cursor_historical_db = None
      
          try:
      Severity: Minor
      Found in myems-normalization/virtualpoint.py - About 1 hr to fix

        Function fetchMetersDetails has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          const fetchMetersDetails = () => {
        
            let url = APIBaseURL + '/reports/energystoragepowerstationdetails/' + selectedStation + '/meter'
            console.log('fetchMetersDetails with url:' + url);
        
        

          Function fetchHVACDetails has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            const fetchHVACDetails = () => {
              let url = APIBaseURL + '/reports/energystoragepowerstationdetails/' + selectedStation + '/hvac'
              console.log('fetchHVACDetails with url:' + url);
              let isResponseOK = false;
              fetch(url, {

            Function on_get has 29 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/reports/energystoragepowerstationdetailshvac.py - About 1 hr to fix

              Function on_get has 29 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/reports/energystoragepowerstationdetailsfirecontrol.py - About 1 hr to fix

                Function on_get has 29 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/reports/energystoragepowerstationdetailsbms.py - About 1 hr to fix

                  Function on_get has 29 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/reports/energystoragepowerstationdetailspcs.py - About 1 hr to fix

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

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

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

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

                            Function on_put has 29 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/emailserver.py - About 1 hr to fix

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

                                Function $get has 9 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                       function($window,   $$jqLite,   $$AnimateRunner,   $timeout,   $$animateCache,
                                                $$forceReflow,   $sniffer,   $$rAFScheduler, $$animateQueue) {
                                Severity: Major
                                Found in myems-admin/js/angular/angular-animate.js - About 1 hr to fix

                                  Function addText has 9 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      Canvas.prototype.addText = function(layer, x, y, text, font, angle, width, halign, valign) {
                                  Severity: Major
                                  Found in myems-admin/js/plugins/flot/jquery.flot.js - About 1 hr to fix

                                    Function createTableTag has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        _this.createTableTag = function(cellSize, margin) {
                                    
                                          cellSize = cellSize || 2;
                                          margin = (typeof margin == 'undefined')? cellSize * 4 : margin;
                                    
                                    
                                    Severity: Minor
                                    Found in myems-admin/js/angular/qrcode.js - About 1 hr to fix

                                      Function ng1ViewsBuilder has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          function ng1ViewsBuilder(state) {
                                              // Do not process root state
                                              if (!state.parent)
                                                  return {};
                                              var tplKeys = ['templateProvider', 'templateUrl', 'template', 'notify', 'async'], ctrlKeys = ['controller', 'controllerProvider', 'controllerAs', 'resolveAs'], compKeys = ['component', 'bindings', 'componentProvider'], nonCompKeys = tplKeys.concat(ctrlKeys), allViewKeys = compKeys.concat(nonCompKeys);
                                      Severity: Minor
                                      Found in myems-admin/js/ui-router/angular-ui-router.js - About 1 hr to fix

                                        Function wrapResponse has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            function wrapResponse(wrapped) {
                                              if (!$browser && timeout) {
                                                if (timeout.then) {
                                                  timeout.then(function() {
                                                    handlePrematureEnd(angular.isDefined(timeout.$$timeoutId) ? 'timeout' : 'abort');
                                        Severity: Minor
                                        Found in myems-admin/js/angular/angular-mocks.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language