Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# Return if the filename does not match the filter
# Return if the filename matches the exclude pattern
filtered, excluded = apply_filter_include_exclude(
fname, options.filter, options.exclude)
if filtered:
logger.verbose_msg(" Filtering coverage data for file {}", fname)
return
if excluded:
logger.verbose_msg(" Excluding coverage data for file {}", fname)
return
key = os.path.normpath(fname)
parser = GcovParser(key, logger=logger)
parser.parse_all_lines(
INPUT,
exclude_unreachable_branches=options.exclude_unreachable_branches,
exclude_throw_branches=options.exclude_throw_branches,
ignore_parse_errors=options.gcov_ignore_parse_errors)
covdata.setdefault(key, FileCoverage(key)).update(parser.coverage)
INPUT.close()