Skip to content

Commit

Permalink
Refactoring, optimizations, and bug fixes (#183)
Browse files Browse the repository at this point in the history
* Refactored logic out of scan.go into a scanner
* Reduced cyclomatic complexity
* More test cases
* Batches EPSS calls for each componet's slice of vulns, increasing speed
* More test cases and hardening
* Additional Documentation
* Uses the CycloneDX provided decoder
* Refactors loader and afero references
* Version bump to 0.4.8
* Refactored loader tests
* HTML and STDIN renderers show filtering information if the severity flag is set
* Test case coverage
* Error handling if passed a bad arguments
  • Loading branch information
djschleen committed Dec 14, 2023
1 parent 6493ced commit 831aa1c
Show file tree
Hide file tree
Showing 27 changed files with 38,150 additions and 760 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ bomber

/rest

*-results.html
*-results.html
coverage.html
2 changes: 1 addition & 1 deletion .hookz.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
args: ["./..."]
- name: "gocyclo: Check cyclomatic complexities"
exec: gocyclo
args: ["-over", "13", "."]
args: ["-over", "9", "."]
- name: Hinge
exec: hinge
args: ["."]
Expand Down
10 changes: 9 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/main.go",
"args": ["--provider=ossindex", "--debug=true", "--output=html", "scan", "./_TESTDATA_/sbom/juiceshop.cyclonedx.json"]
"args": ["--provider=ossindex", "--debug=true", "--output=html", "--severity=high", "scan", "./_TESTDATA_/sbom/juiceshop.cyclonedx.json"]
},
{
"name": "Debug File, Output HTML (osv - juiceshop)",
Expand All @@ -108,6 +108,14 @@
"program": "${workspaceFolder}/main.go",
"args": ["--debug=true", "--output=html", "scan", "./_TESTDATA_/sbom/juiceshop.cyclonedx.json"]
},
{
"name": "Debug File (ossindex - merged)",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/main.go",
"args": ["--provider=ossindex", "--debug=true", "scan", "./_TESTDATA_/sbom/merged.json"]
},
{
"name": "Debug File (ossindex - railsgoat)",
"type": "go",
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@
"Distro",
"DKFM",
"dpkg",
"DXJSON",
"DXXML",
"Encricher",
"Epss",
"errcheck",
"exitcode",
"gofmt",
"gomod",
"gookit",
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ build: ## Builds the application

test: ## Runs tests and coverage
go test -v -coverprofile=coverage.out ./... && go tool cover -func=coverage.out
go tool cover -html=coverage.out -o coverage.html

check: build ## Tests the pre-commit hooks if they exist
hookz reset --verbose --debug --verbose-output
Expand Down

0 comments on commit 831aa1c

Please sign in to comment.