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

JsonReport is incomplete #86

Closed
ChristopherThiedeVireq opened this issue Jun 23, 2022 · 3 comments
Closed

JsonReport is incomplete #86

ChristopherThiedeVireq opened this issue Jun 23, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@ChristopherThiedeVireq
Copy link
Contributor

Describe the bug
The JsonReport contains only the packages of the last project.

To Reproduce
Steps to reproduce the behavior:

  1. use parameter --solution with multiple projects
  2. configure VulnerabilityReports.JsonReportPath

Expected behavior
The JsonReport contains all Vulnerabilities.

Tools:

  • IDE: VS2022
  • OS: Windows 10

Additional context
localy I fix this issue in VulnerabilityReporter.BuildVulnerabilityReport. Instead of setting Report.Packages in the foreach loop I use a list and add the packages to the list in the loop.

var reportedPackages = new List<VulnerableNuGetPackage>(); ... foreach (var (proj, pkgs) in projects) { ... reportedPackages.AddRange(nuGetPackages.Where .... }
At the end of the method I use
Report.Packages = reportedPackages.ToArray();
to set the packages of the report.

@ChristopherThiedeVireq ChristopherThiedeVireq added the bug Something isn't working label Jun 23, 2022
@digitalcoyote
Copy link
Owner

Thanks for the bug report. It will likely be a couple days before I can look into this. If you want to throw together a PR, I'd be willing to merge it although it's likely to be this weekend before I can push up a new version.

@ChristopherThiedeVireq
Copy link
Contributor Author

I add a Pull Request.

@digitalcoyote
Copy link
Owner

Fixed in v3.0.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants