microsoft / sarif-sdk

.NET code and supporting files for working with the 'Static Analysis Results Interchange Format' (SARIF, see https://github.com/oasis-tcs/sarif-spec)
Other
194 stars 93 forks source link

Target analysis completed #2637

Closed michaelcfanning closed 1 year ago

michaelcfanning commented 1 year ago

The primary point of this PR is to restore callbacks to IAnalysisLogger.AnalyzingTarget implementations (removed in recent pipeline rewrite). While the hood is up, added a new IAnalysisLogger.TargetAnalyzed callback.

AnalyzingTarget is called from the target enumeration thread. Strictly speaking, this isn't when analysis begins. The scan threads do not have a pointer to the global context logger, however, so changing this would require more thought.

TargetAnalyzed is called from the logging thread and so synchronization is required again on the global context object.

As part of this change, I noticed some console logger messages that never fired (because the callback wasn't executed) tracking the start of analysis. This is verbose logging, so I put it behind a new trace flag (and added analogous handling in the target analyzed callback).

@eddynaka @suvamM @shaopeng-gh @easyrhino-gh @cfaucon