Skip to content

Commit 2c6e7d3

Browse files
author
Sakshis
committed
modification in node-sequelize-empty-password-argument-javascript
1 parent e8eea54 commit 2c6e7d3

File tree

2 files changed

+49
-8
lines changed

2 files changed

+49
-8
lines changed

rules/javascript/security/node-sequelize-empty-password-argument-javascript.yml

+29-8
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,33 @@ utils:
4343
kind: string_fragment
4444
- any:
4545
- follows:
46-
stopBy: end
47-
kind: lexical_declaration
48-
has:
49-
stopBy: end
50-
kind: variable_declarator
51-
has:
5246
stopBy: end
53-
kind: identifier
54-
pattern: $E
47+
kind: lexical_declaration
48+
has:
49+
stopBy: end
50+
kind: variable_declarator
51+
all:
52+
- has:
53+
stopBy: neighbor
54+
kind: identifier
55+
- has:
56+
stopBy: neighbor
57+
kind: call_expression
58+
all:
59+
- has:
60+
stopBy: neighbor
61+
kind: identifier
62+
regex: '^require$'
63+
- has:
64+
stopBy: neighbor
65+
kind: arguments
66+
has:
67+
stopBy: neighbor
68+
kind: string
69+
has:
70+
stopBy: neighbor
71+
kind: string_fragment
72+
regex: '^sequelize$'
5573
- follows:
5674
stopBy: end
5775
kind: import_statement
@@ -72,6 +90,7 @@ utils:
7290
stopBy: end
7391
kind: identifier
7492
pattern: $E
93+
7594

7695
MATCH_BLANK_PASSWORD_WITH_INSTANCE:
7796
kind: identifier
@@ -174,3 +193,5 @@ rule:
174193
matches: MATCH_BLANK_PASSWORD
175194
- kind: identifier
176195
matches: MATCH_BLANK_PASSWORD_WITH_INSTANCE
196+
197+

tests/__snapshots__/node-sequelize-empty-password-argument-javascript-snapshot.yml

+20
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,26 @@ snapshots:
234234
style: secondary
235235
start: 6
236236
end: 15
237+
- source: require
238+
style: secondary
239+
start: 18
240+
end: 25
241+
- source: sequelize
242+
style: secondary
243+
start: 27
244+
end: 36
245+
- source: '''sequelize'''
246+
style: secondary
247+
start: 26
248+
end: 37
249+
- source: ('sequelize')
250+
style: secondary
251+
start: 25
252+
end: 38
253+
- source: require('sequelize')
254+
style: secondary
255+
start: 18
256+
end: 38
237257
- source: Sequelize = require('sequelize')
238258
style: secondary
239259
start: 6

0 commit comments

Comments
 (0)