Method: CodeAnalyzer::Checker#add_warning

Defined in:
lib/code_analyzer/checker.rb

#add_warning(message, filename = @node.file, line_number = @node.line_number) ⇒ Object

add an warning.

Parameters:

  • message, (String)

    is the warning message

  • filename, (String)

    is the filename of source code

  • line_number, (Integer)

    is the line number of the source code which is reviewing



51
52
53
# File 'lib/code_analyzer/checker.rb', line 51

def add_warning(message, filename = @node.file, line_number = @node.line_number)
  warnings << Warning.new(filename: filename, line_number: line_number, message: message)
end