LowEndInsight v0.3.3 AnalyzerModule View Source
Analyzer takes in a repo url and coordinates the analysis, returning a simple JSON report.
Link to this section Summary
Functions
analyze/3: returns the LowEndInsight report as JSON for multiple_repos. Takes in a "list" of urls, a source id for the calling client, and the start_time of analysis as an optional way to capture the time actually started at whatever the client is (e.g. an async API).
create_empty_report/3: takes in a uuid, list of urls, and a start time and produces the repo report object to be returned immediately by asynchronous requestors (e.g. LowEndInsight-Get HTTP endpoint)
determine_risk_counts/1: takes in a full report of n-repo reports, and calculates the number or risk ratings, given the number of repos. It returns a new report with the risk_counts object populated with the count table. Have to accommodate both the atom and string elements, becuse the JSON gets parsed into the string format - so caching can be supported (as reports are stored in JSON).
determine_toplevel_risk/1: takes in a report and determines the highest criticality, and assigns it to the "risk" element for the repo report.
Link to this section Functions
analyze/3: returns the LowEndInsight report as JSON for multiple_repos. Takes in a "list" of urls, a source id for the calling client, and the start_time of analysis as an optional way to capture the time actually started at whatever the client is (e.g. an async API).
Returns Map.
Examples
iex> {:ok, report} = AnalyzerModule.analyze(["https://github.com/kitplummer/xmpp4rails","https://github.com/kitplummer/lita-cron"], "iex")
iex> _count = report[:metadata][:repo_count]
2
create_empty_report/3: takes in a uuid, list of urls, and a start time and produces the repo report object to be returned immediately by asynchronous requestors (e.g. LowEndInsight-Get HTTP endpoint)
determine_risk_counts/1: takes in a full report of n-repo reports, and calculates the number or risk ratings, given the number of repos. It returns a new report with the risk_counts object populated with the count table. Have to accommodate both the atom and string elements, becuse the JSON gets parsed into the string format - so caching can be supported (as reports are stored in JSON).
determine_toplevel_risk/1: takes in a report and determines the highest criticality, and assigns it to the "risk" element for the repo report.