Class: SuspiciousCommentRule

Inherits:
Rule
  • Object
show all
Defined in:
lib/rules/suspicious_comment_rule.rb

Class Method Summary collapse

Methods inherited from Rule

filter_resources, filter_tokens, filter_variables, filter_whitelist, get_comments, get_string_tokens, get_tokens, inherited

Class Method Details

.AnalyzeTokens(tokens) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/rules/suspicious_comment_rule.rb', line 14

def self.AnalyzeTokens(tokens)
  result = []

  ftokens = self.get_comments(tokens)
  ftokens.each do |token|
    token_value = token.value.downcase
    token_type = token.type.to_s
    if (token_value =~ @suspicious_conf.value)
      result.append(Sin.new(SinType::SuspiciousComments, token.line, token.column, token.line, token.column+token_value.length))
    end
  end

  return result
end