Showing 5,781 of 10,536 total issues

Function QRUtil has 211 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  var QRUtil = function() {

    var PATTERN_POSITION_TABLE = [
      [],
      [6, 18],
Severity: Major
Found in myems-admin/js/angular/qrcode.js - About 1 day to fix

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

                        link: function(scope, element, attrs, ngModel) {
                            var savedNodes;
    
                            function combineCallbacks(first,second){
                                if(second && (typeof second === 'function')) {
    Severity: Major
    Found in myems-admin/js/plugins/ui-sortable/sortable.js - About 1 day to fix

      Function on_post has a Cognitive Complexity of 54 (exceeds 5 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/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_post has a Cognitive Complexity of 54 (exceeds 5 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/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 googleMapStyles.js has 517 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      export default {
        Default: [
          {
            featureType: 'water',
            elementType: 'geometry',
      Severity: Major
      Found in myems-web/src/helpers/googleMapStyles.js - About 1 day to fix

        Consider simplifying this complex logical expression.
        Open

                      if (b) {
                        b.bind("dragstart", function(b) {
                          var c = a.getItemFromChildElem(this);
                          if (c && a.isItemEnabled(c))
                            if (((c = angular.element(this)), a.labelEditStatus()))
        Severity: Critical
        Found in myems-admin/js/jcui/angular.integralui.treeview.min.js - About 1 day to fix

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

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

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

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

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

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

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

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

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

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

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

                                Function createHttpBackendMock has 204 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
                                  var definitions = [],
                                      expectations = [],
                                      matchLatestDefinition = false,
                                      responses = [],
                                Severity: Major
                                Found in myems-admin/js/angular/angular-mocks.js - About 1 day to fix

                                  Function ClockPicker has 203 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      function ClockPicker(element, options) {
                                          var popover = $(tpl),
                                              plate = popover.find('.clockpicker-plate'),
                                              hoursView = popover.find('.clockpicker-hours'),
                                              minutesView = popover.find('.clockpicker-minutes'),
                                  Severity: Major
                                  Found in myems-admin/js/plugins/clockpicker/clockpicker.js - About 1 day to fix

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