Showing 5,781 of 10,536 total issues

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

      function($rootScope, $location, $routeParams, $q, $injector, $templateRequest, $sce, $browser) {

    /**
     * @ngdoc service
     * @name $route
Severity: Major
Found in myems-admin/js/angular/angular-route.js - About 1 day to fix

    Function on_get has 220 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: Major
    Found in myems-api/reports/microgriddetails.py - About 1 day to fix

      Function on_post has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
      Open

          def on_post(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/energyflowdiagram.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 spaceproduction.py has 531 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/spaceproduction.py - About 1 day to fix

        File shopfloorload.py has 531 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/shopfloorload.py - About 1 day to fix

          File spaceload.py has 531 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/spaceload.py - About 1 day to fix

            File tenantload.py has 530 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/tenantload.py - About 1 day to fix

              File storeload.py has 530 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/storeload.py - About 1 day to fix

                File microgridreportingenergy.py has 527 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/microgridreportingenergy.py - About 1 day to fix

                  File microgridreportingrevenue.py has 527 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/microgridreportingrevenue.py - About 1 day to fix

                    File microgridreportingcarbon.py has 527 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/microgridreportingcarbon.py - About 1 day to fix

                      File spaceincome.py has 526 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/spaceincome.py - About 1 day to fix

                        File equipmentenergycategory.py has 526 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/equipmentenergycategory.py - About 1 day to fix

                          File jquery.flot.pie.js has 525 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          /* Flot plugin for rendering pie charts.
                          
                          Copyright (c) 2007-2014 IOLA and Ole Laursen.
                          Licensed under the MIT license.
                          
                          
                          Severity: Major
                          Found in myems-admin/js/plugins/flot/jquery.flot.pie.js - About 1 day to fix

                            Function on_put has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def on_put(req, resp, id_, pid):
                                    """Handles PUT 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/combinedequipment.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_put has a Cognitive Complexity of 55 (exceeds 5 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/space.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_put has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def on_put(req, resp, id_, pid):
                                    """Handles PUT 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/equipment.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 combinedequipmentincome.py has 522 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/combinedequipmentincome.py - About 1 day to fix

                              Function Display has 213 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              const Display = () => {
                                return (
                                  <Fragment>
                                    <PageHeader
                                      title="Display"
                              Severity: Major
                              Found in myems-web/src/components/utilities/Display.js - About 1 day to fix

                                File jquery.carousel.min.js has 520 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                (function(c) {
                                  function ga(z, s) {
                                    function m() {
                                      u = j.length;
                                      p = v * 2 / u;
                                Severity: Major
                                Found in myems-admin/js/jquery/jquery.carousel.min.js - About 1 day to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language