microsoft / sarif-tools

A set of Python command line tools for working with SARIF files produced by code analysis tools
MIT License
91 stars 21 forks source link

Copy failed when filtering without any include filters #33

Closed abyss638 closed 1 year ago

abyss638 commented 1 year ago

Tried to copy using this filter:

exclude:
  - location: "Test*.java"
  - suppression:

and got the error:

Traceback (most recent call last):
  File "/Users/simonabykov/BuildSystem/sarif-tools/venv/bin/sarif", line 6, in <module>
    sys.exit(main())
  File "/Users/simonabykov/BuildSystem/sarif-tools/sarif/cmdline/main.py", line 43, in main
    exitcode = args.func(args)
  File "/Users/simonabykov/BuildSystem/sarif-tools/sarif/cmdline/main.py", line 305, in _copy
    output_sarif_file_set = copy_op.generate_sarif(
  File "/Users/simonabykov/BuildSystem/sarif-tools/sarif/operations/copy_op.py", line 65, in generate_sarif
    results = input_run.get_results()
  File "/Users/simonabykov/BuildSystem/sarif-tools/sarif/sarif_file.py", line 245, in get_results
    return self._filter.filter_results(self.run_data["results"])
  File "/Users/simonabykov/BuildSystem/sarif-tools/sarif/filter/general_filter.py", line 204, in filter_results
    self._filter_append(ret, result)
  File "/Users/simonabykov/BuildSystem/sarif-tools/sarif/filter/general_filter.py", line 125, in _filter_append
    if included_stats["state"] == "included":
TypeError: 'NoneType' object is not subscriptable