Exemple #1
0
 private void CacheResult(ReportingDescriptor rule, Result result)
 {
     if (!HashToResultsMap.TryGetValue(currentFileHash, out List <Tuple <ReportingDescriptor, Result> > results))
     {
         results = HashToResultsMap[currentFileHash] = new List <Tuple <ReportingDescriptor, Result> >();
     }
     results.Add(new Tuple <ReportingDescriptor, Result>(rule, result));
 }
Exemple #2
0
        public void AnalyzingTarget(IAnalysisContext context)
        {
            this.currentFileHash = context.Hashes.Sha256;

            if (HashToResultsMap.ContainsKey(currentFileHash))
            {
                // We already have results cached for this file. This means that we shouldn't collect
                // any data in calls to Log. These calls are the driver framework 'replaying' the
                // cached results via the aggregated logger instance
                cacheLoggingData = false;
            }
            else
            {
                cacheLoggingData = true;
                HashToNotificationsMap[currentFileHash] = new List <Notification>();
                HashToResultsMap[currentFileHash]       = new List <Tuple <ReportingDescriptor, Result> >();
            }
        }