Skip to content

Commit

Permalink
comment
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentsimon committed Apr 11, 2022
1 parent f15a661 commit 19edc33
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions pkg/json_raw_results.go
Expand Up @@ -131,18 +131,13 @@ type jsonReleaseAsset struct {
URL string `json:"url"`
}

//nolint
type jsonRawResults struct {
// List of recent issues.
RecentIssues []jsonIssue `json:"issues"`
// List of vulnerabilities.
}

type jsonOssfBestPractices struct {
Badge string `json:"badge"`
}

type jsonRawResults struct {
// Issues.
RecentIssues []jsonIssue `json:"issues"`
// OSSF best practices badge.
OssfBestPractices jsonOssfBestPractices `json:"openssf-best-practices-badge"`
// Vulnerabilities.
Expand Down Expand Up @@ -240,15 +235,6 @@ func (r *jsonScorecardRawResult) setDefaultCommitData(commits []checker.DefaultB
return nil
}


//nolint:unparam
func (r *jsonScorecardRawResult) addOssfBestPracticesRawResults(cbp *checker.CIIBestPracticesData) error {
r.Results.OssfBestPractices.Badge = string(cbp.Badge)
return nil
}

//nolint:unparam
func (r *jsonScorecardRawResult) addCodeReviewRawResults(cr *checker.CodeReviewData) error {
r.Results.DefaultBranchCommits = []jsonDefaultBranchCommit{}
for _, commit := range commits {
com := jsonDefaultBranchCommit{
Expand Down Expand Up @@ -294,6 +280,12 @@ func (r *jsonScorecardRawResult) addCodeReviewRawResults(cr *checker.CodeReviewD
return nil
}

//nolint:unparam
func (r *jsonScorecardRawResult) addOssfBestPracticesRawResults(cbp *checker.CIIBestPracticesData) error {
r.Results.OssfBestPractices.Badge = string(cbp.Badge)
return nil
}

func (r *jsonScorecardRawResult) addCodeReviewRawResults(cr *checker.CodeReviewData) error {
return r.setDefaultCommitData(cr.DefaultBranchCommits)
}
Expand Down Expand Up @@ -422,7 +414,7 @@ func (r *jsonScorecardRawResult) fillJSONRawResults(raw *checker.RawResults) err
if err := r.addSignedReleasesRawResults(&raw.SignedReleasesResults); err != nil {
return sce.WithMessage(sce.ErrScorecardInternal, err.Error())
}

// CII-Best-Practices.
if err := r.addOssfBestPracticesRawResults(&raw.CIIBestPracticesResults); err != nil {
return sce.WithMessage(sce.ErrScorecardInternal, err.Error())
Expand Down

0 comments on commit 19edc33

Please sign in to comment.