1
1
# Not OK
2
2
def simple (l = [0 ]):
3
- l [0 ] = 1 # FN
3
+ l [0 ] = 1 #$ MISSING: modification=l
4
4
return l
5
5
6
6
# Not OK
7
7
def slice (l = [0 ]):
8
- l [0 :1 ] = 1 # FN
8
+ l [0 :1 ] = 1 #$ MISSING: modification=l
9
9
return l
10
10
11
11
# Not OK
12
12
def list_del (l = [0 ]):
13
- del l [0 ] # FN
13
+ del l [0 ] #$ MISSING: modification=l
14
14
return l
15
15
16
16
# Not OK
17
17
def append_op (l = []):
18
- l += 1
18
+ l += 1 #$ modification=l
19
19
return l
20
20
21
21
# Not OK
22
22
def repeat_op (l = [0 ]):
23
- l *= 3
23
+ l *= 3 #$ modification=l
24
24
return l
25
25
26
26
# Not OK
27
27
def append (l = []):
28
- l .append (1 )
28
+ l .append (1 ) #$ modification=l
29
29
return l
30
30
31
31
# OK
@@ -36,7 +36,7 @@ def includes(l = []):
36
36
return x
37
37
38
38
def extends (l ):
39
- l .extend ([1 ])
39
+ l .extend ([1 ]) #$ modification=l
40
40
return l
41
41
42
42
# Not OK
@@ -46,17 +46,17 @@ def deferred(l = []):
46
46
47
47
# Not OK
48
48
def nonempty (l = [5 ]):
49
- l .append (1 )
49
+ l .append (1 ) #$ modification=l
50
50
return l
51
51
52
52
# Not OK
53
53
def dict (d = {}):
54
- d ['a' ] = 1 # FN
54
+ d ['a' ] = 1 #$ MISSING: modification=d
55
55
return d
56
56
57
57
# Not OK
58
58
def dict_nonempty (d = {'a' : 1 }):
59
- d ['a' ] = 2 # FN
59
+ d ['a' ] = 2 #$ MISSING: modification=d
60
60
return d
61
61
62
62
# OK
@@ -65,7 +65,7 @@ def dict_nonempty_nochange(d = {'a': 1}):
65
65
return d
66
66
67
67
def modifies (d ):
68
- d ['a' ] = 1 # FN
68
+ d ['a' ] = 1 #$ MISSING: modification=d
69
69
return d
70
70
71
71
# Not OK
@@ -75,21 +75,21 @@ def dict_deferred(d = {}):
75
75
76
76
# Not OK
77
77
def dict_method (d = {}):
78
- d .update ({'a' : 1 })
78
+ d .update ({'a' : 1 }) #$ modification=d
79
79
return d
80
80
81
81
# Not OK
82
82
def dict_method_nonempty (d = {'a' : 1 }):
83
- d .update ({'a' : 2 })
83
+ d .update ({'a' : 2 }) #$ modification=d
84
84
return d
85
85
86
86
# OK
87
87
def dict_method_nonempty_nochange (d = {'a' : 1 }):
88
- d .update ({'a' : 1 }) # FP
88
+ d .update ({'a' : 1 }) #$ SPURIOUS:modification=d
89
89
return d
90
90
91
91
def modifies_method (d ):
92
- d .update ({'a' : 1 })
92
+ d .update ({'a' : 1 }) #$ modification=d
93
93
return d
94
94
95
95
# Not OK
@@ -106,23 +106,23 @@ def dict_includes(d = {}):
106
106
107
107
# Not OK
108
108
def dict_del (d = {'a' : 1 }):
109
- del d ['a' ] # FN
109
+ del d ['a' ] #$ MISSING: modification=d
110
110
return d
111
111
112
112
# Not OK
113
113
def dict_update_op (d = {}):
114
114
x = {'a' : 1 }
115
- d |= x
115
+ d |= x #$ modification=d
116
116
return d
117
117
118
118
# OK
119
119
def dict_update_op_nochange (d = {}):
120
120
x = {}
121
- d |= x # FP
121
+ d |= x #$ SPURIOUS: modification=d
122
122
return d
123
123
124
124
# OK
125
125
def sanitizer (l = []):
126
126
if not l == []:
127
- l .append (1 ) # FP
127
+ l .append (1 ) #$ SPURIOUS: modification=l
128
128
return l
0 commit comments