Showing 5,781 of 10,536 total issues

Function StateService has 232 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    var StateService = /** @class */ (function () {
        /** @internal */
        function StateService(/** @internal */ router) {
            this.router = router;
            /** @internal */
Severity: Major
Found in myems-admin/js/ui-router/angular-ui-router.js - About 1 day to fix

    Function on_put has a Cognitive Complexity of 59 (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/virtualmeter.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 spacecarbon.py has 552 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/spacecarbon.py - About 1 day to fix

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

        Function $$AnimateJsProvider has 230 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var $$AnimateJsProvider = ['$animateProvider', /** @this */ function($animateProvider) {
          this.$get = ['$injector', '$$AnimateRunner', '$$jqLite',
               function($injector,   $$AnimateRunner,   $$jqLite) {
        
            var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);
        Severity: Major
        Found in myems-admin/js/angular/angular-animate.js - About 1 day to fix

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

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

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

                     function($injector,   $$AnimateRunner,   $$jqLite) {
              
                  var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);
                       // $animateJs(element, 'enter');
                  return function(element, event, classes, options) {
              Severity: Major
              Found in myems-admin/js/angular/angular-animate.js - About 1 day to fix

                File angular.integralui.checkbox.min.js has 544 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /*
                  filename: angular.integralui.checkbox.min.js
                  version : 1.4.5
                  Copyright � 2014-2018 Lidor Systems. All rights reserved.
                
                
                Severity: Major
                Found in myems-admin/js/jcui/angular.integralui.checkbox.min.js - About 1 day to fix

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

                    Function Dial has 225 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        k.Dial = function () {
                            k.o.call(this);
                    
                            this.startAngle = null;
                            this.xy = null;
                    Severity: Major
                    Found in myems-admin/js/plugins/jsKnob/jquery.knob.js - About 1 day to fix

                      File energystoragepowerstationdetails.py has 541 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

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

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

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

                          'use strict';
                          
                          app.controller('VirtualMeterController', function($scope, $rootScope, $window, $uibModal, $translate,
                              MeterService,
                              VirtualMeterService,
                          Severity: Major
                          Found in myems-admin/app/controllers/settings/meter/virtualmeter.controller.js - About 1 day to fix

                            Function aggregate_hourly_data_by_period has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
                            Open

                            def aggregate_hourly_data_by_period(rows_hourly, start_datetime_utc, end_datetime_utc, period_type):
                                # todo: validate parameters
                                if start_datetime_utc is None or \
                                        end_datetime_utc is None or \
                                        start_datetime_utc >= end_datetime_utc or \
                            Severity: Minor
                            Found in myems-api/core/utilities.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 57 (exceeds 5 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/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

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

                                def on_put(req, resp, id_, pid):
                                    """Handles PUT requests"""
                                    admin_control(req)
                                    try:
                                        raw_json = req.stream.read().decode('utf-8')
                            Severity: Minor
                            Found in myems-api/core/energystoragecontainer.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 57 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def on_post(req, resp, id_):
                                    """Handles POST requests"""
                                    admin_control(req)
                                    try:
                                        raw_json = req.stream.read().decode('utf-8')
                            Severity: Minor
                            Found in myems-api/core/energystoragecontainer.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 masks.js has 538 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            (function() {
                                'use strict';
                            
                                function maxValidator(ctrl, value, limit) {
                                    var max = parseFloat(limit);
                            Severity: Major
                            Found in myems-admin/js/plugins/uiMask/masks.js - About 1 day to fix

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

                                          link: function ($scope, elem, attrs, ngModel) {
                                              var
                                                  thisFormat = attrs.colorpicker ? attrs.colorpicker : 'hex',
                                                  position = angular.isDefined(attrs.colorpickerPosition) ? attrs.colorpickerPosition : 'bottom',
                                                  inline = angular.isDefined(attrs.colorpickerInline) ? attrs.colorpickerInline : false,
                              Severity: Major
                              Found in myems-admin/js/plugins/colorpicker/bootstrap-colorpicker-module.js - About 1 day to fix
                                Severity
                                Category
                                Status
                                Source
                                Language