Class: Veracode::API::Results

Inherits:
Base
  • Object
show all
Defined in:
lib/veracode/results.rb

Constant Summary collapse

GET_APP_BUILDS_URI =
"/api/4.0/getappbuilds.do"
DETAILED_REPORT_URI =
"/api/3.0/detailedreport.do"
DETAILED_REPORT_PDF_URI =
"/api/3.0/detailedreportpdf.do"
GET_CALL_STACKS_URI =
"/api/3.0/getcallstacks.do"
SUMMARY_REPORT_URI =
"/api/3.0/summaryreport.do"
SUMMARY_REPORT_PDF_URI =
"/api/3.0/summaryreportpdf.do"
THIRD_PARTY_REPORT_PDF_URI =
"/api/3.0/thirdpartyreportpdf.do"

Constants inherited from Base

Base::VERACODE_REQ_VER

Instance Attribute Summary

Attributes inherited from Base

#account_id

Instance Method Summary collapse

Methods inherited from Base

#getXML, #initialize, #postAPI

Constructor Details

This class inherits a constructor from Veracode::API::Base

Instance Method Details

#get_application_buildsObject



32
33
34
35
36
37
38
39
40
41
42
# File 'lib/veracode/results.rb', line 32

def get_application_builds
  xml = getXML(GET_APP_BUILDS_URI)
  case xml.code
  when 200
    clean_xml = xml.body.strip
    parsed = Veracode::Parser.parse(clean_xml)
    builds = Veracode::Result::Builds::Applications.new(parsed)
   else
     xml.error!
   end
end

#get_callstacks(build_id, flaw_id) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/veracode/results.rb', line 20

def get_callstacks(build_id, flaw_id)
  xml = getXML(GET_CALL_STACKS_URI + "?build_id=" + build_id + "&flaw_id=" + flaw_id)
  case xml.code
  when 200
    clean_xml = xml.body.strip
    parsed = Veracode::Parser.parse(clean_xml)
    builds = Veracode::Result::CallStacks.new(parsed)
   else
     xml.error!
   end
end

#get_detailed_report(build_id) ⇒ Object



56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/veracode/results.rb', line 56

def get_detailed_report(build_id)
  xml = getXML(DETAILED_REPORT_URI + "?build_id=" + build_id)
  case xml.code
  when 200
    xmlbody = xml.body
    clean_xml = xmlbody.strip
    parsed = Veracode::Parser.parse(clean_xml)

    report = Veracode::Result::DetailedReport.new(parsed.detailedreport)
  else
     xml.error!
   end
end

#get_summary_report(build_id) ⇒ Object



44
45
46
47
48
49
50
51
52
53
54
# File 'lib/veracode/results.rb', line 44

def get_summary_report(build_id)
  xml = getXML(SUMMARY_REPORT_URI + "?build_id=" + build_id)
  case xml.code
  when 200
    clean_xml = xml.body.strip
    parsed = Veracode::Parser.parse(clean_xml)
    report = Veracode::Result::SummaryReport.new(parsed.summaryreport)
  else
     xml.error!
   end
end