Showing 5,781 of 10,536 total issues

Avoid deeply nested control flow statements.
Open

                        if j < len(base_period_efficiency_values[i]) \
                                and reporting_period_efficiency_values[i][j] != 0 \
                                and base_period_efficiency_values[i][j] != 0 \
                                and reporting_period_efficiency_values[i][j] is not None \
                                and base_period_efficiency_values[i][j] is not None:
Severity: Major
Found in myems-api/reports/spaceefficiency.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            for row in rows:
                                current_datetime_local = row[0].replace(tzinfo=timezone.utc) + \
                                                         timedelta(minutes=timezone_offset)
                                current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S')
                                point_timestamps.append(current_datetime)
    Severity: Major
    Found in myems-api/reports/meterenergy.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              for row in rows:
                                  current_datetime_local = row[0].replace(tzinfo=timezone.utc) + \
                                                           timedelta(minutes=timezone_offset)
                                  current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S')
                                  point_timestamps.append(current_datetime)
      Severity: Major
      Found in myems-api/reports/shopfloorplan.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                for row in rows:
                                    current_datetime_local = row[0].replace(tzinfo=timezone.utc) + \
                                                             timedelta(minutes=timezone_offset)
                                    current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S')
                                    point_timestamps.append(current_datetime)
        Severity: Major
        Found in myems-api/reports/tenantload.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if row_datetime[0] + timedelta(minutes=10) > datetime.utcnow():
                                      is_online = True
          
          
          Severity: Major
          Found in myems-api/reports/microgriddashboard.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    while current_datetime_local < rows[index + 1][0].replace(tzinfo=timezone.utc) + \
                                            timedelta(minutes=timezone_offset):
                                        point_timestamps.append(current_datetime_local.strftime('%m-%d %H:%M'))
                                        point_values.append(rows[index][1])
                                        current_datetime_local += timedelta(minutes=1)
            Severity: Major
            Found in myems-api/reports/microgridreportingenergy.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      for row in rows:
                                          current_datetime_local = row[0].replace(tzinfo=timezone.utc) + \
                                                                   timedelta(minutes=timezone_offset)
                                          current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S')
                                          point_timestamps.append(current_datetime)
              Severity: Major
              Found in myems-api/reports/meterenergy.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        while current_datetime_local < rows[index + 1][0].replace(tzinfo=timezone.utc) + \
                                                timedelta(minutes=timezone_offset):
                                            point_timestamps.append(current_datetime_local.strftime('%m-%d %H:%M'))
                                            point_values.append(rows[index][1])
                                            current_datetime_local += timedelta(minutes=1)
                Severity: Major
                Found in myems-api/reports/energystoragepowerstationreportingenergy.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          while current_datetime_local < rows[index + 1][0].replace(tzinfo=timezone.utc) + \
                                                  timedelta(minutes=timezone_offset):
                                              point_timestamps.append(current_datetime_local.strftime('%m-%d %H:%M'))
                                              point_values.append(rows[index][1])
                                              current_datetime_local += timedelta(minutes=1)
                  Severity: Major
                  Found in myems-api/reports/microgridreportingrevenue.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            for row in rows:
                                                current_datetime_local = row[0].replace(tzinfo=timezone.utc) + \
                                                                         timedelta(minutes=timezone_offset)
                                                current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S')
                                                point_timestamps.append(current_datetime)
                    Severity: Major
                    Found in myems-api/reports/tenantcost.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              if analog_value_latest_dict.get(row_point[0]) is not None:
                                                  grid_power_point_value = analog_value_latest_dict.get(row_point[0])['actual_value']
                      
                                      # get load power point
                                      load_power_point_value = None
                      Severity: Major
                      Found in myems-api/reports/energystoragepowerstationlist.py - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                if analog_value_latest_dict.get(row_point[0]) is not None:
                                                    battery_soc_point_value = analog_value_latest_dict.get(row_point[0])['actual_value']
                                                    battery_power_point_value = analog_value_latest_dict.get(row_point[1])['actual_value']
                                        # get grid power point
                                        grid_power_point_value = None
                        Severity: Major
                        Found in myems-api/reports/energystoragepowerstationlist.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  for row in rows:
                                                      current_datetime_local = row[0].replace(tzinfo=timezone.utc) + \
                                                                               timedelta(minutes=timezone_offset)
                                                      current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S')
                                                      point_timestamps.append(current_datetime)
                          Severity: Major
                          Found in myems-api/reports/metercarbon.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                    for row in rows:
                                                        current_datetime_local = row[0].replace(tzinfo=timezone.utc) + \
                                                                                 timedelta(minutes=timezone_offset)
                                                        current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S')
                                                        point_timestamps.append(current_datetime)
                            Severity: Major
                            Found in myems-api/reports/meterenergy.py - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                      for row in rows:
                                                          current_datetime_local = row[0].replace(tzinfo=timezone.utc) + \
                                                                                   timedelta(minutes=timezone_offset)
                                                          current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S')
                                                          point_timestamps.append(current_datetime)
                              Severity: Major
                              Found in myems-api/reports/combinedequipmentenergycategory.py - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                        while current_datetime_local < rows[index + 1][0].replace(tzinfo=timezone.utc) + \
                                                                timedelta(minutes=timezone_offset):
                                                            point_timestamps.append(current_datetime_local.strftime('%m-%d %H:%M'))
                                                            point_values.append(rows[index][1])
                                                            current_datetime_local += timedelta(minutes=1)
                                Severity: Major
                                Found in myems-api/reports/energystoragepowerstationreportingparameters.py - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                          for row in rows:
                                                              current_datetime_local = row[0].replace(tzinfo=timezone.utc) + \
                                                                                       timedelta(minutes=timezone_offset)
                                                              current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S')
                                                              point_timestamps.append(current_datetime)
                                  Severity: Major
                                  Found in myems-api/reports/spaceefficiency.py - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                            for row in rows:
                                                                current_datetime_local = row[0].replace(tzinfo=timezone.utc) + \
                                                                                         timedelta(minutes=timezone_offset)
                                                                current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S')
                                                                point_timestamps.append(current_datetime)
                                    Severity: Major
                                    Found in myems-api/reports/tenantload.py - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                              for row in rows:
                                                                  current_datetime_local = row[0].replace(tzinfo=timezone.utc) + \
                                                                                           timedelta(minutes=timezone_offset)
                                                                  current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S')
                                                                  point_timestamps.append(current_datetime)
                                      Severity: Major
                                      Found in myems-api/reports/equipmentenergycategory.py - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                                for row in rows:
                                                                    current_datetime_local = row[0].replace(tzinfo=timezone.utc) + \
                                                                                             timedelta(minutes=timezone_offset)
                                                                    current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S')
                                                                    point_timestamps.append(current_datetime)
                                        Severity: Major
                                        Found in myems-api/reports/spaceefficiency.py - About 45 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language