Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, config, targets):
"""
Instantiate a new Cyclomatic Complexity operator.
:param config: The wily configuration.
:type config: :class:`WilyConfig`
"""
# TODO: Import config for harvester from .wily.cfg
logger.debug(f"Using {targets} with {self.defaults} for CC metrics")
self.harvester = harvesters.CCHarvester(targets, config=Config(**self.defaults))
exclude and which directories to ignore.
* ``no_assert``: if ``True``, ``assert`` statements will not be counted
towards increasing the cyclomatic complexity.
* ``absolute``, ``modules`` and ``average``: the threshold for the
complexity.
'''
config = Config(
exclude=args.exclude,
ignore=args.ignore,
order=SCORE,
no_assert=args.no_assert,
show_closures=False,
min='A',
max='F',
)
h = CCHarvester(args.path, config)
results = h._to_dicts()
return find_infractions(args, logger, results), results