FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
codeql/python/ql/src/Statements/AssertOnTuple.ql at codeql-cli-2.11.3 · github/codeql · GitHub
github
/
codeql
Public
Notifications
You must be signed in to change notification settings
Fork
2.1k
Star
10.1k
Code
Issues
1k
Pull requests
468
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
codeql
/
python
/
ql
/
src
/
Statements
/
AssertOnTuple.ql
Copy path
More file actions
More file actions
Latest commit
History
History
History
27 lines (25 loc) · 624 Bytes
Breadcrumbs
codeql
/
python
/
ql
/
src
/
Statements
/
AssertOnTuple.ql
Copy path
File metadata and controls
27 lines (25 loc) · 624 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/**
* @name Asserting a tuple
* @description Using an assert statement to test a tuple provides no validity checking.
* @kind problem
* @tags reliability
* maintainability
* external/cwe/cwe-670
* @problem.severity error
* @sub-severity low
* @precision very-high
* @id py/asserts-tuple
*/
import
python
from
Assert
a
,
string
b
,
string
non
where
a
.
getTest
(
)
instanceof
Tuple
and
(
if
exists
(
a
.
getTest
(
)
.
(
Tuple
)
.
getAnElt
(
)
)
then
(
b
=
"True"
and
non
=
"non-"
)
else
(
b
=
"False"
and
non
=
""
)
)
select
a
,
"Assertion of "
+
non
+
"empty tuple is always "
+
b
+
"."
Back
|
FazBrowse Home
|
New Git URL