@codacy/tools-opengrep-1 0.6.2 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/metadata.js CHANGED
@@ -23,6 +23,121 @@ __export(metadata_exports, {
23
23
  descriptor: () => descriptor
24
24
  });
25
25
  module.exports = __toCommonJS(metadata_exports);
26
+
27
+ // src/pattern-mappings.json
28
+ var pattern_mappings_default = {
29
+ Django: {
30
+ prefixes: ["Semgrep_python.django."]
31
+ },
32
+ Flask: {
33
+ prefixes: ["Semgrep_python.flask."]
34
+ },
35
+ FastAPI: {
36
+ prefixes: ["Semgrep_python.fastapi."]
37
+ },
38
+ SQLAlchemy: {
39
+ prefixes: ["Semgrep_python.sqlalchemy."]
40
+ },
41
+ Express: {
42
+ prefixes: ["Semgrep_javascript.express."]
43
+ },
44
+ React: {
45
+ prefixes: ["Semgrep_javascript.react.", "Semgrep_typescript.react."]
46
+ },
47
+ Angular: {
48
+ prefixes: ["Semgrep_javascript.angular.", "Semgrep_typescript.angular."]
49
+ },
50
+ "Vue.js": {
51
+ prefixes: ["Semgrep_javascript.vue."]
52
+ },
53
+ NestJS: {
54
+ prefixes: ["Semgrep_typescript.nestjs."]
55
+ },
56
+ jQuery: {
57
+ prefixes: ["Semgrep_javascript.jquery."]
58
+ },
59
+ Playwright: {
60
+ prefixes: ["Semgrep_javascript.playwright."]
61
+ },
62
+ "Ruby on Rails": {
63
+ prefixes: ["Semgrep_ruby.rails."]
64
+ },
65
+ Spring: {
66
+ prefixes: ["Semgrep_java.spring."]
67
+ },
68
+ Laravel: {
69
+ prefixes: ["Semgrep_php.laravel."]
70
+ },
71
+ WordPress: {
72
+ prefixes: ["Semgrep_php.wordpress-plugins."]
73
+ },
74
+ "Gorilla Mux": {
75
+ prefixes: ["Semgrep_go.gorilla."]
76
+ },
77
+ GORM: {
78
+ prefixes: ["Semgrep_go.gorm."]
79
+ },
80
+ gRPC: {
81
+ prefixes: ["Semgrep_go.grpc."]
82
+ },
83
+ MongoDB: {
84
+ prefixes: ["Semgrep_java.mongodb.", "Semgrep_python.pymongo."]
85
+ },
86
+ Mongoose: {
87
+ prefixes: ["Semgrep_python.pymongo."]
88
+ },
89
+ i18next: {
90
+ prefixes: [
91
+ "Semgrep_typescript.react.portability.i18next.",
92
+ "Semgrep_codacy.cpp.i18n.",
93
+ "Semgrep_codacy.java.i18n.",
94
+ "Semgrep_codacy.js.i18n.",
95
+ "Semgrep_codacy.python.i18n."
96
+ ]
97
+ },
98
+ "react-intl": {
99
+ prefixes: [
100
+ "Semgrep_codacy.cpp.i18n.",
101
+ "Semgrep_codacy.java.i18n.",
102
+ "Semgrep_codacy.js.i18n.",
103
+ "Semgrep_codacy.python.i18n."
104
+ ]
105
+ },
106
+ "vue-i18n": {
107
+ prefixes: [
108
+ "Semgrep_codacy.cpp.i18n.",
109
+ "Semgrep_codacy.java.i18n.",
110
+ "Semgrep_codacy.js.i18n.",
111
+ "Semgrep_codacy.python.i18n."
112
+ ]
113
+ },
114
+ Lingui: {
115
+ prefixes: [
116
+ "Semgrep_codacy.cpp.i18n.",
117
+ "Semgrep_codacy.java.i18n.",
118
+ "Semgrep_codacy.js.i18n.",
119
+ "Semgrep_codacy.python.i18n."
120
+ ]
121
+ },
122
+ "next-intl": {
123
+ prefixes: [
124
+ "Semgrep_codacy.cpp.i18n.",
125
+ "Semgrep_codacy.java.i18n.",
126
+ "Semgrep_codacy.js.i18n.",
127
+ "Semgrep_codacy.python.i18n."
128
+ ]
129
+ },
130
+ "Flask-Babel": {
131
+ prefixes: [
132
+ "Semgrep_codacy.cpp.i18n.",
133
+ "Semgrep_codacy.java.i18n.",
134
+ "Semgrep_codacy.js.i18n.",
135
+ "Semgrep_codacy.python.i18n."
136
+ ]
137
+ }
138
+ };
139
+
140
+ // src/metadata.ts
26
141
  var descriptor = {
27
142
  id: "Semgrep",
28
143
  displayName: "Opengrep",
@@ -61,7 +176,8 @@ var descriptor = {
61
176
  filePatterns: ["*"],
62
177
  supportedOS: ["linux", "darwin"],
63
178
  supportedArch: ["x64", "arm64"],
64
- supportedRunners: ["local", "container"]
179
+ supportedRunners: ["local", "container"],
180
+ frameworkMappings: pattern_mappings_default
65
181
  };
66
182
  // Annotate the CommonJS export names for ESM import in node:
67
183
  0 && (module.exports = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codacy/tools-opengrep-1",
3
- "version": "0.6.2",
3
+ "version": "0.8.1",
4
4
  "description": "Opengrep adapter — CLI-mode multi-language SAST scanner",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -10,7 +10,7 @@
10
10
  ],
11
11
  "dependencies": {
12
12
  "yaml": "^2.6.0",
13
- "@codacy/tooling": "0.6.2"
13
+ "@codacy/tooling": "0.8.1"
14
14
  },
15
15
  "license": "MIT",
16
16
  "author": "Codacy <support@codacy.com> (https://www.codacy.com)",
package/src/rules.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  # Auto-generated by fetch-rules.mjs — do not edit manually.
2
2
  # Source: semgrep/semgrep-rules@4ccd3b9 + codacy/codacy-opengrep custom rules
3
- # Generated: 2026-03-26T12:10:30.762Z
4
- # Rule count: 2237
3
+ # Generated: 2026-05-07T13:33:30.650Z
4
+ # Rule count: 2243
5
5
 
6
6
  rules:
7
7
  - id: ai.csharp.detect-openai.detect-openai
@@ -97024,6 +97024,106 @@ rules:
97024
97024
  impact: MEDIUM
97025
97025
  confidence: LOW
97026
97026
  likelihood: HIGH
97027
+ - id: codacy.python.i18n.no-hardcoded-print-concat
97028
+ severity: WARNING
97029
+ languages:
97030
+ - python
97031
+ pattern-either:
97032
+ - pattern: print("..." + ...)
97033
+ - pattern: print(... + "...")
97034
+ message: >-
97035
+ Avoid hardcoded or concatenated strings in print. Use an i18n translation function (e.g., _("key")) with .format() or f-strings.
97036
+ metadata:
97037
+ category: codestyle
97038
+ subcategory: i18n
97039
+ description: Flags hardcoded string literals concatenated in print calls to enforce localization
97040
+ technology:
97041
+ - python
97042
+ impact: MEDIUM
97043
+ confidence: LOW
97044
+ likelihood: HIGH
97045
+ - id: codacy.python.i18n.no-hardcoded-strftime
97046
+ severity: WARNING
97047
+ languages:
97048
+ - python
97049
+ pattern: $X.strftime("...")
97050
+ message: >-
97051
+ Avoid hardcoded date format strings in strftime. Use locale.nl_langinfo(locale.D_FMT) or similar locale-aware formatting.
97052
+ metadata:
97053
+ category: codestyle
97054
+ subcategory: i18n
97055
+ description: Flags hardcoded date format strings passed to strftime to enforce locale-aware date formatting
97056
+ technology:
97057
+ - python
97058
+ impact: MEDIUM
97059
+ confidence: HIGH
97060
+ likelihood: HIGH
97061
+ - id: codacy.python.i18n.no-hardcoded-number-format
97062
+ severity: WARNING
97063
+ languages:
97064
+ - python
97065
+ pattern-regex: ":\\.[0-9]+f"
97066
+ message: >-
97067
+ Avoid using :.Nf format specifiers for user-visible number formatting. Use locale.currency() or locale.format_string() for locale-aware formatting.
97068
+ metadata:
97069
+ category: codestyle
97070
+ subcategory: i18n
97071
+ description: Flags :.Nf format specifiers in f-strings used for user-visible numbers instead of locale-aware formatting
97072
+ technology:
97073
+ - python
97074
+ impact: MEDIUM
97075
+ confidence: LOW
97076
+ likelihood: HIGH
97077
+ - id: codacy.cpp.i18n.no-hardcoded-cout
97078
+ severity: WARNING
97079
+ languages:
97080
+ - cpp
97081
+ pattern: std::cout << "$MSG"
97082
+ message: >-
97083
+ Avoid hardcoded strings in std::cout. Use a localization function or resource bundle for user-facing output.
97084
+ metadata:
97085
+ category: codestyle
97086
+ subcategory: i18n
97087
+ description: Flags hardcoded string literals streamed directly to std::cout to enforce localization
97088
+ technology:
97089
+ - cpp
97090
+ impact: MEDIUM
97091
+ confidence: LOW
97092
+ likelihood: HIGH
97093
+ - id: codacy.cpp.i18n.no-hardcoded-strftime
97094
+ severity: WARNING
97095
+ languages:
97096
+ - cpp
97097
+ pattern-either:
97098
+ - pattern: std::strftime($BUF, $SIZE, "$FMT", $TIME);
97099
+ - pattern: strftime($BUF, $SIZE, "$FMT", $TIME);
97100
+ message: >-
97101
+ Avoid hardcoded date format strings in strftime. Use locale-aware date formatting (e.g., std::put_time with a locale-imbued stream).
97102
+ metadata:
97103
+ category: codestyle
97104
+ subcategory: i18n
97105
+ description: Flags hardcoded date format strings passed to strftime to enforce locale-aware date formatting
97106
+ technology:
97107
+ - cpp
97108
+ impact: MEDIUM
97109
+ confidence: HIGH
97110
+ likelihood: HIGH
97111
+ - id: codacy.cpp.i18n.no-hardcoded-number-format
97112
+ severity: WARNING
97113
+ languages:
97114
+ - cpp
97115
+ pattern: std::setprecision($N)
97116
+ message: >-
97117
+ Avoid using std::setprecision for user-visible number formatting. Imbue the stream with a locale and use std::use_facet<std::numpunct> for locale-aware output.
97118
+ metadata:
97119
+ category: codestyle
97120
+ subcategory: i18n
97121
+ description: Flags std::setprecision used for user-visible number formatting instead of locale-aware alternatives
97122
+ technology:
97123
+ - cpp
97124
+ impact: MEDIUM
97125
+ confidence: LOW
97126
+ likelihood: HIGH
97027
97127
  - id: codacy.bash.security.hard-coded-password
97028
97128
  languages:
97029
97129
  - bash
@@ -97329,7 +97429,7 @@ rules:
97329
97429
  - pattern-either:
97330
97430
  - pattern-regex: "(?i)^(?:(?!--).)*\\b\\w*language\\w*\\b\\s*(=|:=)\\s*'?\\b[A-Z]{2}\\b'?"
97331
97431
  - pattern-regex: "(?i)^(?:(?!--).)*\\b\\w*currency\\w*\\b\\s*(=|:=)\\s*'?\\b[A-Z]{3}\\b'?"
97332
- - pattern-regex: "(?i)^(?:(?!--).)*\\b(\\w*\\.)?org_id\\b\\s*(=|:=|IN|!=|<>)\\s*(\\(?\\s*'?\\d+'?(,\\s*'?\\d+'?)*\\s*\\)?)?"
97432
+ - pattern-regex: "(?i)^(?:(?!--).)*\\b(\\w*\\.)?org_id\\b\\s*(=|:=|IN|!=|<>)\\s*(\\(?\\s*'?\\d+'?(\\s*,\\s*'?\\d+'?)*\\s*\\)?)"
97333
97433
  paths:
97334
97434
  include:
97335
97435
  - "*.sql"
@@ -97555,7 +97655,7 @@ rules:
97555
97655
  - id: codacy.k8s.ingress.nginx.retirement.ingress-resource
97556
97656
  languages:
97557
97657
  - yaml
97558
- severity: WARNING
97658
+ severity: ERROR
97559
97659
  message: >
97560
97660
  This Ingress is configured to use the Ingress NGINX controller
97561
97661
  (kubernetes.io/ingress.class: nginx or ingressClassName: nginx).
@@ -97588,7 +97688,7 @@ rules:
97588
97688
  description: >
97589
97689
  Detects Ingress resources configured to use the Ingress NGINX controller.
97590
97690
  Ingress NGINX is scheduled for retirement (no fixes after March 2026).
97591
- impact: MEDIUM
97691
+ impact: HIGH
97592
97692
  confidence: HIGH
97593
97693
  references:
97594
97694
  - https://kubernetes.io/blog/2025/11/11/ingress-nginx-retirement/
@@ -97596,7 +97696,7 @@ rules:
97596
97696
  - id: codacy.k8s.ingress.nginx.retirement.ingress-class
97597
97697
  languages:
97598
97698
  - yaml
97599
- severity: WARNING
97699
+ severity: ERROR
97600
97700
  message: >
97601
97701
  This IngressClass is wired to the Ingress NGINX controller
97602
97702
  (spec.controller: k8s.io/ingress-nginx).
@@ -97615,14 +97715,14 @@ rules:
97615
97715
  description: >
97616
97716
  Detects IngressClass objects wired to the Ingress NGINX controller.
97617
97717
  Ingress NGINX is scheduled for retirement (no fixes after March 2026).
97618
- impact: MEDIUM
97718
+ impact: HIGH
97619
97719
  confidence: HIGH
97620
97720
  references:
97621
97721
  - https://kubernetes.io/blog/2025/11/11/ingress-nginx-retirement/
97622
97722
  - id: codacy.k8s.ingress.nginx.retirement.workload
97623
97723
  languages:
97624
97724
  - yaml
97625
- severity: WARNING
97725
+ severity: ERROR
97626
97726
  message: >
97627
97727
  This Kubernetes resource is labelled as part of the Ingress NGINX
97628
97728
  controller stack (app.kubernetes.io/name: ingress-nginx).
@@ -97644,7 +97744,7 @@ rules:
97644
97744
  description: >
97645
97745
  Detects Kubernetes resources labelled as part of the Ingress NGINX
97646
97746
  controller stack. Ingress NGINX is scheduled for retirement (no fixes after March 2026).
97647
- impact: MEDIUM
97747
+ impact: HIGH
97648
97748
  confidence: HIGH
97649
97749
  references:
97650
97750
  - https://kubernetes.io/blog/2025/11/11/ingress-nginx-retirement/