Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scan command refactor #436

Merged
merged 6 commits into from
Dec 22, 2020
Merged

Conversation

patilpankaj212
Copy link
Contributor

  1. refactor code for scan command
  2. more testability for scan command
  3. modified existing tests for Run func

@codecov
Copy link

codecov bot commented Dec 21, 2020

Codecov Report

Merging #436 (e90045c) into master (287b370) will increase coverage by 6.33%.
The diff coverage is 91.17%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #436      +/-   ##
==========================================
+ Coverage   67.06%   73.39%   +6.33%     
==========================================
  Files          86       86              
  Lines        1949     1962      +13     
==========================================
+ Hits         1307     1440     +133     
+ Misses        524      388     -136     
- Partials      118      134      +16     
Impacted Files Coverage Δ
pkg/cli/scan.go 75.00% <78.57%> (+40.71%) ⬆️
pkg/cli/run.go 91.30% <94.44%> (+29.14%) ⬆️
pkg/cli/init.go 25.00% <0.00%> (ø)
...iac-providers/terraform/v12/variable-references.go 61.66% <0.00%> (+3.33%) ⬆️
...g/iac-providers/terraform/v12/lookup-references.go 76.00% <0.00%> (+16.00%) ⬆️
pkg/policy/opa/engine.go 60.43% <0.00%> (+21.42%) ⬆️
pkg/writer/xml.go 100.00% <0.00%> (+37.50%) ⬆️
pkg/initialize/run.go 50.00% <0.00%> (+50.00%) ⬆️
pkg/utils/resource.go 76.47% <0.00%> (+58.82%) ⬆️
pkg/iac-providers/terraform/v12/cty-converters.go 81.48% <0.00%> (+70.37%) ⬆️

pkg/cli/scan.go Outdated
// Verbose indicates whether to display all fields in default human readlbe output
Verbose bool
)
var scanOptions = new(ScanOptions)
Copy link
Contributor

@kanchwala-yusuf kanchwala-yusuf Dec 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can have a function like NewScanOptions() which returns a new empty *ScanOptions struct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not add any constructor function for ScanOptions struct because we are not doing any initialisation based on parameters.

pkg/cli/run.go Show resolved Hide resolved
pkg/cli/run.go Show resolved Hide resolved
pkg/cli/run.go Show resolved Hide resolved
@sonarcloud
Copy link

sonarcloud bot commented Dec 22, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@kanchwala-yusuf kanchwala-yusuf merged commit c57bb06 into tenable:master Dec 22, 2020
@patilpankaj212 patilpankaj212 deleted the scan-refactor branch December 22, 2020 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants