Skip to content

feature: container-scan command to trivy scan containers - #191

Closed
franciscoovazevedo wants to merge 5 commits into
mainfrom
trivy-container-scan
Closed

feature: container-scan command to trivy scan containers#191
franciscoovazevedo wants to merge 5 commits into
mainfrom
trivy-container-scan

add tests and codacy suggestion improvments

25dcb9b
Select commit
Loading
Failed to load commit list.
Codacy Production / Codacy Static Code Analysis required action Jan 19, 2026 in 0s

2 new security issues (0 max.).

Codacy Here is an overview of what got changed by this pull request:

Issues
======
- Added 6
           

Complexity increasing per file
==============================
- cli-v2.go  1
- cmd/container_scan.go  19
- cmd/container_scan_test.go  22
         

See the complete overview on Codacy

Annotations

Check notice on line 1 in cmd/container_scan.go

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

cmd/container_scan.go#L1

should have a package comment

Check warning on line 126 in cmd/container_scan.go

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

cmd/container_scan.go#L126

parameter 'cmd' seems to be unused, consider removing or renaming it as _

Check failure on line 138 in cmd/container_scan.go

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

cmd/container_scan.go#L138

Detected non-static command inside Command.

Check failure on line 138 in cmd/container_scan.go

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

cmd/container_scan.go#L138

OS command injection is a critical vulnerability that can lead to a full system compromise as it may allow an adversary to pass in arbitrary commands or arguments to be executed.

Check failure on line 9 in cmd/container_scan_test.go

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

cmd/container_scan_test.go#L9

Method TestBuildTrivyArgs has 118 lines of code (limit is 100)

Check failure on line 227 in cmd/container_scan_test.go

See this annotation in the file changed.

@codacy-production codacy-production / Codacy Static Code Analysis

cmd/container_scan_test.go#L227

Method TestValidateImageName has 135 lines of code (limit is 100)