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

Analysis failing because of resources hoard when node_modules/ is present with lots of dependencies #4490

Closed
ilia-kebets-sonarsource opened this issue Jan 3, 2024 · 2 comments · Fixed by #4502
Assignees
Labels
type: bug Exceptions and blocking issues during analysis

Comments

@ilia-kebets-sonarsource
Copy link
Contributor

It seems that our current implementation of dependencies inspection is quite resource hungry and could be optimized. When there are many of them, the analysis can timeout and fail as reported in this community ticket.

The current workaround is to analyze the code without its dependencies by simply deleting the node_modules/ folder before running the analysis.

However, we must optimize the dependencies inspection element. Some fixes can be:

  • respect the sonar.exclusions for the dependencies folder traversal
  • limit the dependencies search:
    • by depth: hardcoded or parametrizable
    • by some heuristic: ignore transitive ones
@ilia-kebets-sonarsource ilia-kebets-sonarsource added the type: bug Exceptions and blocking issues during analysis label Jan 3, 2024
@vdiez
Copy link
Contributor

vdiez commented Jan 15, 2024

package.json lookup already respects exclusions. Format to make it work should have been sonar.exclusions=**/node_modules/**, but it's already in the default exclusions

@vdiez vdiez closed this as completed Jan 15, 2024
@vdiez vdiez reopened this Jan 17, 2024
@vdiez
Copy link
Contributor

vdiez commented Jan 17, 2024

reopen because minimatch was not matching against hidden folders (ie. .scannerwork). Most of the listed package.json files in the logs where from the bridge. In some cases from .pnpm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Exceptions and blocking issues during analysis
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants