Showing 5,781 of 10,536 total issues

Consider simplifying this complex logical expression.
Open

    if "non_working_days_subtotals" not in report['base_period'].keys() or \
            report['base_period']['non_working_days_subtotals'] is None or \
            len(report['base_period']['non_working_days_subtotals']) == 0 or \
            "working_days_subtotals" not in report['base_period'].keys() or \
            report['base_period']['working_days_subtotals'] is None or \
Severity: Critical
Found in myems-api/excelexporters/spaceenergycategory.py - About 2 hrs to fix

    Function generate_excel has 50 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def generate_excel(report,
                       name,
                       base_period_start_datetime_local,
                       base_period_end_datetime_local,
                       reporting_start_datetime_local,
    Severity: Minor
    Found in myems-api/excelexporters/combinedequipmentenergycategory.py - About 2 hrs to fix

      Function generate_excel has 50 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def generate_excel(report,
                         name,
                         base_period_start_datetime_local,
                         base_period_end_datetime_local,
                         reporting_start_datetime_local,
      Severity: Minor
      Found in myems-api/excelexporters/combinedequipmentcarbon.py - About 2 hrs to fix

        Consider simplifying this complex logical expression.
        Open

            if "non_working_days_subtotals" not in report['base_period'].keys() or \
                    report['base_period']['non_working_days_subtotals'] is None or \
                    len(report['base_period']['non_working_days_subtotals']) == 0 or \
                    "working_days_subtotals" not in report['base_period'].keys() or \
                    report['base_period']['working_days_subtotals'] is None or \
        Severity: Critical
        Found in myems-api/excelexporters/shopfloorenergycategory.py - About 2 hrs to fix

          Consider simplifying this complex logical expression.
          Open

              if "non_working_days_subtotals" not in report['base_period'].keys() or \
                      report['base_period']['non_working_days_subtotals'] is None or \
                      len(report['base_period']['non_working_days_subtotals']) == 0 or \
                      "working_days_subtotals" not in report['base_period'].keys() or \
                      report['base_period']['working_days_subtotals'] is None or \
          Severity: Critical
          Found in myems-api/excelexporters/storeenergycategory.py - About 2 hrs to fix

            Consider simplifying this complex logical expression.
            Open

                if "non_working_days_subtotals" not in report['base_period'].keys() or \
                        report['base_period']['non_working_days_subtotals'] is None or \
                        len(report['base_period']['non_working_days_subtotals']) == 0 or \
                        "working_days_subtotals" not in report['base_period'].keys() or \
                        report['base_period']['working_days_subtotals'] is None or \
            Severity: Critical
            Found in myems-api/excelexporters/tenantenergycategory.py - About 2 hrs to fix

              Function generate_excel has 50 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              def generate_excel(report,
                                 name,
                                 base_period_start_datetime_local,
                                 base_period_end_datetime_local,
                                 reporting_start_datetime_local,
              Severity: Minor
              Found in myems-api/excelexporters/combinedequipmentcost.py - About 2 hrs to fix

                Function on_post has 50 lines of code (exceeds 25 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/energystoragepowerstation.py - About 2 hrs to fix

                  Function on_post has 50 lines of code (exceeds 25 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/store.py - About 2 hrs to fix

                    Function ArrayType has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function ArrayType(type, mode) {
                            var _this = this;
                            // Wrap non-array value as array
                            function arrayWrap(val) {
                                return isArray(val) ? val : isDefined(val) ? [val] : [];
                    Severity: Minor
                    Found in myems-admin/js/ui-router/angular-ui-router.js - About 1 hr to fix

                      Function base64EncodeOutputStream has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        var base64EncodeOutputStream = function() {
                      
                          var _buffer = 0;
                          var _buflen = 0;
                          var _length = 0;
                      Severity: Minor
                      Found in myems-admin/js/angular/qrcode.js - About 1 hr to fix

                        Function Rejection has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            var Rejection = /** @class */ (function () {
                                function Rejection(type, message, detail) {
                                    /** @internal */
                                    this.$id = id++;
                                    this.type = type;
                        Severity: Minor
                        Found in myems-admin/js/ui-router/angular-ui-router.js - About 1 hr to fix

                          Function __buildButtons has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            , __buildButtons: function(buttonsArray, container) {
                                var i,
                                    ns = this.$ns,
                                    handler = this.$handler,
                                    callback = this.$callback;
                          Severity: Minor
                          Found in myems-admin/js/plugins/bootstrap-markdown/bootstrap-markdown.js - About 1 hr to fix

                            Function buildDayTableBodyHTML has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    function buildDayTableBodyHTML() {
                                        var headerClass = tm + "-widget-header"; // TODO: make these when updateOptions() called
                                        var contentClass = tm + "-widget-content";
                                        var date;
                                        var today = clearTime(new Date());
                            Severity: Minor
                            Found in myems-admin/js/plugins/fullcalendar/fullcalendar.min.js - About 1 hr to fix

                              Function drawLabels has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                              function drawLabels() {
                              
                                                  var currentAngle = startAngle;
                                                  var radius = options.series.pie.label.radius > 1 ? options.series.pie.label.radius : maxRadius * options.series.pie.label.radius;
                              
                              
                              Severity: Minor
                              Found in myems-admin/js/plugins/flot/jquery.flot.pie.js - About 1 hr to fix

                                Function setFocus has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  setFocus: function(config){
                                    var bbox,
                                        itemBbox,
                                        newBbox,
                                        codes,
                                Severity: Minor
                                Found in myems-admin/js/plugins/jvectormap/jquery-jvectormap-2.0.2.min.js - About 1 hr to fix

                                  Function drop has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                        this.drop = function(a) {
                                          if (a && a.sourceCtrl) {
                                            a.sourceCtrl.suppressProcess = !0;
                                            a.sourceCtrl.suspendLayout();
                                            b.suspendLayout();
                                  Severity: Minor
                                  Found in myems-admin/js/jcui/angular.integralui.treeview.min.js - About 1 hr to fix

                                    Function editSpace has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        $scope.editSpace = function (space) {
                                            var modalInstance = $uibModal.open({
                                                windowClass: "animated fadeIn",
                                                templateUrl: 'views/settings/space/space.model.html',
                                                controller: 'ModalEditSpaceCtrl',
                                    Severity: Minor
                                    Found in myems-admin/app/controllers/settings/space/space.controller.js - About 1 hr to fix

                                      Function addVirtualMeter has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          $scope.addVirtualMeter = function() {
                                              var modalInstance = $uibModal.open({
                                                  templateUrl: 'views/settings/meter/virtualmeter.model.html',
                                                  controller: 'ModalAddVirtualMeterCtrl',
                                                  windowClass: 'animated fadeIn',

                                        Function saveChange has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                          const saveChange = async (oldValue, newValue, row, column) => {
                                            let isResponseOK = false;
                                            if (newValue == null || newValue === '' || newValue < 0 || oldValue === newValue) {
                                              row.daily_value = oldValue;
                                              return;
                                        Severity: Minor
                                        Found in myems-web/src/components/MyEMS/Space/EnterProduction.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language