Showing 5,781 of 10,536 total issues

Avoid deeply nested control flow statements.
Open

                    if common_start_datetime_utc < min(energy_hourly.keys()):
                        common_start_datetime_utc = min(energy_hourly.keys())
                    if common_end_datetime_utc > max(energy_hourly.keys()):
Severity: Major
Found in myems-aggregation/tenant_energy_input_item.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                        if len(billing_dict[current_datetime_utc]) == 0:
                            del billing_dict[current_datetime_utc]
    
                ############################################################################################################
                # Step 6: save billing data to billing database
    Severity: Major
    Found in myems-aggregation/space_billing_input_item.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                          if common_end_datetime_utc > max(energy_hourly.keys()):
                              common_end_datetime_utc = max(energy_hourly.keys())
      
      
      Severity: Major
      Found in myems-aggregation/tenant_energy_input_item.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            if common_start_datetime_utc < min(energy_hourly.keys()):
                                common_start_datetime_utc = min(energy_hourly.keys())
                            if common_end_datetime_utc > max(energy_hourly.keys()):
        Severity: Major
        Found in myems-aggregation/energy_storage_power_station_energy_charge.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              if common_end_datetime_utc > max(energy_hourly.keys()):
                                  common_end_datetime_utc = max(energy_hourly.keys())
          
          
          Severity: Major
          Found in myems-aggregation/energy_storage_power_station_energy_charge.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                if common_start_datetime_utc < min(energy_hourly.keys()):
                                    common_start_datetime_utc = min(energy_hourly.keys())
                                if common_end_datetime_utc > max(energy_hourly.keys()):
            Severity: Major
            Found in myems-aggregation/shopfloor_energy_input_item.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                  if common_start_datetime_utc < min(energy_hourly.keys()):
                                      common_start_datetime_utc = min(energy_hourly.keys())
                                  if common_end_datetime_utc > max(energy_hourly.keys()):
              Severity: Major
              Found in myems-aggregation/space_energy_input_item.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                    if common_start_datetime_utc < min(energy_hourly.keys()):
                                        common_start_datetime_utc = min(energy_hourly.keys())
                                    if common_end_datetime_utc > max(energy_hourly.keys()):
                Severity: Major
                Found in myems-aggregation/space_energy_input_item.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                      if common_end_datetime_utc > max(energy_hourly.keys()):
                                          common_end_datetime_utc = max(energy_hourly.keys())
                  
                  
                  Severity: Major
                  Found in myems-aggregation/space_energy_input_item.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            for energy_item_id, actual_value in meta_data_dict.items():
                                                aggregated_value['meta_data'][energy_item_id] = \
                                                    aggregated_value['meta_data'].get(energy_item_id, Decimal(0.0)) + actual_value
                    
                    
                    Severity: Major
                    Found in myems-aggregation/space_energy_input_item.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              for energy_item_id, actual_value in meta_data_dict.items():
                                                  aggregated_value['meta_data'][energy_item_id] = \
                                                      aggregated_value['meta_data'].get(energy_item_id, Decimal(0.0)) + actual_value
                      
                      
                      Severity: Major
                      Found in myems-aggregation/space_energy_input_item.py - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                for energy_category_id in energy_category_list:
                                                    current_carbon = carbon_dict[current_datetime_utc].get(energy_category_id)
                                                    if current_carbon is not None and isinstance(current_carbon, Decimal):
                                                        add_values += " (" + str(equipment['id']) + ","
                                                        add_values += " " + str(energy_category_id) + ","
                        Severity: Major
                        Found in myems-aggregation/equipment_carbon_input_category.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  if current_datetime_utc not in energy_equipment_hourly[equipment_id]:
                                                      energy_equipment_hourly[equipment_id][current_datetime_utc] = dict()
                                                  energy_item_id = row_value[1]
                          Severity: Major
                          Found in myems-aggregation/combined_equipment_energy_input_item.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                    if current_carbon is not None and isinstance(current_carbon, Decimal):
                                                        add_values += " (" + str(microgrid['id']) + ","
                                                        add_values += "'" + current_datetime_utc.isoformat()[0:19] + "',"
                                                        add_values += str(current_carbon) + "), "
                            
                            
                            Severity: Major
                            Found in myems-aggregation/microgrid_carbon_charge.py - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                      if current_datetime_utc not in energy_combined_equipment_hourly[combined_equipment_id]:
                                                          energy_combined_equipment_hourly[combined_equipment_id][current_datetime_utc] = dict()
                                                      energy_category_id = row_value[1]
                              Severity: Major
                              Found in myems-aggregation/space_energy_input_category.py - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                        if current_datetime_utc not in energy_equipment_hourly[equipment_id]:
                                                            energy_equipment_hourly[equipment_id][current_datetime_utc] = dict()
                                                        energy_category_id = row_value[1]
                                Severity: Major
                                Found in myems-aggregation/space_energy_input_category.py - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                      if len(carbon_dict[current_datetime_utc]) == 0:
                                                          del carbon_dict[current_datetime_utc]
                                  
                                              ############################################################################################################
                                              # Step 6: save carbon dioxide emissions data to database
                                  Severity: Major
                                  Found in myems-aggregation/equipment_carbon_input_category.py - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                            for energy_item_id, actual_value in meta_data_dict.items():
                                                                aggregated_value['meta_data'][energy_item_id] = \
                                                                    aggregated_value['meta_data'].get(energy_item_id, Decimal(0.0)) + actual_value
                                    
                                    
                                    Severity: Major
                                    Found in myems-aggregation/combined_equipment_energy_input_item.py - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                          if common_start_datetime_utc < min(energy_hourly.keys()):
                                                              common_start_datetime_utc = min(energy_hourly.keys())
                                                          if common_end_datetime_utc > max(energy_hourly.keys()):
                                      Severity: Major
                                      Found in myems-aggregation/store_energy_input_item.py - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                            if common_start_datetime_utc < min(energy_hourly.keys()):
                                                                common_start_datetime_utc = min(energy_hourly.keys())
                                                            if common_end_datetime_utc > max(energy_hourly.keys()):
                                        Severity: Major
                                        Found in myems-aggregation/space_energy_input_category.py - About 45 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language