Showing 5,781 of 10,536 total issues

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

    File tariff.py has 646 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

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

      Function Transition has 287 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          var Transition = /** @class */ (function () {
              /**
               * Creates a new Transition object.
               *
               * If the target state is not valid, an error is thrown.
      Severity: Major
      Found in myems-admin/js/ui-router/angular-ui-router.js - About 1 day to fix

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

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

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

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

                Function on_get has a Cognitive Complexity of 72 (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/combinedequipmentbatch.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 72 (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/tenantbatch.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 72 (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/equipmentbatch.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 72 (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/storebatch.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 72 (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/meterbatch.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 72 (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/shopfloorbatch.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 i has 285 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function i(i, o, n) {
                        var r = this;
                        r.id = n, r.table = i, r.options = o, r.breakpoints = [], r.breakpointNames = "", r.columns = {}, r.plugins = t.footable.plugins.load(r);
                        var l = r.options,
                            d = l.classes,
                Severity: Major
                Found in myems-admin/js/plugins/footable/footable.all.min.js - About 1 day to fix

                  Function $RouteProvider has 283 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function $RouteProvider() {
                    isArray = angular.isArray;
                    isObject = angular.isObject;
                    isDefined = angular.isDefined;
                    noop = angular.noop;
                  Severity: Major
                  Found in myems-admin/js/angular/angular-route.js - About 1 day to fix

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

                      Function on_get has a Cognitive Complexity of 71 (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/meterrealtime.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 UrlMatcher has 280 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          var UrlMatcher = /** @class */ (function () {
                              /**
                               * @param pattern The pattern to compile into a matcher.
                               * @param paramTypes The [[ParamTypes]] registry
                               * @param paramFactory A [[ParamFactory]] object
                      Severity: Major
                      Found in myems-admin/js/ui-router/angular-ui-router.js - About 1 day to fix

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

                          File tenantenergyitem.py has 633 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/tenantenergyitem.py - About 1 day to fix
                            Severity
                            Category
                            Status
                            Source
                            Language