@@ -44,6 +44,26 @@ public IEnumerable<DiagnosticRecord> AnalyzeScript(Ast ast, string fileName)
4444 {
4545 foreach ( StringConstantExpressionAst expressionAst in expressionAsts )
4646 {
47+ //Check if XPath is used. If XPath is used, then we don't throw warnings.
48+ Ast parentAst = expressionAst . Parent ;
49+ if ( parentAst is InvokeMemberExpressionAst )
50+ {
51+ InvokeMemberExpressionAst invocation = parentAst as InvokeMemberExpressionAst ;
52+ if ( invocation != null )
53+ {
54+ if ( String . Equals ( invocation . Member . ToString ( ) , "SelectSingleNode" , StringComparison . OrdinalIgnoreCase ) ||
55+ String . Equals ( invocation . Member . ToString ( ) , "SelectNodes" , StringComparison . OrdinalIgnoreCase ) ||
56+ String . Equals ( invocation . Member . ToString ( ) , "Select" , StringComparison . OrdinalIgnoreCase ) ||
57+ String . Equals ( invocation . Member . ToString ( ) , "Evaluate" , StringComparison . OrdinalIgnoreCase ) ||
58+ String . Equals ( invocation . Member . ToString ( ) , "Matches" , StringComparison . OrdinalIgnoreCase ) )
59+ {
60+ continue ;
61+ }
62+
63+ }
64+ }
65+
66+
4767 bool isPathValid = false ;
4868 bool isInternalURL = false ;
4969 //make sure there is no path
@@ -128,7 +148,7 @@ public IEnumerable<DiagnosticRecord> AnalyzeScript(Ast ast, string fileName)
128148 new DiagnosticRecord (
129149 String . Format ( CultureInfo . CurrentCulture , Strings . AvoidUsingInternalURLsError ,
130150 expressionAst . Value ) , expressionAst . Extent ,
131- GetName ( ) , DiagnosticSeverity . Warning , fileName ) ;
151+ GetName ( ) , DiagnosticSeverity . Information , fileName ) ;
132152
133153 }
134154 }
@@ -177,7 +197,7 @@ public SourceType GetSourceType()
177197 /// <returns></returns>
178198 public RuleSeverity GetSeverity ( )
179199 {
180- return RuleSeverity . Warning ;
200+ return RuleSeverity . Information ;
181201 }
182202
183203 /// <summary>
0 commit comments