Skip to content

Add i18n and exotic rules while bumping to 1.16.2#5

Merged
heliocodacy merged 2 commits intomainfrom
i18n_exotic_rules
Mar 4, 2026
Merged

Add i18n and exotic rules while bumping to 1.16.2#5
heliocodacy merged 2 commits intomainfrom
i18n_exotic_rules

Conversation

@heliocodacy
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings March 4, 2026 11:33
@codacy-production
Copy link

codacy-production bot commented Mar 4, 2026

Codacy's Analysis Summary

10 new issues (≤ 0 minor issue)
0 new security issue
141 complexity
0 duplications
More details

AI Reviewer: first review requested successfully. As new changes are pushed, run a review below.
AI can make mistakes. Always validate suggestions.

 
  Run Reviewer ▶︎  
 

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR bumps the bundled OpenGrep version to 1.16.2 and expands the rule set by adding new i18n-focused Semgrep rules and a new “exotic” SQL hardcoded-values rule, along with corresponding documentation test fixtures.

Changes:

  • Bump OpenGrep wrapper/tooling version to 1.16.2 and adjust scan runtime limits.
  • Add new i18n rules (JS + Java) and expand the i18n multiple-tests fixtures/results.
  • Add a new “exotic” SQL hardcoded-values rule and a dedicated multiple-tests fixture/results set.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
internal/tool/command.go Updates OpenGrep CLI flags (timeout threshold, max memory).
internal/docgen/parsing.go Ensures docgen loads the new codacy-rules-exotic.yaml ruleset.
docs/multiple-tests/i18n/src/OrderController.java Wraps excerpt in a class and provides additional i18n “bad” examples.
docs/multiple-tests/i18n/src/Javai18nPotentialsIssues.java Adds a comprehensive Java i18n test corpus for the new rules.
docs/multiple-tests/i18n/src/FalsePositive.jsx Adds a JS/React i18n test corpus for the new rules.
docs/multiple-tests/i18n/results.xml Updates expected findings for the expanded i18n rules/tests.
docs/multiple-tests/i18n/patterns.xml Enables additional i18n rules in the i18n test harness.
docs/multiple-tests/exotic/src/ExoticCode01.java Adds a Java sample containing hardcoded SQL values for exotic detection.
docs/multiple-tests/exotic/results.xml Adds expected findings for the exotic SQL rule.
docs/multiple-tests/exotic/patterns.xml Enables the exotic SQL rule in the exotic test harness.
docs/codacy-rules.yaml Tweaks existing SQL and GRANT regexes (comment avoidance + role matching).
docs/codacy-rules-i18n.yaml Adds multiple new i18n rules for JS and Java (and related patterns).
docs/codacy-rules-exotic.yaml Introduces the new exotic SQL hardcoded-values rule.
Dockerfile Bumps OPENGREP_VERSION build arg to v1.16.2.
.tool_version Bumps tool version to 1.16.2.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines 15 to +19
<module name="codacy.js.i18n.no-hardcoded-number-format" />
</module> No newline at end of file
<module name="codacy.js.i18n.no-hardcoded-throw-error" />
<module name="codacy.java.i18n.no-hardcoded-map-put" />
<module name="codacy.java.i18n.no-hardcoded-map-of" />
</module>
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

codacy.java.i18n.no-hardcoded-response-body was added to docs/codacy-rules-i18n.yaml, but it isn't enabled in this i18n test harness (docs/multiple-tests/i18n/patterns.xml) and there are no expected findings for it in results.xml. If this rule is meant to ship, it should be included here with corresponding expected results so regressions are caught.

Copilot uses AI. Check for mistakes.
Comment on lines 84 to +90
"--timeout", "5",
"--timeout-threshold", "50",
"--max-target-bytes", "0",
"--taint-intrafile",
//"--pro",
//"--error-recovery",
"--max-memory", "2560",
"--max-memory", "5000",
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

createCommandParameters now emits --timeout-threshold 50 (and --max-memory 5000). internal/tool/command_test.go still asserts --timeout-threshold 3 (via assert.Subset), so the unit test will fail as-is. Update the expected params in the test (and consider centralizing these option values so prod + tests stay in sync).

Copilot uses AI. Check for mistakes.
@heliocodacy heliocodacy merged commit 68a29df into main Mar 4, 2026
7 checks passed
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.

4 participants