Skip to content

Commit f4b99d4

Browse files
author
Quoc Truong
committed
Remove countdownevent
1 parent 5c08380 commit f4b99d4

File tree

1 file changed

+0
-60
lines changed

1 file changed

+0
-60
lines changed

Engine/Commands/InvokeScriptAnalyzerCommand.cs

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,6 @@ private void ProcessPath(string path)
276276
Dictionary<string, List<RuleSuppression>> ruleSuppressions;
277277
List<Regex> includeRegexList;
278278
List<Regex> excludeRegexList;
279-
CountdownEvent cde;
280279
ConcurrentDictionary<string, List<object>> ruleDictionary;
281280

282281
/// <summary>
@@ -673,65 +672,6 @@ private void AnalyzeFile(string filePath)
673672
}
674673
}
675674

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-
735675
#endregion
736676
}
737677
}

0 commit comments

Comments
 (0)