Skip to content

Commit

Permalink
Parse file speed up
Browse files Browse the repository at this point in the history
The feature can be useful to speed up the parse process when you want to parse one or more specified files. The VSCode Plugin also runs the 'parse --file' command, so the correction can solve the slow file verification problem.
It uses metadata.json for plist mapping if the result_source_files section is not empty and contains the pairing of source files and plist files. Before the new feature, the process read all existing plist files to find the specified source file's reports.
  • Loading branch information
cservakt committed Sep 14, 2023
1 parent 38f9315 commit 2c2c4a2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions analyzer/codechecker_analyzer/cmd/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,18 @@ def get_output_file_path(default_file_name: str) -> Optional[str]:

for dir_path, file_paths in report_file.analyzer_result_files(args.input):
metadata = get_metadata(dir_path)

if metadata and 'files' in args:
# Mapping plists when files are specified to speed up parsing
file_paths = [
key for key, val in
metadata['tools'][0]['result_source_files'].items()
if val in args.files
] if 'tools' in metadata \
and len(metadata['tools']) > 0 \
and 'result_source_files' in metadata['tools'][0] \
else file_paths

for file_path in file_paths:
reports = report_file.get_reports(
file_path, context.checker_labels, file_cache)
Expand Down

0 comments on commit 2c2c4a2

Please sign in to comment.