forked from github/codeql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode.py
More file actions
49 lines (43 loc) · 684 Bytes
/
code.py
File metadata and controls
49 lines (43 loc) · 684 Bytes
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
def f_linear(x):
y = x
z = y
return z
def one_branch(x):
if x:
return 1
else:
return 2
def two_branch(x, y):
if x:
y += 1
else:
y += 2
if y:
return 1
else:
return 2
def nested(x, y):
if x:
if y:
return 0
else:
return 1
else:
if y:
return 2
else:
return 3
def exceptions(x, y):
try:
x.attr
x + y
x[y]
read()
except IOError:
pass
#ODASA-5114
def must_be_positive(self, obj, value):
try:
return int(value)
except:
self.error(obj, value)