Skip to content

Commit

Permalink
Solve GoReport card issues Closes #2298 (#2777)
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaela-soares authored Apr 12, 2021
1 parent e3b146d commit fe55ac7
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion internal/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const Fullname = "Keeping Infrastructure as Code Secure"
// SCMCommit - Source control management commit identifier
const SCMCommit = "N/A"

// LogFile - logfile name
// DefaultLogFile - logfile name
const DefaultLogFile = "info.log"

// DefaultConfigFilename - default configuration filename
Expand Down
2 changes: 1 addition & 1 deletion pkg/detector/default_detect.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ func (d defaultDetectLine) DetectLine(file *model.FileMetadata, searchKey string
logWithFields *zerolog.Logger, outputLines int) model.VulnerabilityLines {
text := strings.ReplaceAll(file.OriginalData, "\r", "")
lines := strings.Split(text, "\n")
var isBreak bool
foundAtLeastOne := false
currentLine := 0
isBreak := false
var extractedString [][]string
extractedString = GetBracketValues(searchKey, extractedString, "")
sanitizedSubstring := searchKey
Expand Down
2 changes: 1 addition & 1 deletion pkg/detector/docker/docker_detect.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func (d DetectKindLine) DetectLine(file *model.FileMetadata, searchKey string,
logWithFields *zerolog.Logger, outputLines int) model.VulnerabilityLines {
text := strings.ReplaceAll(file.OriginalData, "\r", "")
lines := prepareDockerFileLines(text)
isBreak := false
var isBreak bool
foundAtLeastOne := false
currentLine := 0
var extractedString [][]string
Expand Down
2 changes: 1 addition & 1 deletion pkg/engine/source/source.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:generate go run -mod=mod github.com/golang/mock/mockgen -package mock -source=./$GOFILE -destination=../mock/$GOFILE
// Package source (go:generate go run -mod=mod github.com/golang/mock/mockgen -package mock -source=./$GOFILE -destination=../mock/$GOFILE)
package source

import "github.com/Checkmarx/kics/pkg/model"
Expand Down
6 changes: 3 additions & 3 deletions pkg/model/model.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:generate go run -mod=mod github.com/mailru/easyjson/easyjson ./$GOFILE
// Package model (go:generate go run -mod=mod github.com/mailru/easyjson/easyjson ./$GOFILE)
package model

import (
Expand Down Expand Up @@ -180,12 +180,12 @@ func (m FileMetadatas) ToMap() map[string]FileMetadata {
return c
}

//easyjson:json
// Documents (easyjson:json)
type Documents struct {
Documents []Document `json:"document"`
}

//easyjson:json
// Document (easyjson:json)
type Document map[string]interface{}

// Combine merge documents from FileMetadatas using the ID as reference for Document ID and FileName as reference for file
Expand Down
6 changes: 6 additions & 0 deletions pkg/resolver/helm/helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,15 @@ func newClient() *action.Install {
func setID(chartReq *chart.Chart) *chart.Chart {
for _, temp := range chartReq.Templates {
temp = addID(temp) //nolint
if temp != nil {
continue
}
}
for _, dep := range chartReq.Dependencies() {
dep = setID(dep) //nolint
if dep != nil {
continue
}
}
return chartReq
}
Expand Down
2 changes: 1 addition & 1 deletion tools/tools.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build tools
// Package tools (+build tools)
package tools

// Manage tool dependencies via go.mod.
Expand Down

0 comments on commit fe55ac7

Please sign in to comment.