class AdLint::CrossModuleAnalyzer

Public Class Methods

new(traits, msg_catalog, met_fpaths, output_dpath, verbose) click to toggle source
Calls superclass method AdLint::Analyzer::new
# File lib/adlint/analyzer.rb, line 171
def initialize(traits, msg_catalog, met_fpaths, output_dpath, verbose)
  proj_name = traits.of_project.project_name
  super("CMA-#{SHORT_VERSION}", traits, msg_catalog, proj_name,
        output_dpath, Pathname.new(proj_name), verbose)
  @met_fpaths = met_fpaths
end

Private Instance Methods

execute(monitor) click to toggle source
# File lib/adlint/analyzer.rb, line 179
def execute(monitor)
  Report.new(msg_fpath, met_fpath, log_fpath, @verbose) do |report|
    phase_ctxt = PhaseContext.new(self, report, monitor)
    phase_ctxt[:metric_fpaths] = @met_fpaths
    phase_ctxt[:annotations]   = []
    phase_ctxt[:suppressors]   = MessageSuppressorSet.new

    phases.each { |phase| phase.new(phase_ctxt).execute }
    phase_ctxt.flush_deferred_report!
  end
rescue
  if @verbose
    $stderr.puts "Error was occurred in cross module analysis."
    $stderr.puts "See `#{log_fpath}' for more details."
  end
  raise
end
met_fpath() click to toggle source
# File lib/adlint/analyzer.rb, line 218
def met_fpath
  proj_name = @traits.of_project.project_name
  met_fname = Pathname.new(proj_name).add_ext(".met.csv")
  @output_dpath ? @output_dpath.join(met_fname) : met_fname
end
msg_fpath() click to toggle source
# File lib/adlint/analyzer.rb, line 212
def msg_fpath
  proj_name = @traits.of_project.project_name
  msg_fname = Pathname.new(proj_name).add_ext(".msg.csv")
  @output_dpath ? @output_dpath.join(msg_fname) : msg_fname
end
phases() click to toggle source
# File lib/adlint/analyzer.rb, line 197
def phases
  [
    Ld::MapTypedefPhase,
    Ld::MapFunctionPhase,
    Ld::MapVariablePhase,
    Ld::BuildCallGraphPhase,
    Ld::BuildXRefGraphPhase,
    Ld::PreparePhase,
    Ld::TypedefReviewPhase,
    Ld::FunctionReviewPhase,
    Ld::VariableReviewPhase,
    Ld::ExaminationPhase
  ]
end