Skip to content

Commit

Permalink
Show 'Controls:' on when there are controls present
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Zunker <[email protected]>
  • Loading branch information
czunker committed Mar 9, 2023
1 parent 540bde2 commit e213aa3
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions cli/reporter/print_compact.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,20 +373,22 @@ func (r *defaultReporter) printAssetQueries(resolved *policy.ResolvedPolicy, rep
r.out.Write([]byte(NewLineCharacter))
}

r.out.Write([]byte("Controls:" + NewLineCharacter))
for id, score := range report.Scores {
_, ok := resolved.CollectorJob.ReportingQueries[id]
if !ok {
continue
}
if len(report.Scores) >= 0 {
r.out.Write([]byte("Controls:" + NewLineCharacter))
for id, score := range report.Scores {
_, ok := resolved.CollectorJob.ReportingQueries[id]
if !ok {
continue
}

query, ok := queries[id]
if !ok {
r.out.Write([]byte("Couldn't find any queries for incoming value for " + id))
continue
}
query, ok := queries[id]
if !ok {
r.out.Write([]byte("Couldn't find any queries for incoming value for " + id))
continue
}

r.printControl(score, query, asset, resolved, report, results)
r.printControl(score, query, asset, resolved, report, results)
}
}
}

Expand Down

0 comments on commit e213aa3

Please sign in to comment.