MCPcopy Index your code
hub / github.com/cloudgraphdev/cli / pushData

Method pushData

src/reports/rules-report.ts:13–35  ·  view source on GitHub ↗
({
    policyPack,
    ruleDescription,
    results,
  }: {
    policyPack: string
    ruleDescription: string
    results: RuleFinding[]
  })

Source from the content-addressed store, hash-verified

11 tables: { [policyPack: string]: Table } = {}
12
13 pushData({
14 policyPack,
15 ruleDescription,
16 results,
17 }: {
18 policyPack: string
19 ruleDescription: string
20 results: RuleFinding[]
21 }): void {
22 for (const { resourceId, id, result } of results) {
23 const tableName = `${policyPack}-${id}`
24 if (!this.tables[tableName]) {
25 this.tables[tableName] = new Table({ style: { head: [], border: [] } })
26 this.tables[tableName].push(
27 [chalk.italic.green(ruleDescription)],
28 this.tableHeaders
29 )
30 }
31
32 const status = this.getStatus(result)
33 this.tables[tableName].push([resourceId, status])
34 }
35 }
36
37 private getStatus(result: string): string {
38 let status

Callers

nothing calls this directly

Calls 2

getStatusMethod · 0.95
pushMethod · 0.80

Tested by

no test coverage detected