Showing 5,781 of 10,536 total issues

File angular-message-format.js has 697 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * @license AngularJS v1.8.3
 * (c) 2010-2020 Google LLC. http://angularjs.org
 * License: MIT
 */
Severity: Major
Found in myems-admin/js/angular/angular-message-format.js - About 1 day to fix

    Function $get has 317 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

           function($$jqLite,   $rootScope,   $injector,   $$AnimateRunner,   $$Map,   $$rAFScheduler, $$animateCache) {
    
        var animationQueue = [];
        var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);
    
    
    Severity: Major
    Found in myems-admin/js/angular/angular-animate.js - About 1 day to fix

      Function on_get has a Cognitive Complexity of 79 (exceeds 5 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/energystoragepowerstationitemenergy.py - About 1 day to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function on_get has a Cognitive Complexity of 79 (exceeds 5 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/energystoragepowerstationitemcarbon.py - About 1 day to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function on_get has a Cognitive Complexity of 79 (exceeds 5 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/energystoragepowerstationitembilling.py - About 1 day to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      File energystoragecontainerpowerconversionsystem.controller.js has 690 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      'use strict';
      
      app.controller('EnergyStorageContainerPowerconversionsystemController', function(
          $scope,
          $rootScope,

        File spaceefficiency.py has 688 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import re
        from datetime import datetime, timedelta, timezone
        from decimal import Decimal
        import falcon
        import mysql.connector
        Severity: Major
        Found in myems-api/reports/spaceefficiency.py - About 1 day to fix

          File spaceenergycategory.py has 677 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import re
          from datetime import datetime, timedelta, timezone
          from decimal import Decimal
          import falcon
          import mysql.connector
          Severity: Major
          Found in myems-api/reports/spaceenergycategory.py - About 1 day to fix

            File combinedequipmentstatistics.py has 676 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import base64
            from core.utilities import get_translation
            import os
            import re
            import uuid
            Severity: Major
            Found in myems-api/excelexporters/combinedequipmentstatistics.py - About 1 day to fix

              File ItemDashboard.js has 673 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import React, { Fragment, useEffect, useState, useContext } from 'react';
              import CountUp from 'react-countup';
              import {
                Button,
                ButtonGroup,

                Function EventManager has 303 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function EventManager(options, _sources) {
                        var t = this;
                
                
                        // exports
                Severity: Major
                Found in myems-admin/js/plugins/fullcalendar/fullcalendar.min.js - About 1 day to fix

                  File rule.py has 671 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import uuid
                  from datetime import datetime, timezone, timedelta
                  import falcon
                  import mysql.connector
                  import simplejson as json
                  Severity: Major
                  Found in myems-api/core/rule.py - About 1 day to fix

                    File combinedequipmentenergyitem.py has 667 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import base64
                    from core.utilities import get_translation
                    import os
                    import re
                    import uuid
                    Severity: Major
                    Found in myems-api/excelexporters/combinedequipmentenergyitem.py - About 1 day to fix

                      File webmessage.py has 667 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import re
                      from datetime import datetime, timedelta, timezone
                      import falcon
                      import mysql.connector
                      import simplejson as json
                      Severity: Major
                      Found in myems-api/core/webmessage.py - About 1 day to fix

                        File combinedequipmentenergycategory.py has 666 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        import re
                        from datetime import datetime, timedelta, timezone
                        from decimal import Decimal
                        import falcon
                        import mysql.connector
                        Severity: Major
                        Found in myems-api/reports/combinedequipmentenergycategory.py - About 1 day to fix

                          Function on_get has a Cognitive Complexity of 75 (exceeds 5 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/offlinemeterenergy.py - About 1 day to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Function $SanitizeProvider has 294 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function $SanitizeProvider() {
                            var hasBeenInstantiated = false;
                            var svgEnabled = false;
                          
                            this.$get = ['$$sanitizeUri', function($$sanitizeUri) {
                          Severity: Major
                          Found in myems-admin/js/angular/angular-sanitize.js - About 1 day to fix

                            File spaceoutput.py has 654 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import base64
                            from core.utilities import get_translation
                            import os
                            import re
                            import uuid
                            Severity: Major
                            Found in myems-api/excelexporters/spaceoutput.py - About 1 day to fix

                              Function slimScroll has 290 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  slimScroll: function(options) {
                              
                                    var defaults = {
                              
                                      // width in pixels of the visible scroll area
                              Severity: Major
                              Found in myems-admin/js/plugins/slimscroll/jquery.slimscroll.js - About 1 day to fix

                                File shopfloorsaving.py has 648 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                import re
                                from datetime import datetime, timedelta, timezone
                                from decimal import Decimal
                                import falcon
                                import mysql.connector
                                Severity: Major
                                Found in myems-api/reports/shopfloorsaving.py - About 1 day to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language