@@ -276,7 +276,6 @@ private void ProcessPath(string path)
276
276
Dictionary < string , List < RuleSuppression > > ruleSuppressions ;
277
277
List < Regex > includeRegexList ;
278
278
List < Regex > excludeRegexList ;
279
- CountdownEvent cde ;
280
279
ConcurrentDictionary < string , List < object > > ruleDictionary ;
281
280
282
281
/// <summary>
@@ -673,65 +672,6 @@ private void AnalyzeFile(string filePath)
673
672
}
674
673
}
675
674
676
- void bg_DoWork ( object sender , DoWorkEventArgs e )
677
- {
678
- bool includeRegexMatch = false ;
679
- bool excludeRegexMatch = false ;
680
-
681
- object [ ] parameters = e . Argument as object [ ] ;
682
-
683
- IScriptRule scriptRule = parameters [ 0 ] as IScriptRule ;
684
-
685
- foreach ( Regex include in includeRegexList )
686
- {
687
- if ( include . IsMatch ( scriptRule . GetName ( ) ) )
688
- {
689
- includeRegexMatch = true ;
690
- break ;
691
- }
692
- }
693
-
694
- foreach ( Regex exclude in excludeRegexList )
695
- {
696
- if ( exclude . IsMatch ( scriptRule . GetName ( ) ) )
697
- {
698
- excludeRegexMatch = true ;
699
- break ;
700
- }
701
- }
702
-
703
- List < object > result = new List < object > ( ) ;
704
-
705
- if ( ( includeRule == null || includeRegexMatch ) && ( excludeRule == null || ! excludeRegexMatch ) )
706
- {
707
- //WriteVerbose(string.Format(CultureInfo.CurrentCulture, Strings.VerboseRunningMessage, scriptRule.GetName()));
708
- result . Add ( string . Format ( CultureInfo . CurrentCulture , Strings . VerboseRunningMessage , scriptRule . GetName ( ) ) ) ;
709
-
710
- // Ensure that any unhandled errors from Rules are converted to non-terminating errors
711
- // We want the Engine to continue functioning even if one or more Rules throws an exception
712
- try
713
- {
714
- var records = Helper . Instance . SuppressRule ( scriptRule . GetName ( ) , ruleSuppressions , scriptRule . AnalyzeScript ( ast , ast . Extent . File ) . ToList ( ) ) ;
715
- foreach ( var record in records . Item2 )
716
- {
717
- diagnostics . Add ( record ) ;
718
- }
719
- foreach ( var suppressedRec in records . Item1 )
720
- {
721
- suppressed . Add ( suppressedRec ) ;
722
- }
723
- }
724
- catch ( Exception scriptRuleException )
725
- {
726
- result . Add ( new ErrorRecord ( scriptRuleException , Strings . RuleErrorMessage , ErrorCategory . InvalidOperation , ast . Extent . File ) ) ;
727
- }
728
- }
729
-
730
- ruleDictionary [ scriptRule . GetName ( ) ] = result ;
731
-
732
- cde . Signal ( ) ;
733
- }
734
-
735
675
#endregion
736
676
}
737
677
}
0 commit comments