Showing 5,781 of 10,536 total issues
Avoid deeply nested control flow statements. Open
Open
for energy_item_id in energy_item_list:
current_billing = billing_dict[current_datetime_utc].get(energy_item_id)
if current_billing is not None and isinstance(current_billing, Decimal):
add_values += " (" + str(space['id']) + ","
add_values += " " + str(energy_item_id) + ","
Avoid deeply nested control flow statements. Open
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]
Avoid deeply nested control flow statements. Open
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()):
Avoid deeply nested control flow statements. Open
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()):
Avoid deeply nested control flow statements. Open
Open
if current_factor is not None \
and isinstance(current_factor, Decimal) \
and current_energy is not None \
and isinstance(current_energy, Decimal):
aggregated_value['actual_value'] = current_energy * current_factor
Avoid deeply nested control flow statements. Open
Open
if current_datetime_utc not in energy_store_hourly[store_id]:
energy_store_hourly[store_id][current_datetime_utc] = dict()
energy_item_id = row_energy_value[1]
Avoid deeply nested control flow statements. Open
Open
if current_factor is not None \
and isinstance(current_factor, Decimal) \
and current_energy is not None \
and isinstance(current_energy, Decimal):
carbon_dict[current_datetime_utc] = current_energy * current_factor
Avoid deeply nested control flow statements. Open
Open
if common_end_datetime_utc > max(energy_hourly.keys()):
common_end_datetime_utc = max(energy_hourly.keys())
Avoid deeply nested control flow statements. Open
Open
if len(billing_dict[current_datetime_utc]) == 0:
del billing_dict[current_datetime_utc]
############################################################################################################
# Step 6: save billing data to billing database
Avoid deeply nested control flow statements. Open
Open
if common_end_datetime_utc > max(energy_hourly.keys()):
common_end_datetime_utc = max(energy_hourly.keys())
Avoid deeply nested control flow statements. Open
Open
for energy_category_id in energy_category_list:
current_billing = billing_dict[current_datetime_utc].get(energy_category_id)
if current_billing is not None and isinstance(current_billing, Decimal):
add_values += " (" + str(shopfloor['id']) + ","
add_values += " " + str(energy_category_id) + ","
Avoid deeply nested control flow statements. Open
Open
if current_factor is not None \
and isinstance(current_factor, Decimal) \
and current_energy is not None \
and isinstance(current_energy, Decimal):
carbon_dict[current_datetime_utc] = current_energy * current_factor
Avoid deeply nested control flow statements. Open
Open
if common_end_datetime_utc > max(energy_hourly.keys()):
common_end_datetime_utc = max(energy_hourly.keys())
Avoid deeply nested control flow statements. Open
Open
if current_tariff is not None \
and isinstance(current_tariff, Decimal) \
and current_energy is not None \
and isinstance(current_energy, Decimal):
aggregated_value['actual_value'] = current_energy * current_tariff
Avoid deeply nested control flow statements. Open
Open
if current_carbon is not None and isinstance(current_carbon, Decimal):
add_values += " (" + str(energy_storage_power_station['id']) + ","
add_values += "'" + current_datetime_utc.isoformat()[0:19] + "',"
add_values += str(current_carbon) + "), "
Avoid deeply nested control flow statements. Open
Open
for energy_item_id in energy_item_list:
current_tariff = tariff_dict[energy_item_id].get(current_datetime_utc)
current_energy = energy_dict[current_datetime_utc].get(energy_item_id)
if current_tariff is not None \
and isinstance(current_tariff, Decimal) \
Avoid deeply nested control flow statements. Open
Open
if common_end_datetime_utc > max(energy_hourly.keys()):
common_end_datetime_utc = max(energy_hourly.keys())
Avoid deeply nested control flow statements. Open
Open
if current_factor is not None \
and isinstance(current_factor, Decimal) \
and current_energy is not None \
and isinstance(current_energy, Decimal):
aggregated_value['actual_value'] = current_energy * current_factor
Avoid deeply nested control flow statements. Open
Open
for energy_item_id in energy_item_list:
current_billing = billing_dict[current_datetime_utc].get(energy_item_id)
if current_billing is not None and isinstance(current_billing, Decimal):
add_values += " (" + str(shopfloor['id']) + ","
add_values += " " + str(energy_item_id) + ","
Avoid deeply nested control flow statements. Open
Open
if current_datetime_utc not in energy_shopfloor_hourly[shopfloor_id]:
energy_shopfloor_hourly[shopfloor_id][current_datetime_utc] = dict()
energy_item_id = row_energy_value[1]