Showing 5,781 of 10,536 total issues
Avoid deeply nested control flow statements. Open
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)
Avoid deeply nested control flow statements. Open
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)
Avoid deeply nested control flow statements. Open
Open
if point_value['is_trend']:
add_values += " (" + str(point_value['point_id']) + ","
add_values += "'" + current_datetime_utc.isoformat() + "',"
add_values += str(point_value['value']) + "), "
trend_value_count += 1
Avoid deeply nested control flow statements. Open
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)
Avoid deeply nested control flow statements. Open
Open
if digital_value_latest_dict.get(row_point[0]) is not None:
pcs_run_state_point_value = digital_value_latest_dict.get(row_point[0])['actual_value']
# 0: 初始上电, Initial power on
# 1: 待机, Standby
Avoid deeply nested control flow statements. Open
Open
for energy_category_id, actual_value in meta_data_dict.items():
aggregated_value['meta_data'][energy_category_id] = \
aggregated_value['meta_data'].get(energy_category_id, Decimal(0.0)) + actual_value
Avoid deeply nested control flow statements. Open
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)
Avoid deeply nested control flow statements. Open
Open
if analog_value_latest_dict.get(row_point[0]) is not None:
photovoltaic_power_point_value = analog_value_latest_dict.get(row_point[0])['actual_value']
# get grid power point
grid_power_point_value = None
Avoid deeply nested control flow statements. Open
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)
Avoid deeply nested control flow statements. Open
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')
energy_value_data['timestamps'].append(current_datetime)
Avoid deeply nested control flow statements. Open
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)
Avoid deeply nested control flow statements. Open
Open
if current_datetime_utc not in energy_child_space_hourly[child_space_id]:
energy_child_space_hourly[child_space_id][current_datetime_utc] = dict()
energy_category_id = row_energy_value[1]
Avoid deeply nested control flow statements. Open
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)
Avoid deeply nested control flow statements. Open
Open
if row_datetime[0] + timedelta(minutes=10) > datetime.utcnow():
is_online = True
# get PCS run state point
pcs_run_state_point_value = None
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 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)
Avoid deeply nested control flow statements. Open
Open
if point_value['is_trend']:
add_values += " (" + str(point_value['point_id']) + ","
add_values += "'" + current_datetime_utc.isoformat() + "',"
add_values += str(point_value['value']) + "), "
trend_value_count += 1
Avoid deeply nested control flow statements. Open
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)
Avoid deeply nested control flow statements. Open
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)
Avoid deeply nested control flow statements. Open
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)