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

Improve printOccurrences function with streaming output for large SBO… #1482

Merged
merged 2 commits into from
Dec 5, 2024

Conversation

deeshantk
Copy link
Contributor

Refactored the printOccurrences function to use streaming for better performance with large SBOM datasets.

@deeshantk deeshantk requested a review from prabhu as a code owner December 4, 2024 20:23
@deeshantk deeshantk force-pushed the improve-printOccurrences branch from 8494ee3 to 5710a30 Compare December 4, 2024 20:27
@prabhu
Copy link
Collaborator

prabhu commented Dec 4, 2024

This is amazing. Could you kindly run pnpm lint and remove any extra new lines. Also revert the package.json changes.

@deeshantk
Copy link
Contributor Author

This is amazing. Could you kindly run pnpm lint and remove any extra new lines. Also revert the package.json changes.

sure

@deeshantk deeshantk force-pushed the improve-printOccurrences branch 2 times, most recently from a5eaee4 to 284ca60 Compare December 4, 2024 21:00
@deeshantk
Copy link
Contributor Author

This is amazing. Could you kindly run pnpm lint and remove any extra new lines. Also revert the package.json changes.

I have run pnpm lint, removed any extra new lines, and reverted the changes to package.json. The pull request has been updated accordingly.

Please let me know if anything else is needed!

@prabhu
Copy link
Collaborator

prabhu commented Dec 4, 2024

Please remove package-lock.json and .vscode changes.

@deeshantk deeshantk force-pushed the improve-printOccurrences branch from 9b78da6 to 4028837 Compare December 4, 2024 22:13
@deeshantk
Copy link
Contributor Author

Please remove package-lock.json and .vscode changes.

done

@prabhu
Copy link
Collaborator

prabhu commented Dec 5, 2024

I meant this branch should only have display.js changes alone.

@deeshantk deeshantk force-pushed the improve-printOccurrences branch from 4028837 to 16353c0 Compare December 5, 2024 08:55
@deeshantk
Copy link
Contributor Author

I meant this branch should only have display.js changes alone.

Thank you for the clarification! I have now updated the branch so that it only includes the changes to display.js

if (!bomJson || !bomJson.components) {
console.error("Invalid or empty SBOM data.");
Copy link
Collaborator

Choose a reason for hiding this comment

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

This error log can be removed, since empty bom data will be flagged elsewhere.

},
columnCount: 4,
columns: [{ width: 20 }, { width: 40 }, { width: 50 }, { width: 25 }],
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this tested? Width 25 in column 4 for filenames might be too small.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this tested? Width 25 in column 4 for filenames might be too small.

I've removed the redundant error log as suggested and adjusted the width for filenames in column 4 to better accommodate longer names.
Here is how it looks:

Screenshot 2024-12-05 at 3 57 12 PM

- Removed the unnecessary error log for empty BOM data, as it will be flagged elsewhere.
- Increased column width for filenames from 25 to a more suitable size.

Signed-off-by: deeshantk <[email protected]>
Copy link
Collaborator

@prabhu prabhu left a comment

Choose a reason for hiding this comment

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

Thank you so much!

@prabhu prabhu merged commit 3054f62 into CycloneDX:master Dec 5, 2024
3 checks passed
@aryan-rajoria
Copy link
Collaborator

Fixes issue #1482.

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.

3 participants