public void OnThread() { this.EnumerateFiles(); this.debug("Loading source files..."); foreach (string file in this.SourceFiles) { if (!filtered(file)) { FileAnalyzers.Add(new FileAnalyzer(file)); } } this.debug("Finished loading source files (" + FileAnalyzers.Count + " loaded)."); this.debug("Starting file analysis..."); Parallel.ForEach(FileAnalyzers, currentAnalyzer => { currentAnalyzer.Analyze(); }); this.debug("Finished file analysis."); this.debug("Aggregating results..."); foreach (var analyzer in FileAnalyzers) { foreach (var vuln in analyzer.Vulnerabilities) { this.Vulnerabilities.Add(vuln); } } this.debug("Finished aggregating results."); // // // this.debug("Starting experimental GlobalScaryRule test code..."); List <IRule> globalRules = new List <IRule>(); globalRules.Add(new GlobalScaryCsRule(this.FileAnalyzers, this.debug)); globalRules.Add(new TraceGlobalRule(this.FileAnalyzers, this.debug)); foreach (IRule r in globalRules) { List <IVulnerability> vulns = r.Test(); foreach (var v in vulns) { this.Vulnerabilities.Add(v); } } this.completed(this); }