def number_of_plugins_per_risk_factor(report_host, risk_factor_level):
    """
    Function returns number of all plugins reported during scan for given risk factor for given target.
    :param report_host: report host element
    :param risk_factor_level:
        'Critical'
        'High'
        'Medium'
        'Low'
        'None'
    :return: number of plugins for given risk factor
    """
    risk_factor_counter = 0
    for report_item in report_host.findall('ReportItem'):
        risk_factor = report_item.find('risk_factor')
        if risk_factor is not None:
            if risk_factor.text == risk_factor_level:
                risk_factor_counter += 1
    return risk_factor_counter
