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/shopfloor_energy_input_category.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/shopfloor_energy_input_category.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_category.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        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(equipment['id']) + ","
                                        add_values += " " + str(energy_item_id) + ","
        Severity: Major
        Found in myems-aggregation/equipment_billing_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_category.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/combined_equipment_billing_output_category.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              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
              Severity: Major
              Found in myems-aggregation/virtual_meter_billing.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

                                      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/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_end_datetime_utc > max(energy_hourly.keys()):
                                                  common_end_datetime_utc = max(energy_hourly.keys())
                          
                          
                          Severity: Major
                          Found in myems-aggregation/combined_equipment_energy_input_category.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/combined_equipment_energy_input_category.py - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              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(store['id']) + ","
                                                              add_values += " " + str(energy_category_id) + ","
                              Severity: Major
                              Found in myems-aggregation/store_billing_input_category.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/combined_equipment_billing_input_item.py - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  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
                                  Severity: Major
                                  Found in myems-aggregation/energy_storage_power_station_carbon_discharge.py - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    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(combined_equipment['id']) + ","
                                                                    add_values += " " + str(energy_item_id) + ","
                                    Severity: Major
                                    Found in myems-aggregation/combined_equipment_billing_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/equipment_energy_output_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/shopfloor_carbon_input_category.py - About 45 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language