Conversation
Codacy's Analysis Summary0 new issue (≤ 0 minor issue) ✨ AI Reviewer: run the reviewer on demand. As new changes are pushed, run a review below. |
There was a problem hiding this comment.
Pull request overview
This PR increases the timeout parameter for the opengrep scan command from 5 seconds to 15 seconds. The change is made in the command parameter construction to allow the analysis tool more time to complete before timing out, which is likely addressing issues with larger files or more complex analysis patterns.
Changes:
- Increased
--timeoutparameter from "5" to "15" in the opengrep command configuration
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
internal/tool/command.go
Outdated
| "--config", configurationFile.Name(), | ||
| /// "-l", language, | ||
| "--timeout", "5", | ||
| "--timeout", "15", |
There was a problem hiding this comment.
The timeout value has been updated to "15" in the production code, but the test file internal/tool/command_test.go at line 47 still expects the old value of "5". This will cause the test TestCreateCommandParameters to fail since it asserts that the command parameters should include "--timeout", "5".
| "--timeout", "15", | |
| "--timeout", "5", |
internal/tool/command.go
Outdated
| "--config", configurationFile.Name(), | ||
| /// "-l", language, | ||
| "--timeout", "5", | ||
| "--timeout", "15", |
There was a problem hiding this comment.
This timeout value is hardcoded as a string literal. Consider extracting this and other command parameter values (like timeout-threshold "3", max-memory "2560") as named constants at the package level, following the pattern used elsewhere in the codebase (see internal/tool/configuration.go lines 19 and 22 which define constants for configuration file names). This would make the values easier to maintain, update, and document, especially since the timeout value appears both here and in tests.
No description provided.