Skip to content

Commit 8d401b3

Browse files
author
Kapil Borle
committed
Update IsRuleEnabled method
1 parent 911c3cf commit 8d401b3

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

Engine/ScriptAnalyzer.cs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1670,19 +1670,10 @@ private bool IsSeverityAllowed(IEnumerable<uint> allowedSeverities, IRule rule)
16701670
&& allowedSeverities.Contains((uint)rule.GetSeverity()));
16711671
}
16721672

1673-
private bool IsRuleEnabled(IRule rule)
1673+
private static bool IsRuleEnabled(IRule rule)
16741674
{
16751675
var configurableRule = rule as ConfigurableScriptRule;
1676-
if (configurableRule != null)
1677-
{
1678-
var propertyInfo = configurableRule.GetType().GetProperty("Enable");
1679-
if (propertyInfo != null)
1680-
{
1681-
return propertyInfo.GetValue(configurableRule) as bool? ?? true;
1682-
}
1683-
}
1684-
1685-
return true;
1676+
return configurableRule == null || configurableRule.Enable;
16861677
}
16871678

16881679
IEnumerable<uint> GetAllowedSeveritiesInInt()

0 commit comments

Comments
 (0)