def find_infractions(args, logger, results):
    infractions = 0
    module_averages = []
    total_cc = 0.
    total_blocks = 0
    for module, blocks in results.items():
        module_cc = 0.
        if isinstance(blocks, dict) and blocks.get('error'):
            logger.warning('cannot parse %s: %s', module, blocks['error'])
            continue
        for block in blocks:
            module_cc += block['complexity']
            r = cc_rank(block['complexity'])
            if check(r, args.absolute):
                logger.error('block "%s:%s %s" has a rank of %s', module,
                             block['lineno'], block['name'], r)
                infractions += 1
        module_averages.append((module, av(module_cc, len(blocks))))
        total_cc += module_cc
        total_blocks += len(blocks)

    ar = cc_rank(av(total_cc, total_blocks))
    if check(ar, args.average):
        logger.error('average complexity is ranked %s', ar)
        infractions += 1
    for module, ma in module_averages:
        mar = cc_rank(ma)
        if check(mar, args.modules):
            logger.error('module %r has a rank of %s', module, mar)
            infractions += 1
    return infractions
Return a string uniquely identifying a node in ironic db.
dataset/ETHPy150Open rubik/xenon/xenon/core.py/find_infractions--crossover with--dataset/ETHPy150Open openstack/tripleo-common/tripleo_common/utils/nodes.py/DriverInfo.unique_id_from_node