Skip to content

Commit

Permalink
add logs for sanitised issue count and issue map
Browse files Browse the repository at this point in the history
  • Loading branch information
srijan-deepsource committed Sep 13, 2024
1 parent 13078d4 commit 0d91d4e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions run_community_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def main(argv: list[str] | None = None) -> None:
args = parser.parse_args(argv, namespace=CommunityAnalyzerArgs)
# analyzer name is mandatory in case of community analyzers but not custom analyzers
if analyzer_name := args.analyzer:
logger.info("Fetching issue map for: %s", analyzer_name)
issue_map_path = get_issue_map(analyzer_name)

modified_files = get_files_to_analyze(code_path)
Expand Down
6 changes: 6 additions & 0 deletions sarif-parser/src/sarif_parser/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def parse(

deepsource_issues: list[Issue] = []
total_report_issues = 0
issue_count_in_issues_map = 0
for run in sarif_data["runs"]:
total_report_issues += len(run["results"])
for issue in run["results"]:
Expand Down Expand Up @@ -122,8 +123,10 @@ def parse(
logger.info(
"Total issues in SARIF report: %s. \n"
"Issues extracted for the run in files sent for analysis: %s",
"Sanitized issues count with IDs in issue map: %s",
total_report_issues,
len(deepsource_issues),
issue_count_in_issues_map,
)

return deepsource_issues
Expand Down Expand Up @@ -174,6 +177,9 @@ def run_sarif_parser(
sentry.raise_info(
f"Could not find issue map at {issue_map_path} for analyzer."
)
logger.warning(
"Could not find issue map at %s for analyzer.", issue_map_path
)

# Run parser
deepsource_issues = []
Expand Down

0 comments on commit 0d91d4e

Please sign in to comment.