def METHOD_NAME(
        scan_results: typing.Iterable[model.ScanResult],
        routes: checkmarx.client.CheckmarxRoutes,
        tablefmt: str = 'simple',
):
    def artifact_name(scan_result: model.ScanResult):
        if tablefmt == 'html':
            return f'''
            <a href="{routes.web_ui_scan_history(scan_id=scan_result.scan_response.id)}">
                {scan_result.artifact_name}
            </a>
            '''
        else:
            return scan_result.artifact_name
    def scan_severity(scan_result: model.ScanResult):
        if tablefmt == 'html':
            scan_id = scan_result.scan_response.id
            project_id = scan_result.project_id
            return f'''
            <a href="{routes.web_ui_scan_viewer(scan_id=scan_id, project_id=project_id)}">
                {scan_result.scan_response.scanRiskSeverity}
            </a>
            '''
        else:
            return scan_result.scan_response.scanRiskSeverity
    scan_statistics_header = (
        'Artifact Name',
        'Artifact Version',
        'Overall Severity',
        'High',
        'Medium',
        'Low',
        'Info',
    )
    scan_statistics_data = [
        (
            artifact_name(scan_result),
            scan_result.scanned_element.source.version,
            scan_severity(scan_result),
            scan_result.scan_statistic.highSeverity,
            scan_result.scan_statistic.mediumSeverity,
            scan_result.scan_statistic.lowSeverity,
            scan_result.scan_statistic.infoSeverity,
        ) for scan_result in scan_results
    ]
    # monkeypatch: disable html escaping
    tabulate.htmlescape = lambda x: x
    scan_statistics = tabulate.tabulate(
        headers=scan_statistics_header,
        tabular_data=sorted(scan_statistics_data, key=lambda x: x[1], reverse=True),
        tablefmt=tablefmt,
        colalign=('left', 'center', 'center', 'center', 'center', 'center')
    )
    return scan_statistics