Correct filtering by file in v1 parsing

The filter uses a field, "file", which is not found on the root
occurrence. This causes the following traceback:

    Traceback (most recent call last):
      File "script/coverity_parser.py", line 267, in <module>
        for issue in sorted(issue_cls, key=lambda i: make_key(i)):
      File "script/coverity_parser.py", line 222, in __iter__
        yield from self.gen
      File "script/coverity_parser.py", line 183, in iter_issues_v1
        for issue_group in filter(self.filter_groups_v1, report["issueInfo"]):
      File "script/coverity_parser.py", line 173, in filter_groups_v1
        if group["file"].lstrip("/").startswith(skip_dir):
    KeyError: 'file'

Instead, we should check the first occurence for it's file member. At
the very least, this will prevent further exceptions.

Change-Id: Ib48406278627a81a35693a83a679e52b6f45db15
Signed-off-by: Jimmy Brisson <jimmy.brisson@arm.com>
1 file changed