Skip to content

Commit

Permalink
[cmd] Logging enabled checkers at the beginning of analysis
Browse files Browse the repository at this point in the history
The list of applied checkers can be configured by -e, -d flags,
CodeChecker config files, etc. It is hard to see which checkers are
actually enabled during the analysis. Now the enabled checkers are
listed at the beginning of the analysis.
  • Loading branch information
bruntib committed Aug 5, 2020
1 parent 623d33f commit 2fc8642
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions analyzer/codechecker_analyzer/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"""


from collections import defaultdict
from multiprocessing.managers import SyncManager
import os
import shlex
Expand Down Expand Up @@ -240,6 +241,8 @@ def perform_analysis(args, skip_handler, context, actions, metadata_tool,
check_env = env.extend(context.path_env_extra,
context.ld_lib_path_extra)

enabled_checkers = defaultdict(list)

# Save some metadata information.
for analyzer in analyzers:
metadata_info = {
Expand All @@ -254,12 +257,16 @@ def perform_analysis(args, skip_handler, context, actions, metadata_tool,
state, _ = data
metadata_info['checkers'].update({
check: state == CheckerState.enabled})
enabled_checkers[analyzer].append(check)

version = config_map[analyzer].get_version(check_env)
metadata_info['analyzer_statistics']['version'] = version

metadata_tool['analyzers'][analyzer] = metadata_info

LOG.debug("Enabled checkers:\n%s", '\n'.join(
k + ': ' + ', '.join(v) for k, v in enabled_checkers.items()))

if 'makefile' in args and args.makefile:
statistics_data = __get_statistics_data(args)

Expand Down

0 comments on commit 2fc8642

Please sign in to comment.