QL tests for Python queries and libraries.

This commit is contained in:
Mark Shannon 2018-11-19 15:15:54 +00:00
Родитель 90c75cd362
Коммит 05b69a1c0f
1140 изменённых файлов: 32676 добавлений и 0 удалений

Просмотреть файл

Просмотреть файл

@ -0,0 +1,23 @@
/**
* @name UseFromDefinition
* @description Insert description here...
* @kind problem
* @problem.severity warning
*/
import python
/*Find any Definition, assigned value pairs that 'valueForDefinition' misses */
Expr assignedValue(Name n) {
exists(Assign a | a.getATarget() = n and result = a.getValue())
or
exists(Alias a | a.getAsname() = n and result = a.getValue())
}
from Name def, DefinitionNode d
where d = def.getAFlowNode() and
exists(assignedValue(def)) and
not d.getValue().getNode() = assignedValue(def)
select def.toString(), assignedValue(def)

Просмотреть файл

@ -0,0 +1,7 @@
| ControlFlowNode for Attribute | ControlFlowNode for Attribute | 8 |
| ControlFlowNode for Attribute | ControlFlowNode for Attribute | 22 |
| ControlFlowNode for Subscript | ControlFlowNode for Subscript | 9 |
| ControlFlowNode for Subscript | ControlFlowNode for Subscript | 23 |
| ControlFlowNode for v | ControlFlowNode for v | 28 |
| ControlFlowNode for x | ControlFlowNode for x | 7 |
| ControlFlowNode for x | ControlFlowNode for x | 21 |

Просмотреть файл

@ -0,0 +1,10 @@
import python
int lineof(ControlFlowNode f) {
result = f.getNode().getLocation().getStartLine()
}
from ControlFlowNode defn, ControlFlowNode use
where defn.getNode() = use.getNode()
and defn.isStore() and use.isLoad()
select defn.toString(), use.toString(), lineof(defn)

Просмотреть файл

@ -0,0 +1,61 @@
| 4 | test.py:4:5:4:9 | ControlFlowNode for func1 | store |
| 7 | test.py:7:5:7:5 | ControlFlowNode for x | aug load |
| 7 | test.py:7:5:7:5 | ControlFlowNode for x | aug store |
| 7 | test.py:7:10:7:10 | ControlFlowNode for f | load |
| 7 | test.py:7:12:7:12 | ControlFlowNode for y | load |
| 7 | test.py:7:16:7:20 | ControlFlowNode for Tuple | load |
| 8 | test.py:8:5:8:5 | ControlFlowNode for o | load |
| 8 | test.py:8:5:8:9 | ControlFlowNode for Attribute | load |
| 8 | test.py:8:5:8:14 | ControlFlowNode for Attribute | aug load |
| 8 | test.py:8:5:8:14 | ControlFlowNode for Attribute | aug store |
| 8 | test.py:8:19:8:19 | ControlFlowNode for f | load |
| 8 | test.py:8:21:8:21 | ControlFlowNode for y | load |
| 8 | test.py:8:25:8:29 | ControlFlowNode for Tuple | load |
| 9 | test.py:9:5:9:5 | ControlFlowNode for s | load |
| 9 | test.py:9:5:9:17 | ControlFlowNode for Subscript | aug load |
| 9 | test.py:9:5:9:17 | ControlFlowNode for Subscript | aug store |
| 9 | test.py:9:7:9:7 | ControlFlowNode for z | load |
| 9 | test.py:9:7:9:16 | ControlFlowNode for Tuple | load |
| 9 | test.py:9:22:9:22 | ControlFlowNode for f | load |
| 9 | test.py:9:24:9:24 | ControlFlowNode for y | load |
| 9 | test.py:9:28:9:32 | ControlFlowNode for Tuple | load |
| 10 | test.py:10:12:10:12 | ControlFlowNode for x | load |
| 13 | test.py:13:5:13:9 | ControlFlowNode for func2 | store |
| 14 | test.py:14:5:14:5 | ControlFlowNode for s | store |
| 14 | test.py:14:9:14:12 | ControlFlowNode for None | load |
| 15 | test.py:15:5:15:5 | ControlFlowNode for o | store |
| 15 | test.py:15:9:15:12 | ControlFlowNode for None | load |
| 16 | test.py:16:5:16:5 | ControlFlowNode for x | store |
| 16 | test.py:16:9:16:12 | ControlFlowNode for None | load |
| 17 | test.py:17:5:17:5 | ControlFlowNode for y | store |
| 17 | test.py:17:9:17:12 | ControlFlowNode for None | load |
| 18 | test.py:18:5:18:5 | ControlFlowNode for z | store |
| 18 | test.py:18:9:18:12 | ControlFlowNode for None | load |
| 21 | test.py:21:5:21:5 | ControlFlowNode for x | aug load |
| 21 | test.py:21:5:21:5 | ControlFlowNode for x | aug store |
| 21 | test.py:21:10:21:10 | ControlFlowNode for f | load |
| 21 | test.py:21:12:21:12 | ControlFlowNode for y | load |
| 21 | test.py:21:16:21:20 | ControlFlowNode for Tuple | load |
| 22 | test.py:22:5:22:5 | ControlFlowNode for o | load |
| 22 | test.py:22:5:22:9 | ControlFlowNode for Attribute | load |
| 22 | test.py:22:5:22:14 | ControlFlowNode for Attribute | aug load |
| 22 | test.py:22:5:22:14 | ControlFlowNode for Attribute | aug store |
| 22 | test.py:22:19:22:19 | ControlFlowNode for f | load |
| 22 | test.py:22:21:22:21 | ControlFlowNode for y | load |
| 22 | test.py:22:25:22:29 | ControlFlowNode for Tuple | load |
| 23 | test.py:23:5:23:5 | ControlFlowNode for s | load |
| 23 | test.py:23:5:23:17 | ControlFlowNode for Subscript | aug load |
| 23 | test.py:23:5:23:17 | ControlFlowNode for Subscript | aug store |
| 23 | test.py:23:7:23:7 | ControlFlowNode for z | load |
| 23 | test.py:23:7:23:16 | ControlFlowNode for Tuple | load |
| 23 | test.py:23:22:23:22 | ControlFlowNode for f | load |
| 23 | test.py:23:24:23:24 | ControlFlowNode for y | load |
| 23 | test.py:23:28:23:32 | ControlFlowNode for Tuple | load |
| 24 | test.py:24:12:24:12 | ControlFlowNode for x | load |
| 27 | test.py:27:5:27:8 | ControlFlowNode for comp | store |
| 28 | test.py:28:5:28:5 | ControlFlowNode for v | aug load |
| 28 | test.py:28:5:28:5 | ControlFlowNode for v | aug store |
| 28 | test.py:28:10:28:10 | ControlFlowNode for a | load |
| 28 | test.py:28:15:28:18 | ControlFlowNode for cond | load |
| 28 | test.py:28:25:28:25 | ControlFlowNode for b | load |
| 29 | test.py:29:12:29:12 | ControlFlowNode for v | load |

Просмотреть файл

@ -0,0 +1,21 @@
import python
string kind(ControlFlowNode f) {
if f.isAugLoad() then
result = "aug load"
else (
if f.isAugStore() then
result = "aug store"
else (
if f.isLoad() then
result = "load"
else (
f.isStore() and result = "store"
)
)
)
}
from ControlFlowNode cfg
select cfg.getLocation().getStartLine(), cfg, kind(cfg)

Просмотреть файл

@ -0,0 +1,3 @@
| ControlFlowNode for v | 28 |
| ControlFlowNode for x | 7 |
| ControlFlowNode for x | 21 |

Просмотреть файл

@ -0,0 +1,13 @@
/**
* @name SSA
* @description Insert description here...
* @kind problem
* @problem.severity warning
*/
import python
from ControlFlowNode defn, SsaVariable v, AugAssign a, BinaryExpr b
where v.getDefinition() = defn and a.getOperation() = b and b.contains((Expr)defn.getNode())
select defn.toString(), defn.getNode().getLocation().getStartLine()

Просмотреть файл

@ -0,0 +1,29 @@
#Test flow control for augmented assignment statements:
#Parameters
def func1(s, o, x, y, z):
#Note that the right hand sides should be sufficiently complex
#to make the parts of the statement sufficiently separated
x += f(y, (1,2,3))
o.val.item += f(y, (1,2,3))
s[z, 10, 1:3] += f(y, (1,2,3))
return x
#Local variables
def func2():
s = None
o = None
x = None
y = None
z = None
#Note that the right hand sides should be sufficiently complex
#to make the parts of the statement sufficiently separated
x += f(y, (1,2,3))
o.val.item += f(y, (1,2,3))
s[z, 10, 1:3] += f(y, (1,2,3))
return x
#Complex flow
def comp(v, cond):
v += a if cond else b
return v

Просмотреть файл

@ -0,0 +1,6 @@
| 1 | ControlFlowNode for Compare | a | b | == |
| 2 | ControlFlowNode for Compare | c | d | > |
| 3 | ControlFlowNode for Compare | e | f | < |
| 4 | ControlFlowNode for Compare | g | h | >= |
| 5 | ControlFlowNode for Compare | i | j | <= |
| 6 | ControlFlowNode for Compare | k | l | != |

Просмотреть файл

@ -0,0 +1,17 @@
/**
* @name CompareTest
* @description CompareTest
* @kind problem
* @problem.severity warning
*/
import python
from CompareNode c, NameNode l, NameNode r, Cmpop op, int line, Variable vl, Variable vr
where c.operands(l, op, r) and
line = c.getLocation().getStartLine() and
line = l.getLocation().getStartLine() and
line = r.getLocation().getStartLine() and
l.uses(vl) and r.uses(vr)
select line, c.toString(), vl.getId(), vr.getId(), op.getSymbol()

Просмотреть файл

@ -0,0 +1,6 @@
a == b
c > d
e < f
g >= h
i <= j
k != l

Просмотреть файл

@ -0,0 +1,16 @@
| 0 | Entry node for Module test | 1 | ControlFlowNode for FunctionExpr |
| 1 | ControlFlowNode for FunctionExpr | 1 | ControlFlowNode for foo |
| 1 | ControlFlowNode for a | 1 | ControlFlowNode for b |
| 1 | ControlFlowNode for b | 1 | ControlFlowNode for c |
| 1 | ControlFlowNode for c | 2 | ControlFlowNode for a |
| 1 | ControlFlowNode for foo | 0 | Exit node for Module test |
| 1 | Entry node for Function foo | 1 | ControlFlowNode for a |
| 2 | ControlFlowNode for Attribute | 2 | ControlFlowNode for Delete |
| 2 | ControlFlowNode for Delete | 3 | ControlFlowNode for a |
| 2 | ControlFlowNode for a | 2 | ControlFlowNode for Attribute |
| 3 | ControlFlowNode for Delete | 3 | ControlFlowNode for b |
| 3 | ControlFlowNode for Delete | 4 | ControlFlowNode for c |
| 3 | ControlFlowNode for a | 3 | ControlFlowNode for Delete |
| 3 | ControlFlowNode for b | 3 | ControlFlowNode for Delete |
| 4 | ControlFlowNode for Delete | 1 | Exit node for Function foo |
| 4 | ControlFlowNode for c | 4 | ControlFlowNode for Delete |

Просмотреть файл

@ -0,0 +1,4 @@
def foo(a, b, c):
del a.x
del a, b
del c

Просмотреть файл

@ -0,0 +1,5 @@
import python
from ControlFlowNode p, ControlFlowNode s
where p.getASuccessor() = s
select p.getLocation().getStartLine().toString(), p.toString(), s.getLocation().getStartLine(), s.toString()

Просмотреть файл

@ -0,0 +1 @@
| 0 | 0 |

Просмотреть файл

@ -0,0 +1,9 @@
import python
select count(BasicBlock b1, BasicBlock b2
| b1 = b2.getImmediateDominator+() and not b1.strictlyDominates(b2)
),
count(BasicBlock b1, BasicBlock b2
| not b1 = b2.getImmediateDominator+() and b1.strictlyDominates(b2)
)

Просмотреть файл

Просмотреть файл

@ -0,0 +1,16 @@
/**
* @name Check all non-scope nodes have an immediate dominator
* @description Check all non-scope nodes have an immediate dominator
* @kind problem
* @problem.severity warning
*/
import python
/* This query should *never* produce a result */
from ControlFlowNode f
where not exists(f.getImmediateDominator())
and not f.getNode() instanceof Scope
select f

Просмотреть файл

@ -0,0 +1,37 @@
def f():
while 0:
pass
return 1
def g():
while 1:
pass
return unreachable
def h(x):
if x:
return x
else:
return None
def k(a, b):
for x in a or b:
pass
return 0
def l(a, b, c):
if a or b or c:
return a or b or c
else:
return None
def m(a, b, c):
if a and b and c:
return a and b and c
else:
return None

Просмотреть файл

@ -0,0 +1,9 @@
| e2 |
| e3 |
| e5 |
| e6 |
| e8 |
| ec |
| ed |
| ee |
| ef |

Просмотреть файл

@ -0,0 +1,106 @@
#Ensure there is an exceptional edge from the following case
def f2():
b, d = Base, Derived
try:
class MyNewClass(b, d):
pass
except:
e2
def f3():
sequence_of_four = a_global
try:
a, b, c = sequence_of_four
except:
e3
#Always treat locals as non-raising to keep DB size down.
def f4():
if cond:
local = 1
try:
local
except:
e4
def f5():
try:
a_global
except:
e5
def f6():
local = a_global
try:
local()
except:
e6
#Literals can't raise
def f7():
try:
4
except:
e7
def f8():
try:
a + b
except:
e8
#OK assignments
def f9():
try:
a, b = 1, 2
except:
e9
def fa():
seq = a_global
try:
a = seq
except:
ea
def fb():
a, b, c = a_global
try:
seq = a, b, c
except:
eb
#Ensure that a.b and c[d] can raise
def fc():
a, b = a_global
try:
return a[b]
except:
ec
def fd():
a = a_global
try:
return a.b
except:
ed
def fe():
try:
call()
except:
ee
else:
ef

Просмотреть файл

@ -0,0 +1,5 @@
import python
from GlobalVariable v, Name n, ControlFlowNode f
where v.getId().charAt(0) = "e" and n.uses(v) and f.getNode() = n
select v.getId()

Просмотреть файл

@ -0,0 +1 @@
| Module flowtest | 5 |

Просмотреть файл

@ -0,0 +1,6 @@
import python
from Module m, int n
where n = m.getMetrics().getNumberOfLinesOfComments()
select m.toString(), n

Просмотреть файл

@ -0,0 +1,9 @@
| Function definitions | 2 |
| Function deletion | 1 |
| Function gloop | 2 |
| Function if_else | 2 |
| Function lloop | 2 |
| Function normal_args | 1 |
| Function special_args | 1 |
| Function try_except | 4 |
| Function try_finally | 2 |

Просмотреть файл

@ -0,0 +1,6 @@
import python
from Function func
select func.toString(), func.getMetrics().getCyclomaticComplexity()

Просмотреть файл

Просмотреть файл

@ -0,0 +1,16 @@
import python
predicate
can_reach_from_entry_without_passing(ControlFlowNode target, ControlFlowNode pass) {
target != pass and target.getScope() = pass.getScope() and
(target.isEntryNode() or
exists(ControlFlowNode pre | target.getAPredecessor() = pre and can_reach_from_entry_without_passing(pre, pass)))
}
from ControlFlowNode node, ControlFlowNode dom
where dom = node.getImmediateDominator()
and
can_reach_from_entry_without_passing(node, dom)
select node.toString(), dom.toString()

Просмотреть файл

@ -0,0 +1,10 @@
| Function definitions | 13 |
| Function deletion | 7 |
| Function gloop | 6 |
| Function if_else | 6 |
| Function lloop | 4 |
| Function normal_args | 3 |
| Function special_args | 4 |
| Function try_except | 7 |
| Function try_finally | 7 |
| Module flowtest | 70 |

Просмотреть файл

@ -0,0 +1,7 @@
import python
from Scope s, int n
where exists(Function f | f = s | n = f.getMetrics().getNumberOfLines()) or
exists(Module m | m = s | n = m.getMetrics().getNumberOfLines())
select s.toString(), n

Просмотреть файл

@ -0,0 +1,19 @@
| ExceptionL |
| ExceptionR |
| cond1 |
| cond2 |
| except_handler |
| fall_through1 |
| fall_through2 |
| final_body |
| g1 |
| g2 |
| g3 |
| g5 |
| left |
| merged |
| right |
| try_body1 |
| try_body2 |
| try_body3 |
| try_body4 |

Просмотреть файл

@ -0,0 +1,13 @@
import python
predicate reaches_exit(Name u) {
u.uses(_) and
exists(ControlFlowNode f, BasicBlock b |
f.getNode() = u and f.getBasicBlock() = b |
b.reachesExit()
)
}
from Name u
where reaches_exit(u) and u.getVariable() instanceof GlobalVariable
select u.toString()

Просмотреть файл

@ -0,0 +1,73 @@
def definitions(p1): # Multiple defns of same variable
v1 = 0
v1
v1 = 1
v1
v2 = 2
if p1:
v1 = 1
v2 = 2
else:
v2 = 2
v1
v2
def lloop(): #Loop
v3 = 0
while 1:
v3
def gloop(): #Loop and global
global d1
d1 = 0
g1
while g2:
g3
def deletion():
global g4
del g4
g5
v4 = 0
del v4
v4
def if_else():
if cond1:
left
else:
right
merged
def try_except():
try:
try_body1()
try_body2()
except ExceptionL if cond2 else ExceptionR:
except_handler
fall_through1
def try_finally():
try:
try_body3()
try_body4()
finally:
final_body
fall_through2
def normal_args(arg0, arg1):
arg0
arg1
def special_args(*vararg, **kwarg):
vararg
kwarg
#A comment
#at the end of the file

Просмотреть файл

@ -0,0 +1,45 @@
| 5 | 0 |
| 11 | 0 |
| 18 | 1 |
| 24 | 0 |
| 25 | 1 |
| 29 | 1 |
| 30 | 0 |
| 32 | 1 |
| 33 | 1 |
| 34 | 1 |
| 35 | 1 |
| 37 | 0 |
| 38 | 1 |
| 39 | 0 |
| 40 | 1 |
| 48 | 0 |
| 49 | 1 |
| 51 | 1 |
| 52 | 1 |
| 61 | 1 |
| 64 | 1 |
| 72 | 1 |
| 75 | 1 |
| 82 | 1 |
| 94 | 0 |
| 96 | 0 |
| 103 | 0 |
| 112 | 1 |
| 114 | 1 |
| 120 | 0 |
| 127 | 1 |
| 131 | 0 |
| 133 | 1 |
| 135 | 0 |
| 137 | 1 |
| 139 | 1 |
| 141 | 0 |
| 143 | 0 |
| 145 | 1 |
| 147 | 1 |
| 149 | 0 |
| 152 | 0 |
| 154 | 1 |
| 161 | 1 |
| 163 | 1 |

Просмотреть файл

@ -0,0 +1,164 @@
#Test number of CFG nodes for each use of 'count'
def dead():
return 0
count
def conditional_dead(test):
if test:
return
if test:
count
def made_true(seq):
if seq:
return
seq.append(1)
if seq:
count
def boolop(t1, t2, t3, t4, t5, t6):
if not t1:
return
#bool(t1) must be True
t1 or count
t1 and count
if t2:
return
#bool(t2) must be False
t2 or count
t2 and count
if t3 or t4:
t3 or count
t3 and count
t3 or count
t4 and count
if t5 and t6:
t5 or count
t5 and count
t6 or count
t6 and count
def with_splitting(t1, t2):
if t1:
if not t2:
return
#Cannot have bool(t1) be True and bool(t2) be False
if t1:
t2 or count #Unreachable
t2 and count
else:
t2 or count
t2 and count
def loops(seq1, seq2, seq3, seq4, seq5):
if seq1:
return
if not seq2:
return
#bool(seq1) is False; bool(seq2) is True
while seq1:
count #This is unreachable, but the pop below forces us to be conservative.
seq1.pop()
while seq2:
count
seq2.pop()
if seq3:
return
if not seq4:
return
#bool(seq3) is False; bool(seq4) is True
for var in seq3:
count #This is unreachable, but we cannot infer this yet.
print(var)
for var in seq4:
count
print(var)
#seq5 false then made true
if seq5:
return
seq5.append(1)
for var in seq5:
count
print(var)
#Logic does not apply to global variables in calls,
#as they may be changed from true to false externally.
from some_module import x, y
if not x:
raise Exception()
if y:
raise Exception()
make_a_call()
if not x:
count
if y:
count
# However, modules are always true -- Which is important.
import another_module
make_a_call()
if not another_module:
count
def negated_conditional_live(t1, t2):
if not t1:
return
if t2:
return
if t1:
count
if not t2:
count
def negated_conditional_dead(test):
if not test:
return
if not test:
count
def made_true2(m):
if m:
return
del m['a']
if m:
count
def prune_const_branches():
if None:
count
if not None:
count
if False:
count
else:
count
if True:
count
else:
count
if 0:
count
else:
count
if -4:
count
else:
count
#Muliptle nots
if not not False:
count
if not not not False:
count
#ODASA-6794
def attribute_lookup_cannot_effect_comparisons_with_immutable_constants(ps):
if ps is not None:
ps_clamped = ps.clamp()
if ps is None:
count
else:
count

Просмотреть файл

@ -0,0 +1,5 @@
import python
from Name n
where n.getId() = "count"
select n.getLocation().getStartLine(), count(n.getAFlowNode())

Просмотреть файл

@ -0,0 +1,99 @@
| 5 | ControlFlowNode for ImportExpr | normal | 5 | test.py:5:1:5:16 | ControlFlowNode for from _s import * |
| 5 | ControlFlowNode for from _s import * | normal | 7 | test.py:7:1:7:8 | ControlFlowNode for FunctionExpr |
| 7 | ControlFlowNode for FunctionExpr | normal | 7 | test.py:7:5:7:5 | ControlFlowNode for f |
| 7 | ControlFlowNode for f | normal | 15 | test.py:15:1:15:8 | ControlFlowNode for FunctionExpr |
| 8 | ControlFlowNode for ImportExpr | normal | 8 | test.py:8:12:8:12 | ControlFlowNode for x |
| 8 | ControlFlowNode for x | normal | 9 | test.py:9:10:9:10 | ControlFlowNode for ImportExpr |
| 9 | ControlFlowNode for ImportExpr | normal | 9 | test.py:9:19:9:19 | ControlFlowNode for ImportMember |
| 9 | ControlFlowNode for ImportMember | normal | 9 | test.py:9:19:9:19 | ControlFlowNode for b |
| 9 | ControlFlowNode for b | normal | 10 | test.py:10:9:10:12 | ControlFlowNode for AA_s |
| 10 | ControlFlowNode for AA_s | normal | 10 | test.py:10:14:10:14 | ControlFlowNode for IntegerLiteral |
| 10 | ControlFlowNode for Delete | normal | 12 | test.py:12:18:12:21 | ControlFlowNode for AA_p |
| 10 | ControlFlowNode for IntegerLiteral | normal | 10 | test.py:10:9:10:15 | ControlFlowNode for Subscript |
| 10 | ControlFlowNode for Subscript | normal | 10 | test.py:10:5:10:15 | ControlFlowNode for Delete |
| 12 | ControlFlowNode for AA_p | normal | 12 | test.py:12:5:12:14 | ControlFlowNode for Tuple |
| 12 | ControlFlowNode for AA_q | normal | 12 | test.py:12:11:12:14 | ControlFlowNode for AA_r |
| 12 | ControlFlowNode for AA_r | normal | 13 | test.py:13:12:13:15 | ControlFlowNode for AA_c |
| 12 | ControlFlowNode for Tuple | normal | 12 | test.py:12:5:12:8 | ControlFlowNode for AA_q |
| 13 | ControlFlowNode for AA_c | normal | 13 | test.py:13:20:13:23 | ControlFlowNode for AA_d |
| 13 | ControlFlowNode for AA_d | normal | 13 | test.py:13:12:13:23 | ControlFlowNode for Compare |
| 13 | ControlFlowNode for Compare | normal | 13 | test.py:13:5:13:23 | ControlFlowNode for Assert |
| 13 | ControlFlowNode for Compare | normal | 13 | test.py:13:5:13:23 | ControlFlowNode for Assert |
| 15 | ControlFlowNode for FunctionExpr | normal | 15 | test.py:15:5:15:5 | ControlFlowNode for g |
| 15 | ControlFlowNode for g | normal | 26 | test.py:26:1:26:8 | ControlFlowNode for FunctionExpr |
| 16 | ControlFlowNode for Try | normal | 17 | test.py:17:16:17:16 | ControlFlowNode for ImportExpr |
| 17 | ControlFlowNode for ImportExpr | normal | 17 | test.py:17:16:17:16 | ControlFlowNode for x |
| 17 | ControlFlowNode for ImportExpr | exception | 23 | test.py:23:5:23:11 | ControlFlowNode for ExceptStmt |
| 17 | ControlFlowNode for x | normal | 18 | test.py:18:14:18:14 | ControlFlowNode for ImportExpr |
| 18 | ControlFlowNode for ImportExpr | normal | 18 | test.py:18:23:18:23 | ControlFlowNode for ImportMember |
| 18 | ControlFlowNode for ImportExpr | exception | 23 | test.py:23:5:23:11 | ControlFlowNode for ExceptStmt |
| 18 | ControlFlowNode for ImportMember | normal | 18 | test.py:18:23:18:23 | ControlFlowNode for b |
| 18 | ControlFlowNode for ImportMember | exception | 23 | test.py:23:5:23:11 | ControlFlowNode for ExceptStmt |
| 18 | ControlFlowNode for b | normal | 19 | test.py:19:13:19:16 | ControlFlowNode for AA_s |
| 19 | ControlFlowNode for AA_s | normal | 19 | test.py:19:18:19:18 | ControlFlowNode for IntegerLiteral |
| 19 | ControlFlowNode for AA_s | exception | 23 | test.py:23:5:23:11 | ControlFlowNode for ExceptStmt |
| 19 | ControlFlowNode for Delete | normal | 21 | test.py:21:22:21:25 | ControlFlowNode for AA_p |
| 19 | ControlFlowNode for IntegerLiteral | normal | 19 | test.py:19:13:19:19 | ControlFlowNode for Subscript |
| 19 | ControlFlowNode for Subscript | normal | 19 | test.py:19:9:19:19 | ControlFlowNode for Delete |
| 19 | ControlFlowNode for Subscript | exception | 23 | test.py:23:5:23:11 | ControlFlowNode for ExceptStmt |
| 21 | ControlFlowNode for AA_p | normal | 21 | test.py:21:9:21:18 | ControlFlowNode for Tuple |
| 21 | ControlFlowNode for AA_p | exception | 23 | test.py:23:5:23:11 | ControlFlowNode for ExceptStmt |
| 21 | ControlFlowNode for AA_q | normal | 21 | test.py:21:15:21:18 | ControlFlowNode for AA_r |
| 21 | ControlFlowNode for AA_r | normal | 22 | test.py:22:16:22:19 | ControlFlowNode for AA_c |
| 21 | ControlFlowNode for Tuple | normal | 21 | test.py:21:9:21:12 | ControlFlowNode for AA_q |
| 21 | ControlFlowNode for Tuple | exception | 23 | test.py:23:5:23:11 | ControlFlowNode for ExceptStmt |
| 22 | ControlFlowNode for AA_c | normal | 22 | test.py:22:24:22:27 | ControlFlowNode for AA_d |
| 22 | ControlFlowNode for AA_c | exception | 23 | test.py:23:5:23:11 | ControlFlowNode for ExceptStmt |
| 22 | ControlFlowNode for AA_d | normal | 22 | test.py:22:16:22:27 | ControlFlowNode for Compare |
| 22 | ControlFlowNode for AA_d | exception | 23 | test.py:23:5:23:11 | ControlFlowNode for ExceptStmt |
| 22 | ControlFlowNode for Assert | exception | 23 | test.py:23:5:23:11 | ControlFlowNode for ExceptStmt |
| 22 | ControlFlowNode for Compare | normal | 22 | test.py:22:9:22:27 | ControlFlowNode for Assert |
| 22 | ControlFlowNode for Compare | normal | 22 | test.py:22:9:22:27 | ControlFlowNode for Assert |
| 23 | ControlFlowNode for ExceptStmt | normal | 24 | test.py:24:9:24:12 | ControlFlowNode for Pass |
| 26 | ControlFlowNode for FunctionExpr | normal | 26 | test.py:26:5:26:5 | ControlFlowNode for h |
| 26 | ControlFlowNode for h | normal | 34 | test.py:34:1:34:8 | ControlFlowNode for FunctionExpr |
| 27 | ControlFlowNode for Try | normal | 28 | test.py:28:9:28:14 | ControlFlowNode for a_call |
| 28 | ControlFlowNode for a_call | normal | 28 | test.py:28:9:28:16 | ControlFlowNode for a_call() |
| 28 | ControlFlowNode for a_call | exception | 29 | test.py:29:5:29:11 | ControlFlowNode for ExceptStmt |
| 28 | ControlFlowNode for a_call() | normal | 32 | test.py:32:9:32:12 | ControlFlowNode for Pass |
| 28 | ControlFlowNode for a_call() | exception | 29 | test.py:29:5:29:11 | ControlFlowNode for ExceptStmt |
| 29 | ControlFlowNode for ExceptStmt | normal | 30 | test.py:30:16:30:19 | ControlFlowNode for AA_c |
| 30 | ControlFlowNode for AA_c | normal | 30 | test.py:30:24:30:27 | ControlFlowNode for AA_d |
| 30 | ControlFlowNode for AA_c | exception | 32 | test.py:32:9:32:12 | ControlFlowNode for Pass |
| 30 | ControlFlowNode for AA_d | normal | 30 | test.py:30:16:30:27 | ControlFlowNode for Compare |
| 30 | ControlFlowNode for AA_d | exception | 32 | test.py:32:9:32:12 | ControlFlowNode for Pass |
| 30 | ControlFlowNode for Assert | normal | 32 | test.py:32:9:32:12 | ControlFlowNode for Pass |
| 30 | ControlFlowNode for Assert | exception | 32 | test.py:32:9:32:12 | ControlFlowNode for Pass |
| 30 | ControlFlowNode for Compare | normal | 30 | test.py:30:9:30:27 | ControlFlowNode for Assert |
| 30 | ControlFlowNode for Compare | normal | 30 | test.py:30:9:30:27 | ControlFlowNode for Assert |
| 34 | ControlFlowNode for FunctionExpr | normal | 34 | test.py:34:5:34:5 | ControlFlowNode for k |
| 34 | ControlFlowNode for k | normal | 45 | test.py:45:1:45:19 | ControlFlowNode for FunctionExpr |
| 35 | ControlFlowNode for Try | normal | 37 | test.py:37:13:37:13 | ControlFlowNode for y |
| 37 | ControlFlowNode for x | normal | 38 | test.py:38:16:38:16 | ControlFlowNode for a |
| 37 | ControlFlowNode for y | normal | 37 | test.py:37:9:37:9 | ControlFlowNode for x |
| 37 | ControlFlowNode for y | exception | 41 | test.py:41:5:41:11 | ControlFlowNode for ExceptStmt |
| 38 | ControlFlowNode for Tuple | normal | 38 | test.py:38:9:38:9 | ControlFlowNode for c |
| 38 | ControlFlowNode for Tuple | normal | 38 | test.py:38:9:38:12 | ControlFlowNode for Tuple |
| 38 | ControlFlowNode for a | normal | 38 | test.py:38:19:38:19 | ControlFlowNode for b |
| 38 | ControlFlowNode for a | exception | 41 | test.py:41:5:41:11 | ControlFlowNode for ExceptStmt |
| 38 | ControlFlowNode for b | normal | 38 | test.py:38:16:38:19 | ControlFlowNode for Tuple |
| 38 | ControlFlowNode for b | exception | 41 | test.py:41:5:41:11 | ControlFlowNode for ExceptStmt |
| 38 | ControlFlowNode for c | normal | 38 | test.py:38:12:38:12 | ControlFlowNode for d |
| 38 | ControlFlowNode for d | normal | 40 | test.py:40:16:40:16 | ControlFlowNode for p |
| 40 | ControlFlowNode for Tuple | normal | 40 | test.py:40:9:40:9 | ControlFlowNode for q |
| 40 | ControlFlowNode for Tuple | exception | 41 | test.py:41:5:41:11 | ControlFlowNode for ExceptStmt |
| 40 | ControlFlowNode for p | normal | 40 | test.py:40:9:40:12 | ControlFlowNode for Tuple |
| 40 | ControlFlowNode for p | exception | 41 | test.py:41:5:41:11 | ControlFlowNode for ExceptStmt |
| 40 | ControlFlowNode for q | normal | 40 | test.py:40:12:40:12 | ControlFlowNode for r |
| 41 | ControlFlowNode for ExceptStmt | normal | 42 | test.py:42:9:42:12 | ControlFlowNode for Pass |
| 45 | ControlFlowNode for FunctionExpr | normal | 45 | test.py:45:5:45:13 | ControlFlowNode for odasa3686 |
| 45 | ControlFlowNode for obj | normal | 47 | test.py:47:9:47:12 | ControlFlowNode for Try |
| 47 | ControlFlowNode for Try | normal | 48 | test.py:48:13:48:16 | ControlFlowNode for None |
| 48 | ControlFlowNode for Compare | normal | 49 | test.py:49:20:49:23 | ControlFlowNode for True |
| 48 | ControlFlowNode for Compare | exception | 50 | test.py:50:9:50:25 | ControlFlowNode for ExceptStmt |
| 48 | ControlFlowNode for None | normal | 48 | test.py:48:21:48:23 | ControlFlowNode for obj |
| 48 | ControlFlowNode for obj | normal | 48 | test.py:48:13:48:23 | ControlFlowNode for Compare |
| 49 | ControlFlowNode for True | normal | 49 | test.py:49:13:49:23 | ControlFlowNode for Return |
| 50 | ControlFlowNode for ExceptStmt | normal | 50 | test.py:50:16:50:24 | ControlFlowNode for TypeError |
| 50 | ControlFlowNode for TypeError | normal | 51 | test.py:51:20:51:24 | ControlFlowNode for False |
| 51 | ControlFlowNode for False | normal | 51 | test.py:51:13:51:24 | ControlFlowNode for Return |

Просмотреть файл

@ -0,0 +1,17 @@
/**
* @name Raising Flow
* @description Test
*/
import python
from ControlFlowNode p, ControlFlowNode s, string kind
where p.getASuccessor() = s and
(if s = p.getAnExceptionalSuccessor() then
kind = "exception"
else
kind = " normal "
) and
not p.getNode() instanceof Scope and
not s.getNode() instanceof Scope
select p.getNode().getLocation().getStartLine(), p.toString(), kind, s.getNode().getLocation().getStartLine(), s

Просмотреть файл

@ -0,0 +1,51 @@
#All variables that will evaluate before statements start with "AA_"
#so that the test output better reflects the execution order and makes
#it easier to manually verify.
from _s import *
def f():
import x
from a import b
del AA_s[0]
AA_q, AA_r = AA_p
assert AA_c == AA_d
def g():
try:
import x
from a import b
del AA_s[0]
AA_q, AA_r = AA_p
assert AA_c == AA_d
except:
pass
def h():
try:
a_call()
except:
assert AA_c == AA_d
finally:
pass
def k():
try:
#Safe
x = y
c, d = a, b
#Unsafe
q, r = p
except:
pass
def odasa3686(obj):
#Test for iterability
try:
None in obj
return True
except TypeError:
return False

Просмотреть файл

@ -0,0 +1,565 @@
| 2 | split1 | test.py:2:12:2:15 | cond | 1 |
| 3 | split1 | test.py:3:8:3:11 | cond | 1 |
| 4 | split1 | test.py:4:9:4:12 | Pass | 1 |
| 5 | split1 | test.py:5:8:5:11 | cond | 2 |
| 6 | split1 | test.py:6:9:6:12 | Pass | 1 |
| 8 | dont_split1 | test.py:8:17:8:20 | cond | 1 |
| 9 | dont_split1 | test.py:9:8:9:11 | cond | 1 |
| 10 | dont_split1 | test.py:10:9:10:12 | Pass | 1 |
| 11 | dont_split1 | test.py:11:5:11:8 | cond | 1 |
| 11 | dont_split1 | test.py:11:12:11:12 | f | 1 |
| 11 | dont_split1 | test.py:11:12:11:14 | f() | 1 |
| 12 | dont_split1 | test.py:12:8:12:11 | cond | 1 |
| 13 | dont_split1 | test.py:13:9:13:12 | Pass | 1 |
| 15 | dont_split2 | test.py:15:17:15:20 | cond | 1 |
| 16 | dont_split2 | test.py:16:8:16:11 | cond | 1 |
| 17 | dont_split2 | test.py:17:9:17:12 | Pass | 1 |
| 18 | dont_split2 | test.py:18:5:18:20 | For | 1 |
| 18 | dont_split2 | test.py:18:9:18:12 | cond | 1 |
| 18 | dont_split2 | test.py:18:17:18:19 | seq | 1 |
| 18 | dont_split2 | test.py:18:22:18:25 | Pass | 1 |
| 19 | dont_split2 | test.py:19:8:19:11 | cond | 1 |
| 20 | dont_split2 | test.py:20:9:20:12 | Pass | 1 |
| 24 | split2 | test.py:24:5:24:8 | Try | 1 |
| 25 | split2 | test.py:25:9:25:12 | call | 1 |
| 25 | split2 | test.py:25:9:25:14 | call() | 1 |
| 26 | split2 | test.py:26:9:26:9 | x | 1 |
| 26 | split2 | test.py:26:13:26:16 | True | 1 |
| 27 | split2 | test.py:27:5:27:11 | ExceptStmt | 1 |
| 28 | split2 | test.py:28:9:28:9 | x | 1 |
| 28 | split2 | test.py:28:13:28:17 | False | 1 |
| 29 | split2 | test.py:29:8:29:8 | x | 2 |
| 30 | split2 | test.py:30:9:30:12 | Pass | 1 |
| 33 | unclear_split3 | test.py:33:5:33:8 | Try | 1 |
| 34 | unclear_split3 | test.py:34:9:34:12 | call | 1 |
| 34 | unclear_split3 | test.py:34:9:34:14 | call() | 1 |
| 35 | unclear_split3 | test.py:35:9:35:9 | x | 1 |
| 35 | unclear_split3 | test.py:35:13:35:16 | True | 1 |
| 36 | unclear_split3 | test.py:36:5:36:11 | ExceptStmt | 1 |
| 37 | unclear_split3 | test.py:37:9:37:9 | x | 1 |
| 37 | unclear_split3 | test.py:37:13:37:17 | False | 1 |
| 38 | unclear_split3 | test.py:38:8:38:11 | cond | 1 |
| 39 | unclear_split3 | test.py:39:9:39:9 | x | 1 |
| 39 | unclear_split3 | test.py:39:13:39:17 | False | 1 |
| 40 | unclear_split3 | test.py:40:8:40:8 | x | 2 |
| 41 | unclear_split3 | test.py:41:9:41:12 | Pass | 1 |
| 43 | split4 | test.py:43:12:43:12 | x | 1 |
| 44 | split4 | test.py:44:8:44:8 | x | 1 |
| 44 | split4 | test.py:44:8:44:16 | Compare | 1 |
| 44 | split4 | test.py:44:13:44:16 | None | 1 |
| 45 | split4 | test.py:45:9:45:9 | x | 1 |
| 45 | split4 | test.py:45:13:45:20 | not_none | 1 |
| 45 | split4 | test.py:45:13:45:22 | not_none() | 1 |
| 46 | split4 | test.py:46:5:46:5 | c | 1 |
| 46 | split4 | test.py:46:5:46:17 | IfExp | 1 |
| 46 | split4 | test.py:46:10:46:10 | b | 1 |
| 46 | split4 | test.py:46:17:46:17 | c | 1 |
| 47 | split4 | test.py:47:5:47:12 | Return | 1 |
| 47 | split4 | test.py:47:12:47:12 | x | 1 |
| 49 | split_carefully_5 | test.py:49:23:49:23 | x | 1 |
| 50 | split_carefully_5 | test.py:50:8:50:8 | x | 1 |
| 50 | split_carefully_5 | test.py:50:8:50:16 | Compare | 1 |
| 50 | split_carefully_5 | test.py:50:13:50:16 | None | 1 |
| 51 | split_carefully_5 | test.py:51:9:51:9 | x | 1 |
| 51 | split_carefully_5 | test.py:51:13:51:20 | not_none | 1 |
| 51 | split_carefully_5 | test.py:51:13:51:22 | not_none() | 1 |
| 52 | split_carefully_5 | test.py:52:8:52:8 | x | 1 |
| 53 | split_carefully_5 | test.py:53:9:53:12 | Pass | 1 |
| 54 | split_carefully_5 | test.py:54:5:54:12 | Return | 1 |
| 54 | split_carefully_5 | test.py:54:12:54:12 | x | 1 |
| 58 | dont_split_globals | test.py:58:8:58:11 | cond | 1 |
| 59 | dont_split_globals | test.py:59:9:59:12 | Pass | 1 |
| 60 | dont_split_globals | test.py:60:5:60:31 | call_could_alter_any_global | 2 |
| 60 | dont_split_globals | test.py:60:5:60:33 | call_could_alter_any_global() | 2 |
| 61 | dont_split_globals | test.py:61:8:61:11 | cond | 2 |
| 62 | dont_split_globals | test.py:62:9:62:12 | Pass | 2 |
| 64 | limit_splitting1 | test.py:64:22:64:22 | a | 1 |
| 64 | limit_splitting1 | test.py:64:24:64:24 | b | 1 |
| 64 | limit_splitting1 | test.py:64:26:64:26 | c | 1 |
| 64 | limit_splitting1 | test.py:64:28:64:28 | d | 1 |
| 65 | limit_splitting1 | test.py:65:8:65:8 | a | 1 |
| 65 | limit_splitting1 | test.py:65:8:65:16 | Compare | 1 |
| 65 | limit_splitting1 | test.py:65:13:65:16 | None | 1 |
| 65 | limit_splitting1 | test.py:65:19:65:19 | a | 1 |
| 65 | limit_splitting1 | test.py:65:23:65:25 | Str | 1 |
| 66 | limit_splitting1 | test.py:66:8:66:8 | b | 1 |
| 66 | limit_splitting1 | test.py:66:8:66:16 | Compare | 1 |
| 66 | limit_splitting1 | test.py:66:13:66:16 | None | 1 |
| 66 | limit_splitting1 | test.py:66:19:66:19 | b | 1 |
| 66 | limit_splitting1 | test.py:66:23:66:25 | Str | 1 |
| 67 | limit_splitting1 | test.py:67:8:67:8 | c | 1 |
| 67 | limit_splitting1 | test.py:67:8:67:16 | Compare | 1 |
| 67 | limit_splitting1 | test.py:67:13:67:16 | None | 1 |
| 67 | limit_splitting1 | test.py:67:19:67:19 | c | 1 |
| 67 | limit_splitting1 | test.py:67:23:67:25 | Str | 1 |
| 68 | limit_splitting1 | test.py:68:8:68:8 | d | 1 |
| 68 | limit_splitting1 | test.py:68:8:68:16 | Compare | 1 |
| 68 | limit_splitting1 | test.py:68:13:68:16 | None | 1 |
| 68 | limit_splitting1 | test.py:68:19:68:19 | d | 1 |
| 68 | limit_splitting1 | test.py:68:23:68:25 | Str | 1 |
| 69 | limit_splitting1 | test.py:69:5:69:8 | Pass | 1 |
| 77 | limit_splitting2 | test.py:77:22:77:22 | a | 1 |
| 77 | limit_splitting2 | test.py:77:24:77:24 | b | 1 |
| 77 | limit_splitting2 | test.py:77:26:77:26 | c | 1 |
| 77 | limit_splitting2 | test.py:77:28:77:28 | d | 1 |
| 78 | limit_splitting2 | test.py:78:8:78:8 | a | 1 |
| 79 | limit_splitting2 | test.py:79:9:79:12 | Pass | 1 |
| 80 | limit_splitting2 | test.py:80:8:80:8 | b | 2 |
| 81 | limit_splitting2 | test.py:81:9:81:12 | Pass | 2 |
| 82 | limit_splitting2 | test.py:82:8:82:8 | c | 4 |
| 83 | limit_splitting2 | test.py:83:9:83:12 | Pass | 4 |
| 84 | limit_splitting2 | test.py:84:8:84:8 | d | 4 |
| 85 | limit_splitting2 | test.py:85:9:85:12 | Pass | 4 |
| 87 | limit_splitting2 | test.py:87:8:87:8 | a | 4 |
| 88 | limit_splitting2 | test.py:88:9:88:10 | a1 | 2 |
| 89 | limit_splitting2 | test.py:89:8:89:8 | b | 4 |
| 90 | limit_splitting2 | test.py:90:9:90:10 | b1 | 2 |
| 92 | limit_splitting2 | test.py:92:8:92:8 | c | 4 |
| 93 | limit_splitting2 | test.py:93:9:93:10 | c1 | 4 |
| 94 | limit_splitting2 | test.py:94:8:94:8 | d | 4 |
| 95 | limit_splitting2 | test.py:95:9:95:10 | d1 | 4 |
| 98 | split_on_numbers | test.py:98:5:98:8 | Try | 1 |
| 99 | split_on_numbers | test.py:99:9:99:12 | call | 1 |
| 99 | split_on_numbers | test.py:99:9:99:14 | call() | 1 |
| 100 | split_on_numbers | test.py:100:9:100:9 | x | 1 |
| 100 | split_on_numbers | test.py:100:13:100:14 | UnaryExpr | 1 |
| 100 | split_on_numbers | test.py:100:14:100:14 | IntegerLiteral | 1 |
| 101 | split_on_numbers | test.py:101:5:101:11 | ExceptStmt | 1 |
| 102 | split_on_numbers | test.py:102:9:102:9 | x | 1 |
| 102 | split_on_numbers | test.py:102:13:102:13 | IntegerLiteral | 1 |
| 103 | split_on_numbers | test.py:103:8:103:8 | x | 2 |
| 104 | split_on_numbers | test.py:104:9:104:12 | Pass | 1 |
| 107 | split_try_except_else | test.py:107:5:107:8 | Try | 1 |
| 108 | split_try_except_else | test.py:108:9:108:12 | call | 1 |
| 108 | split_try_except_else | test.py:108:9:108:14 | call() | 1 |
| 109 | split_try_except_else | test.py:109:5:109:11 | ExceptStmt | 1 |
| 110 | split_try_except_else | test.py:110:9:110:9 | x | 1 |
| 110 | split_try_except_else | test.py:110:13:110:13 | IntegerLiteral | 1 |
| 112 | split_try_except_else | test.py:112:9:112:9 | x | 1 |
| 112 | split_try_except_else | test.py:112:13:112:13 | IntegerLiteral | 1 |
| 113 | split_try_except_else | test.py:113:8:113:8 | x | 2 |
| 114 | split_try_except_else | test.py:114:9:114:12 | Pass | 1 |
| 119 | logging | test.py:119:5:119:8 | Try | 1 |
| 120 | logging | test.py:120:16:120:22 | ImportExpr | 1 |
| 120 | logging | test.py:120:16:120:22 | module1 | 1 |
| 121 | logging | test.py:121:16:121:22 | ImportExpr | 1 |
| 121 | logging | test.py:121:16:121:22 | module2 | 1 |
| 123 | logging | test.py:123:5:123:23 | ExceptStmt | 1 |
| 123 | logging | test.py:123:12:123:22 | ImportError | 1 |
| 124 | logging | test.py:124:9:124:15 | module1 | 1 |
| 124 | logging | test.py:124:19:124:22 | None | 1 |
| 126 | logging | test.py:126:8:126:14 | module1 | 2 |
| 127 | logging | test.py:127:9:127:12 | inst | 1 |
| 127 | logging | test.py:127:16:127:22 | module2 | 1 |
| 127 | logging | test.py:127:16:127:28 | Attribute | 1 |
| 127 | logging | test.py:127:16:127:30 | Attribute() | 1 |
| 131 | split5 | test.py:131:5:131:8 | Try | 1 |
| 132 | split5 | test.py:132:9:132:12 | call | 1 |
| 132 | split5 | test.py:132:9:132:14 | call() | 1 |
| 133 | split5 | test.py:133:9:133:9 | x | 1 |
| 133 | split5 | test.py:133:13:133:16 | True | 1 |
| 134 | split5 | test.py:134:5:134:11 | ExceptStmt | 1 |
| 135 | split5 | test.py:135:9:135:9 | x | 1 |
| 135 | split5 | test.py:135:13:135:17 | False | 1 |
| 136 | split5 | test.py:136:8:136:12 | UnaryExpr | 2 |
| 136 | split5 | test.py:136:12:136:12 | x | 2 |
| 137 | split5 | test.py:137:9:137:12 | Pass | 1 |
| 140 | split6 | test.py:140:5:140:8 | Try | 1 |
| 141 | split6 | test.py:141:9:141:12 | call | 1 |
| 141 | split6 | test.py:141:9:141:14 | call() | 1 |
| 142 | split6 | test.py:142:9:142:9 | x | 1 |
| 142 | split6 | test.py:142:13:142:16 | True | 1 |
| 143 | split6 | test.py:143:5:143:11 | ExceptStmt | 1 |
| 144 | split6 | test.py:144:9:144:9 | x | 1 |
| 144 | split6 | test.py:144:13:144:17 | False | 1 |
| 145 | split6 | test.py:145:8:145:16 | UnaryExpr | 2 |
| 145 | split6 | test.py:145:12:145:16 | UnaryExpr | 2 |
| 145 | split6 | test.py:145:16:145:16 | x | 2 |
| 146 | split6 | test.py:146:9:146:12 | Pass | 1 |
| 149 | split7 | test.py:149:5:149:8 | Try | 1 |
| 150 | split7 | test.py:150:9:150:12 | call | 1 |
| 150 | split7 | test.py:150:9:150:14 | call() | 1 |
| 151 | split7 | test.py:151:9:151:9 | x | 1 |
| 151 | split7 | test.py:151:13:151:20 | UnaryExpr | 1 |
| 151 | split7 | test.py:151:17:151:20 | True | 1 |
| 152 | split7 | test.py:152:5:152:11 | ExceptStmt | 1 |
| 153 | split7 | test.py:153:9:153:9 | x | 1 |
| 153 | split7 | test.py:153:13:153:21 | UnaryExpr | 1 |
| 153 | split7 | test.py:153:17:153:21 | False | 1 |
| 154 | split7 | test.py:154:8:154:8 | x | 2 |
| 155 | split7 | test.py:155:9:155:12 | Pass | 1 |
| 157 | split8 | test.py:157:12:157:15 | cond | 1 |
| 158 | split8 | test.py:158:8:158:11 | cond | 1 |
| 159 | split8 | test.py:159:9:159:9 | t | 1 |
| 159 | split8 | test.py:159:13:159:16 | True | 1 |
| 161 | split8 | test.py:161:9:161:9 | t | 1 |
| 161 | split8 | test.py:161:13:161:17 | False | 1 |
| 162 | split8 | test.py:162:8:162:15 | UnaryExpr | 2 |
| 162 | split8 | test.py:162:12:162:15 | cond | 2 |
| 163 | split8 | test.py:163:12:163:12 | t | 1 |
| 164 | split8 | test.py:164:13:164:16 | Pass | 0 |
| 167 | split9 | test.py:167:12:167:14 | var | 1 |
| 168 | split9 | test.py:168:8:168:10 | var | 1 |
| 168 | split9 | test.py:168:8:168:18 | Compare | 1 |
| 168 | split9 | test.py:168:15:168:18 | None | 1 |
| 169 | split9 | test.py:169:9:169:10 | a1 | 1 |
| 171 | split9 | test.py:171:9:171:10 | a2 | 1 |
| 172 | split9 | test.py:172:8:172:10 | var | 2 |
| 172 | split9 | test.py:172:8:172:22 | Compare | 2 |
| 172 | split9 | test.py:172:19:172:22 | None | 2 |
| 173 | split9 | test.py:173:9:173:10 | b1 | 1 |
| 175 | split9 | test.py:175:9:175:10 | b2 | 1 |
| 177 | split10 | test.py:177:13:177:15 | var | 1 |
| 178 | split10 | test.py:178:8:178:10 | var | 1 |
| 179 | split10 | test.py:179:9:179:10 | a1 | 1 |
| 181 | split10 | test.py:181:9:181:10 | a2 | 1 |
| 182 | split10 | test.py:182:8:182:10 | var | 2 |
| 182 | split10 | test.py:182:8:182:22 | Compare | 2 |
| 182 | split10 | test.py:182:19:182:22 | None | 2 |
| 183 | split10 | test.py:183:9:183:10 | b1 | 2 |
| 185 | split10 | test.py:185:9:185:10 | b2 | 1 |
| 187 | split11 | test.py:187:13:187:15 | var | 1 |
| 188 | split11 | test.py:188:8:188:10 | var | 1 |
| 188 | split11 | test.py:188:8:188:18 | Compare | 1 |
| 188 | split11 | test.py:188:15:188:18 | None | 1 |
| 189 | split11 | test.py:189:9:189:10 | a1 | 1 |
| 191 | split11 | test.py:191:9:191:10 | a2 | 1 |
| 192 | split11 | test.py:192:8:192:10 | var | 2 |
| 193 | split11 | test.py:193:9:193:10 | b1 | 1 |
| 195 | split11 | test.py:195:9:195:10 | b2 | 2 |
| 197 | dont_split_on_unrelated_variables | test.py:197:39:197:42 | var1 | 1 |
| 197 | dont_split_on_unrelated_variables | test.py:197:45:197:48 | var2 | 1 |
| 198 | dont_split_on_unrelated_variables | test.py:198:8:198:11 | var1 | 1 |
| 198 | dont_split_on_unrelated_variables | test.py:198:8:198:19 | Compare | 1 |
| 198 | dont_split_on_unrelated_variables | test.py:198:16:198:19 | None | 1 |
| 199 | dont_split_on_unrelated_variables | test.py:199:9:199:10 | a1 | 1 |
| 201 | dont_split_on_unrelated_variables | test.py:201:9:201:10 | a2 | 1 |
| 202 | dont_split_on_unrelated_variables | test.py:202:8:202:11 | var2 | 1 |
| 202 | dont_split_on_unrelated_variables | test.py:202:8:202:23 | Compare | 1 |
| 202 | dont_split_on_unrelated_variables | test.py:202:20:202:23 | None | 1 |
| 203 | dont_split_on_unrelated_variables | test.py:203:9:203:10 | b1 | 1 |
| 205 | dont_split_on_unrelated_variables | test.py:205:9:205:10 | b2 | 1 |
| 208 | split12 | test.py:208:5:208:8 | Try | 1 |
| 209 | split12 | test.py:209:9:209:12 | call | 1 |
| 209 | split12 | test.py:209:9:209:14 | call() | 1 |
| 210 | split12 | test.py:210:9:210:9 | x | 1 |
| 210 | split12 | test.py:210:13:210:16 | None | 1 |
| 211 | split12 | test.py:211:5:211:11 | ExceptStmt | 1 |
| 212 | split12 | test.py:212:16:212:16 | ImportExpr | 1 |
| 212 | split12 | test.py:212:16:212:16 | x | 1 |
| 213 | split12 | test.py:213:8:213:8 | x | 2 |
| 214 | split12 | test.py:214:9:214:12 | Pass | 1 |
| 217 | split13 | test.py:217:5:217:7 | var | 1 |
| 217 | split13 | test.py:217:11:217:14 | cond | 1 |
| 217 | split13 | test.py:217:11:217:16 | cond() | 1 |
| 218 | split13 | test.py:218:8:218:10 | var | 1 |
| 219 | split13 | test.py:219:9:219:10 | a1 | 1 |
| 221 | split13 | test.py:221:9:221:10 | a2 | 1 |
| 222 | split13 | test.py:222:5:222:8 | Try | 2 |
| 223 | split13 | test.py:223:9:223:10 | b1 | 2 |
| 225 | split13 | test.py:225:12:225:14 | var | 4 |
| 226 | split13 | test.py:226:13:226:14 | a3 | 2 |
| 230 | split14 | test.py:230:5:230:8 | flag | 1 |
| 230 | split14 | test.py:230:12:230:16 | False | 1 |
| 231 | split14 | test.py:231:5:231:8 | Try | 1 |
| 232 | split14 | test.py:232:9:232:9 | x | 1 |
| 232 | split14 | test.py:232:13:232:21 | something | 1 |
| 232 | split14 | test.py:232:13:232:23 | something() | 1 |
| 233 | split14 | test.py:233:5:233:21 | ExceptStmt | 1 |
| 233 | split14 | test.py:233:12:233:20 | Exception | 1 |
| 234 | split14 | test.py:234:9:234:10 | IntegerLiteral | 1 |
| 235 | split14 | test.py:235:9:235:12 | flag | 1 |
| 235 | split14 | test.py:235:16:235:19 | True | 1 |
| 236 | split14 | test.py:236:8:236:15 | UnaryExpr | 2 |
| 236 | split14 | test.py:236:12:236:15 | flag | 2 |
| 238 | split14 | test.py:238:9:238:12 | Pass | 1 |
| 240 | split15 | test.py:240:13:240:15 | var | 1 |
| 241 | split15 | test.py:241:8:241:10 | var | 1 |
| 242 | split15 | test.py:242:9:242:13 | other | 1 |
| 242 | split15 | test.py:242:17:242:17 | IntegerLiteral | 1 |
| 243 | split15 | test.py:243:8:243:14 | UnaryExpr | 2 |
| 243 | split15 | test.py:243:8:243:28 | BoolExpr | 2 |
| 243 | split15 | test.py:243:12:243:14 | var | 2 |
| 243 | split15 | test.py:243:19:243:23 | other | 1 |
| 243 | split15 | test.py:243:19:243:28 | Attribute | 1 |
| 244 | split15 | test.py:244:9:244:12 | Pass | 2 |
| 247 | split16 | test.py:247:5:247:5 | x | 1 |
| 247 | split16 | test.py:247:9:247:12 | True | 1 |
| 248 | split16 | test.py:248:8:248:11 | cond | 1 |
| 249 | split16 | test.py:249:9:249:9 | x | 1 |
| 249 | split16 | test.py:249:13:249:16 | None | 1 |
| 250 | split16 | test.py:250:8:250:8 | x | 2 |
| 251 | split16 | test.py:251:9:251:11 | use | 1 |
| 251 | split16 | test.py:251:9:251:14 | use() | 1 |
| 251 | split16 | test.py:251:13:251:13 | x | 1 |
| 253 | dont_split_on_different_ssa | test.py:253:33:253:35 | var | 1 |
| 254 | dont_split_on_different_ssa | test.py:254:8:254:10 | var | 1 |
| 255 | dont_split_on_different_ssa | test.py:255:9:255:10 | a1 | 1 |
| 257 | dont_split_on_different_ssa | test.py:257:9:257:10 | a2 | 1 |
| 258 | dont_split_on_different_ssa | test.py:258:5:258:7 | var | 1 |
| 258 | dont_split_on_different_ssa | test.py:258:11:258:14 | func | 1 |
| 258 | dont_split_on_different_ssa | test.py:258:11:258:16 | func() | 1 |
| 259 | dont_split_on_different_ssa | test.py:259:8:259:10 | var | 1 |
| 259 | dont_split_on_different_ssa | test.py:259:8:259:22 | Compare | 1 |
| 259 | dont_split_on_different_ssa | test.py:259:19:259:22 | None | 1 |
| 260 | dont_split_on_different_ssa | test.py:260:9:260:10 | b1 | 1 |
| 262 | dont_split_on_different_ssa | test.py:262:9:262:10 | b2 | 1 |
| 264 | split17 | test.py:264:13:264:15 | var | 1 |
| 266 | split17 | test.py:266:8:266:10 | var | 1 |
| 267 | split17 | test.py:267:9:267:10 | a1 | 1 |
| 269 | split17 | test.py:269:9:269:10 | a2 | 1 |
| 270 | split17 | test.py:270:8:270:14 | UnaryExpr | 2 |
| 270 | split17 | test.py:270:12:270:14 | var | 2 |
| 271 | split17 | test.py:271:9:271:10 | b1 | 1 |
| 273 | split17 | test.py:273:9:273:10 | b2 | 1 |
| 274 | split17 | test.py:274:8:274:10 | var | 2 |
| 275 | split17 | test.py:275:9:275:10 | c1 | 1 |
| 277 | split17 | test.py:277:9:277:10 | c2 | 1 |
| 278 | split17 | test.py:278:8:278:10 | var | 2 |
| 279 | split17 | test.py:279:9:279:10 | d1 | 1 |
| 281 | split17 | test.py:281:9:281:10 | d2 | 1 |
| 282 | split17 | test.py:282:8:282:10 | var | 2 |
| 283 | split17 | test.py:283:9:283:10 | e1 | 1 |
| 285 | split17 | test.py:285:9:285:10 | e2 | 1 |
| 287 | split18 | test.py:287:13:287:15 | var | 1 |
| 289 | split18 | test.py:289:8:289:10 | var | 1 |
| 290 | split18 | test.py:290:9:290:10 | a1 | 1 |
| 292 | split18 | test.py:292:9:292:10 | a2 | 1 |
| 293 | split18 | test.py:293:8:293:10 | var | 2 |
| 293 | split18 | test.py:293:8:293:22 | Compare | 2 |
| 293 | split18 | test.py:293:19:293:22 | None | 2 |
| 294 | split18 | test.py:294:9:294:10 | b1 | 2 |
| 296 | split18 | test.py:296:9:296:10 | b2 | 1 |
| 297 | split18 | test.py:297:8:297:10 | var | 3 |
| 297 | split18 | test.py:297:8:297:18 | Compare | 3 |
| 297 | split18 | test.py:297:15:297:18 | None | 3 |
| 298 | split18 | test.py:298:9:298:10 | c1 | 1 |
| 300 | split18 | test.py:300:9:300:10 | c2 | 2 |
| 301 | split18 | test.py:301:8:301:10 | var | 3 |
| 302 | split18 | test.py:302:9:302:10 | d1 | 1 |
| 304 | split18 | test.py:304:9:304:10 | d2 | 2 |
| 305 | split18 | test.py:305:8:305:10 | var | 3 |
| 306 | split18 | test.py:306:9:306:10 | e1 | 1 |
| 308 | split18 | test.py:308:9:308:10 | e2 | 2 |
| 310 | split_on_boolean_only | test.py:310:27:310:27 | x | 1 |
| 311 | split_on_boolean_only | test.py:311:8:311:8 | x | 1 |
| 312 | split_on_boolean_only | test.py:312:9:312:10 | a1 | 1 |
| 314 | split_on_boolean_only | test.py:314:9:314:10 | a2 | 1 |
| 315 | split_on_boolean_only | test.py:315:8:315:8 | x | 2 |
| 315 | split_on_boolean_only | test.py:315:8:315:20 | Compare | 2 |
| 315 | split_on_boolean_only | test.py:315:17:315:20 | None | 2 |
| 316 | split_on_boolean_only | test.py:316:9:316:10 | b1 | 2 |
| 318 | split_on_boolean_only | test.py:318:9:318:10 | b2 | 1 |
| 319 | split_on_boolean_only | test.py:319:8:319:8 | x | 3 |
| 320 | split_on_boolean_only | test.py:320:9:320:10 | c1 | 1 |
| 322 | split_on_boolean_only | test.py:322:9:322:10 | c2 | 2 |
| 324 | split_on_none_aswell | test.py:324:26:324:26 | x | 1 |
| 325 | split_on_none_aswell | test.py:325:8:325:8 | x | 1 |
| 326 | split_on_none_aswell | test.py:326:9:326:10 | a1 | 1 |
| 328 | split_on_none_aswell | test.py:328:9:328:10 | a2 | 1 |
| 329 | split_on_none_aswell | test.py:329:8:329:8 | x | 2 |
| 329 | split_on_none_aswell | test.py:329:8:329:20 | Compare | 2 |
| 329 | split_on_none_aswell | test.py:329:17:329:20 | None | 2 |
| 330 | split_on_none_aswell | test.py:330:9:330:10 | b1 | 2 |
| 332 | split_on_none_aswell | test.py:332:9:332:10 | b2 | 1 |
| 333 | split_on_none_aswell | test.py:333:8:333:8 | x | 3 |
| 333 | split_on_none_aswell | test.py:333:8:333:16 | Compare | 3 |
| 333 | split_on_none_aswell | test.py:333:13:333:16 | None | 3 |
| 334 | split_on_none_aswell | test.py:334:9:334:10 | c1 | 1 |
| 336 | split_on_none_aswell | test.py:336:9:336:10 | c2 | 2 |
| 338 | split_on_or_defn | test.py:338:22:338:24 | var | 1 |
| 339 | split_on_or_defn | test.py:339:8:339:10 | var | 1 |
| 340 | split_on_or_defn | test.py:340:9:340:11 | obj | 1 |
| 340 | split_on_or_defn | test.py:340:15:340:19 | thing | 1 |
| 340 | split_on_or_defn | test.py:340:15:340:21 | thing() | 1 |
| 341 | split_on_or_defn | test.py:341:8:341:14 | UnaryExpr | 2 |
| 341 | split_on_or_defn | test.py:341:8:341:26 | BoolExpr | 2 |
| 341 | split_on_or_defn | test.py:341:12:341:14 | var | 2 |
| 341 | split_on_or_defn | test.py:341:19:341:21 | obj | 1 |
| 341 | split_on_or_defn | test.py:341:19:341:26 | Attribute | 1 |
| 342 | split_on_or_defn | test.py:342:9:342:9 | x | 2 |
| 345 | split_on_exception | test.py:345:5:345:8 | flag | 1 |
| 345 | split_on_exception | test.py:345:12:345:16 | False | 1 |
| 346 | split_on_exception | test.py:346:5:346:8 | Try | 1 |
| 347 | split_on_exception | test.py:347:9:347:9 | x | 1 |
| 347 | split_on_exception | test.py:347:13:347:24 | do_something | 1 |
| 347 | split_on_exception | test.py:347:13:347:26 | do_something() | 1 |
| 348 | split_on_exception | test.py:348:5:348:21 | ExceptStmt | 1 |
| 348 | split_on_exception | test.py:348:12:348:20 | Exception | 1 |
| 349 | split_on_exception | test.py:349:9:349:12 | flag | 1 |
| 349 | split_on_exception | test.py:349:16:349:19 | True | 1 |
| 350 | split_on_exception | test.py:350:8:350:15 | UnaryExpr | 2 |
| 350 | split_on_exception | test.py:350:12:350:15 | flag | 2 |
| 351 | split_on_exception | test.py:351:9:351:9 | x | 1 |
| 353 | partially_useful_split | test.py:353:28:353:31 | cond | 1 |
| 354 | partially_useful_split | test.py:354:8:354:11 | cond | 1 |
| 355 | partially_useful_split | test.py:355:9:355:9 | x | 1 |
| 355 | partially_useful_split | test.py:355:13:355:16 | None | 1 |
| 357 | partially_useful_split | test.py:357:9:357:9 | x | 1 |
| 357 | partially_useful_split | test.py:357:13:357:29 | something_or_none | 1 |
| 357 | partially_useful_split | test.py:357:13:357:31 | something_or_none() | 1 |
| 358 | partially_useful_split | test.py:358:5:358:15 | other_stuff | 2 |
| 358 | partially_useful_split | test.py:358:5:358:17 | other_stuff() | 2 |
| 359 | partially_useful_split | test.py:359:8:359:8 | x | 2 |
| 360 | partially_useful_split | test.py:360:9:360:10 | a1 | 1 |
| 362 | partially_useful_split | test.py:362:9:362:10 | a2 | 2 |
| 364 | dont_split_not_useful | test.py:364:27:364:30 | cond | 1 |
| 364 | dont_split_not_useful | test.py:364:33:364:33 | y | 1 |
| 365 | dont_split_not_useful | test.py:365:8:365:11 | cond | 1 |
| 366 | dont_split_not_useful | test.py:366:9:366:9 | x | 1 |
| 366 | dont_split_not_useful | test.py:366:13:366:16 | None | 1 |
| 368 | dont_split_not_useful | test.py:368:9:368:9 | x | 1 |
| 368 | dont_split_not_useful | test.py:368:13:368:29 | something_or_none | 1 |
| 368 | dont_split_not_useful | test.py:368:13:368:31 | something_or_none() | 1 |
| 369 | dont_split_not_useful | test.py:369:5:369:15 | other_stuff | 1 |
| 369 | dont_split_not_useful | test.py:369:5:369:17 | other_stuff() | 1 |
| 370 | dont_split_not_useful | test.py:370:8:370:8 | y | 1 |
| 371 | dont_split_not_useful | test.py:371:9:371:10 | a1 | 1 |
| 373 | dont_split_not_useful | test.py:373:9:373:10 | a2 | 1 |
| 376 | f | test.py:376:7:376:7 | x | 1 |
| 376 | f | test.py:376:9:376:9 | y | 1 |
| 377 | f | test.py:377:8:377:8 | x | 1 |
| 377 | f | test.py:377:8:377:14 | BoolExpr | 1 |
| 377 | f | test.py:377:14:377:14 | y | 1 |
| 378 | f | test.py:378:9:378:13 | Raise | 1 |
| 379 | f | test.py:379:8:379:19 | UnaryExpr | 3 |
| 379 | f | test.py:379:13:379:13 | x | 2 |
| 379 | f | test.py:379:13:379:18 | BoolExpr | 2 |
| 379 | f | test.py:379:18:379:18 | y | 1 |
| 380 | f | test.py:380:9:380:13 | Raise | 1 |
| 381 | f | test.py:381:5:381:8 | Pass | 2 |
| 383 | g | test.py:383:7:383:7 | x | 1 |
| 383 | g | test.py:383:9:383:9 | y | 1 |
| 384 | g | test.py:384:8:384:8 | x | 1 |
| 384 | g | test.py:384:8:384:14 | BoolExpr | 1 |
| 384 | g | test.py:384:14:384:14 | y | 1 |
| 385 | g | test.py:385:9:385:13 | Raise | 1 |
| 386 | g | test.py:386:8:386:8 | x | 2 |
| 386 | g | test.py:386:8:386:13 | BoolExpr | 2 |
| 386 | g | test.py:386:13:386:13 | y | 1 |
| 388 | g | test.py:388:9:388:12 | here | 2 |
| 389 | g | test.py:389:5:389:7 | end | 2 |
| 391 | h | test.py:391:7:391:7 | x | 1 |
| 391 | h | test.py:391:10:391:10 | y | 1 |
| 393 | h | test.py:393:9:396:18 | BoolExpr | 1 |
| 393 | h | test.py:393:10:393:10 | x | 1 |
| 393 | h | test.py:393:10:394:14 | BoolExpr | 1 |
| 394 | h | test.py:394:10:394:14 | UnaryExpr | 1 |
| 394 | h | test.py:394:14:394:14 | y | 1 |
| 395 | h | test.py:395:10:395:10 | x | 2 |
| 395 | h | test.py:395:10:396:17 | BoolExpr | 2 |
| 396 | h | test.py:396:10:396:10 | y | 1 |
| 396 | h | test.py:396:10:396:15 | Attribute | 1 |
| 396 | h | test.py:396:10:396:17 | Attribute() | 1 |
| 398 | h | test.py:398:9:398:12 | Pass | 1 |
| 400 | j | test.py:400:7:400:7 | a | 1 |
| 400 | j | test.py:400:10:400:10 | b | 1 |
| 401 | j | test.py:401:8:401:8 | a | 1 |
| 401 | j | test.py:401:8:401:13 | BoolExpr | 1 |
| 401 | j | test.py:401:13:401:13 | b | 1 |
| 402 | j | test.py:402:12:402:12 | a | 2 |
| 403 | j | test.py:403:13:403:16 | here | 1 |
| 405 | j | test.py:405:13:405:17 | there | 1 |
| 408 | split_on_strings | test.py:408:5:408:8 | Try | 1 |
| 409 | split_on_strings | test.py:409:9:409:18 | might_fail | 1 |
| 409 | split_on_strings | test.py:409:9:409:20 | might_fail() | 1 |
| 410 | split_on_strings | test.py:410:9:410:9 | x | 1 |
| 410 | split_on_strings | test.py:410:13:410:18 | Str | 1 |
| 411 | split_on_strings | test.py:411:5:411:11 | ExceptStmt | 1 |
| 412 | split_on_strings | test.py:412:9:412:9 | x | 1 |
| 412 | split_on_strings | test.py:412:13:412:16 | Str | 1 |
| 414 | split_on_strings | test.py:414:8:414:8 | x | 2 |
| 414 | split_on_strings | test.py:414:8:414:16 | Compare | 2 |
| 414 | split_on_strings | test.py:414:13:414:16 | Str | 2 |
| 415 | split_on_strings | test.py:415:9:415:12 | Pass | 2 |
| 416 | split_on_strings | test.py:416:5:416:8 | Pass | 2 |
| 419 | scipy_stylee | test.py:419:18:419:18 | x | 1 |
| 420 | scipy_stylee | test.py:420:5:420:31 | Assert | 2 |
| 420 | scipy_stylee | test.py:420:12:420:12 | x | 1 |
| 420 | scipy_stylee | test.py:420:12:420:31 | Compare | 1 |
| 420 | scipy_stylee | test.py:420:18:420:20 | Str | 1 |
| 420 | scipy_stylee | test.py:420:18:420:30 | Tuple | 1 |
| 420 | scipy_stylee | test.py:420:23:420:25 | Str | 1 |
| 420 | scipy_stylee | test.py:420:28:420:30 | Str | 1 |
| 421 | scipy_stylee | test.py:421:8:421:8 | x | 1 |
| 421 | scipy_stylee | test.py:421:8:421:15 | Compare | 1 |
| 421 | scipy_stylee | test.py:421:13:421:15 | Str | 1 |
| 422 | scipy_stylee | test.py:422:9:422:12 | Pass | 1 |
| 423 | scipy_stylee | test.py:423:10:423:10 | x | 1 |
| 423 | scipy_stylee | test.py:423:10:423:17 | Compare | 1 |
| 423 | scipy_stylee | test.py:423:15:423:17 | Str | 1 |
| 424 | scipy_stylee | test.py:424:9:424:12 | Pass | 1 |
| 425 | scipy_stylee | test.py:425:10:425:10 | x | 1 |
| 425 | scipy_stylee | test.py:425:10:425:17 | Compare | 1 |
| 425 | scipy_stylee | test.py:425:15:425:17 | Str | 1 |
| 426 | scipy_stylee | test.py:426:9:426:12 | Pass | 1 |
| 429 | scipy_stylee | test.py:429:9:429:12 | Pass | 1 |
| 431 | odasa_6674 | test.py:431:16:431:16 | x | 1 |
| 432 | odasa_6674 | test.py:432:5:432:9 | valid | 1 |
| 432 | odasa_6674 | test.py:432:13:432:16 | True | 1 |
| 433 | odasa_6674 | test.py:433:8:433:27 | dont_understand_this | 1 |
| 433 | odasa_6674 | test.py:433:8:433:29 | dont_understand_this() | 1 |
| 434 | odasa_6674 | test.py:434:9:434:12 | Try | 1 |
| 435 | odasa_6674 | test.py:435:13:435:21 | may_raise | 1 |
| 435 | odasa_6674 | test.py:435:13:435:23 | may_raise() | 1 |
| 436 | odasa_6674 | test.py:436:13:436:17 | score | 1 |
| 436 | odasa_6674 | test.py:436:21:436:21 | IntegerLiteral | 1 |
| 437 | odasa_6674 | test.py:437:9:437:24 | ExceptStmt | 1 |
| 437 | odasa_6674 | test.py:437:16:437:23 | KeyError | 1 |
| 438 | odasa_6674 | test.py:438:13:438:17 | valid | 1 |
| 438 | odasa_6674 | test.py:438:21:438:25 | False | 1 |
| 439 | odasa_6674 | test.py:439:12:439:20 | UnaryExpr | 2 |
| 439 | odasa_6674 | test.py:439:16:439:20 | valid | 2 |
| 440 | odasa_6674 | test.py:440:13:440:30 | Raise | 1 |
| 440 | odasa_6674 | test.py:440:19:440:28 | ValueError | 1 |
| 440 | odasa_6674 | test.py:440:19:440:30 | ValueError() | 1 |
| 442 | odasa_6674 | test.py:442:9:442:13 | score | 1 |
| 442 | odasa_6674 | test.py:442:17:442:17 | IntegerLiteral | 1 |
| 443 | odasa_6674 | test.py:443:5:443:16 | Return | 1 |
| 443 | odasa_6674 | test.py:443:12:443:16 | score | 1 |
| 445 | odasa_6625 | test.py:445:16:445:16 | k | 1 |
| 446 | odasa_6625 | test.py:446:5:446:9 | value | 1 |
| 446 | odasa_6625 | test.py:446:13:446:16 | Str | 1 |
| 447 | odasa_6625 | test.py:447:8:447:8 | k | 1 |
| 447 | odasa_6625 | test.py:447:8:447:17 | Attribute | 1 |
| 447 | odasa_6625 | test.py:447:8:447:25 | Attribute() | 1 |
| 447 | odasa_6625 | test.py:447:8:447:47 | BoolExpr | 1 |
| 447 | odasa_6625 | test.py:447:19:447:24 | Str | 1 |
| 447 | odasa_6625 | test.py:447:30:447:30 | k | 1 |
| 447 | odasa_6625 | test.py:447:30:447:39 | Attribute | 1 |
| 447 | odasa_6625 | test.py:447:30:447:47 | Attribute() | 1 |
| 447 | odasa_6625 | test.py:447:41:447:46 | Str | 1 |
| 448 | odasa_6625 | test.py:448:9:448:13 | value | 1 |
| 448 | odasa_6625 | test.py:448:17:448:17 | IntegerLiteral | 1 |
| 449 | odasa_6625 | test.py:449:8:449:8 | k | 1 |
| 449 | odasa_6625 | test.py:449:8:449:18 | Compare | 1 |
| 449 | odasa_6625 | test.py:449:13:449:18 | Str | 1 |
| 450 | odasa_6625 | test.py:450:9:450:31 | Return | 1 |
| 450 | odasa_6625 | test.py:450:16:450:20 | value | 1 |
| 450 | odasa_6625 | test.py:450:16:450:31 | BinaryExpr | 1 |
| 450 | odasa_6625 | test.py:450:24:450:31 | Str | 1 |
| 453 | avoid_redundant_split | test.py:453:27:453:27 | a | 1 |
| 454 | avoid_redundant_split | test.py:454:8:454:8 | a | 1 |
| 455 | avoid_redundant_split | test.py:455:9:455:9 | x | 1 |
| 455 | avoid_redundant_split | test.py:455:13:455:25 | unknown_thing | 1 |
| 455 | avoid_redundant_split | test.py:455:13:455:27 | unknown_thing() | 1 |
| 457 | avoid_redundant_split | test.py:457:9:457:9 | x | 1 |
| 457 | avoid_redundant_split | test.py:457:13:457:16 | None | 1 |
| 458 | avoid_redundant_split | test.py:458:8:458:8 | x | 2 |
| 459 | avoid_redundant_split | test.py:459:9:459:12 | Pass | 1 |
| 460 | avoid_redundant_split | test.py:460:8:460:8 | x | 2 |
| 461 | avoid_redundant_split | test.py:461:9:461:12 | Pass | 1 |
| 462 | avoid_redundant_split | test.py:462:5:462:15 | other_stuff | 2 |
| 462 | avoid_redundant_split | test.py:462:5:462:17 | other_stuff() | 2 |
| 463 | avoid_redundant_split | test.py:463:5:463:8 | Try | 2 |
| 464 | avoid_redundant_split | test.py:464:16:464:18 | ImportExpr | 2 |
| 464 | avoid_redundant_split | test.py:464:16:464:18 | foo | 2 |
| 465 | avoid_redundant_split | test.py:465:9:465:11 | var | 2 |
| 465 | avoid_redundant_split | test.py:465:15:465:18 | True | 2 |
| 466 | avoid_redundant_split | test.py:466:5:466:11 | ExceptStmt | 2 |
| 467 | avoid_redundant_split | test.py:467:9:467:11 | var | 2 |
| 467 | avoid_redundant_split | test.py:467:15:467:19 | False | 2 |
| 468 | avoid_redundant_split | test.py:468:8:468:10 | var | 4 |
| 469 | avoid_redundant_split | test.py:469:9:469:11 | foo | 2 |
| 469 | avoid_redundant_split | test.py:469:9:469:15 | Attribute | 2 |
| 469 | avoid_redundant_split | test.py:469:9:469:17 | Attribute() | 2 |

Просмотреть файл

@ -0,0 +1,8 @@
import python
from AstNode a, Scope s
where not a instanceof Import and not a instanceof If and not a instanceof AssignStmt and not a instanceof ExprStmt and
a.getScope() = s and
s instanceof Function
select
a.getLocation().getStartLine(), s.getName(), a, count(a.getAFlowNode())

Просмотреть файл

@ -0,0 +1,181 @@
| 3 | split1 | test.py:3:8:3:11 | ControlFlowNode for cond | 2 |
| 5 | split1 | test.py:5:8:5:11 | ControlFlowNode for cond | 1 |
| 5 | split1 | test.py:5:8:5:11 | ControlFlowNode for cond | 1 |
| 9 | dont_split1 | test.py:9:8:9:11 | ControlFlowNode for cond | 2 |
| 12 | dont_split1 | test.py:12:8:12:11 | ControlFlowNode for cond | 2 |
| 16 | dont_split2 | test.py:16:8:16:11 | ControlFlowNode for cond | 2 |
| 19 | dont_split2 | test.py:19:8:19:11 | ControlFlowNode for cond | 2 |
| 29 | split2 | test.py:29:8:29:8 | ControlFlowNode for x | 1 |
| 29 | split2 | test.py:29:8:29:8 | ControlFlowNode for x | 1 |
| 38 | unclear_split3 | test.py:38:8:38:11 | ControlFlowNode for cond | 2 |
| 40 | unclear_split3 | test.py:40:8:40:8 | ControlFlowNode for x | 1 |
| 40 | unclear_split3 | test.py:40:8:40:8 | ControlFlowNode for x | 2 |
| 44 | split4 | test.py:44:8:44:16 | ControlFlowNode for Compare | 2 |
| 46 | split4 | test.py:46:10:46:10 | ControlFlowNode for b | 2 |
| 50 | split_carefully_5 | test.py:50:8:50:16 | ControlFlowNode for Compare | 2 |
| 52 | split_carefully_5 | test.py:52:8:52:8 | ControlFlowNode for x | 2 |
| 58 | dont_split_globals | test.py:58:8:58:11 | ControlFlowNode for cond | 2 |
| 61 | dont_split_globals | test.py:61:8:61:11 | ControlFlowNode for cond | 2 |
| 61 | dont_split_globals | test.py:61:8:61:11 | ControlFlowNode for cond | 2 |
| 65 | limit_splitting1 | test.py:65:8:65:16 | ControlFlowNode for Compare | 2 |
| 66 | limit_splitting1 | test.py:66:8:66:16 | ControlFlowNode for Compare | 2 |
| 67 | limit_splitting1 | test.py:67:8:67:16 | ControlFlowNode for Compare | 2 |
| 68 | limit_splitting1 | test.py:68:8:68:16 | ControlFlowNode for Compare | 2 |
| 78 | limit_splitting2 | test.py:78:8:78:8 | ControlFlowNode for a | 2 |
| 80 | limit_splitting2 | test.py:80:8:80:8 | ControlFlowNode for b | 2 |
| 80 | limit_splitting2 | test.py:80:8:80:8 | ControlFlowNode for b | 2 |
| 82 | limit_splitting2 | test.py:82:8:82:8 | ControlFlowNode for c | 2 |
| 82 | limit_splitting2 | test.py:82:8:82:8 | ControlFlowNode for c | 2 |
| 82 | limit_splitting2 | test.py:82:8:82:8 | ControlFlowNode for c | 2 |
| 82 | limit_splitting2 | test.py:82:8:82:8 | ControlFlowNode for c | 2 |
| 84 | limit_splitting2 | test.py:84:8:84:8 | ControlFlowNode for d | 2 |
| 84 | limit_splitting2 | test.py:84:8:84:8 | ControlFlowNode for d | 2 |
| 84 | limit_splitting2 | test.py:84:8:84:8 | ControlFlowNode for d | 2 |
| 84 | limit_splitting2 | test.py:84:8:84:8 | ControlFlowNode for d | 2 |
| 87 | limit_splitting2 | test.py:87:8:87:8 | ControlFlowNode for a | 1 |
| 87 | limit_splitting2 | test.py:87:8:87:8 | ControlFlowNode for a | 1 |
| 87 | limit_splitting2 | test.py:87:8:87:8 | ControlFlowNode for a | 1 |
| 87 | limit_splitting2 | test.py:87:8:87:8 | ControlFlowNode for a | 1 |
| 89 | limit_splitting2 | test.py:89:8:89:8 | ControlFlowNode for b | 1 |
| 89 | limit_splitting2 | test.py:89:8:89:8 | ControlFlowNode for b | 1 |
| 89 | limit_splitting2 | test.py:89:8:89:8 | ControlFlowNode for b | 1 |
| 89 | limit_splitting2 | test.py:89:8:89:8 | ControlFlowNode for b | 1 |
| 92 | limit_splitting2 | test.py:92:8:92:8 | ControlFlowNode for c | 2 |
| 92 | limit_splitting2 | test.py:92:8:92:8 | ControlFlowNode for c | 2 |
| 92 | limit_splitting2 | test.py:92:8:92:8 | ControlFlowNode for c | 2 |
| 92 | limit_splitting2 | test.py:92:8:92:8 | ControlFlowNode for c | 2 |
| 94 | limit_splitting2 | test.py:94:8:94:8 | ControlFlowNode for d | 2 |
| 94 | limit_splitting2 | test.py:94:8:94:8 | ControlFlowNode for d | 2 |
| 94 | limit_splitting2 | test.py:94:8:94:8 | ControlFlowNode for d | 2 |
| 94 | limit_splitting2 | test.py:94:8:94:8 | ControlFlowNode for d | 2 |
| 103 | split_on_numbers | test.py:103:8:103:8 | ControlFlowNode for x | 1 |
| 103 | split_on_numbers | test.py:103:8:103:8 | ControlFlowNode for x | 1 |
| 113 | split_try_except_else | test.py:113:8:113:8 | ControlFlowNode for x | 1 |
| 113 | split_try_except_else | test.py:113:8:113:8 | ControlFlowNode for x | 1 |
| 126 | logging | test.py:126:8:126:14 | ControlFlowNode for module1 | 1 |
| 126 | logging | test.py:126:8:126:14 | ControlFlowNode for module1 | 1 |
| 136 | split5 | test.py:136:8:136:12 | ControlFlowNode for UnaryExpr | 1 |
| 136 | split5 | test.py:136:8:136:12 | ControlFlowNode for UnaryExpr | 1 |
| 145 | split6 | test.py:145:8:145:16 | ControlFlowNode for UnaryExpr | 1 |
| 145 | split6 | test.py:145:8:145:16 | ControlFlowNode for UnaryExpr | 1 |
| 154 | split7 | test.py:154:8:154:8 | ControlFlowNode for x | 1 |
| 154 | split7 | test.py:154:8:154:8 | ControlFlowNode for x | 1 |
| 158 | split8 | test.py:158:8:158:11 | ControlFlowNode for cond | 2 |
| 162 | split8 | test.py:162:8:162:15 | ControlFlowNode for UnaryExpr | 1 |
| 162 | split8 | test.py:162:8:162:15 | ControlFlowNode for UnaryExpr | 1 |
| 163 | split8 | test.py:163:12:163:12 | ControlFlowNode for t | 1 |
| 168 | split9 | test.py:168:8:168:18 | ControlFlowNode for Compare | 2 |
| 172 | split9 | test.py:172:8:172:22 | ControlFlowNode for Compare | 1 |
| 172 | split9 | test.py:172:8:172:22 | ControlFlowNode for Compare | 1 |
| 178 | split10 | test.py:178:8:178:10 | ControlFlowNode for var | 2 |
| 182 | split10 | test.py:182:8:182:22 | ControlFlowNode for Compare | 1 |
| 182 | split10 | test.py:182:8:182:22 | ControlFlowNode for Compare | 2 |
| 188 | split11 | test.py:188:8:188:18 | ControlFlowNode for Compare | 2 |
| 192 | split11 | test.py:192:8:192:10 | ControlFlowNode for var | 1 |
| 192 | split11 | test.py:192:8:192:10 | ControlFlowNode for var | 2 |
| 198 | dont_split_on_unrelated_variables | test.py:198:8:198:19 | ControlFlowNode for Compare | 2 |
| 202 | dont_split_on_unrelated_variables | test.py:202:8:202:23 | ControlFlowNode for Compare | 2 |
| 213 | split12 | test.py:213:8:213:8 | ControlFlowNode for x | 1 |
| 213 | split12 | test.py:213:8:213:8 | ControlFlowNode for x | 1 |
| 218 | split13 | test.py:218:8:218:10 | ControlFlowNode for var | 2 |
| 225 | split13 | test.py:225:12:225:14 | ControlFlowNode for var | 1 |
| 225 | split13 | test.py:225:12:225:14 | ControlFlowNode for var | 1 |
| 225 | split13 | test.py:225:12:225:14 | ControlFlowNode for var | 1 |
| 236 | split14 | test.py:236:8:236:15 | ControlFlowNode for UnaryExpr | 1 |
| 236 | split14 | test.py:236:8:236:15 | ControlFlowNode for UnaryExpr | 1 |
| 241 | split15 | test.py:241:8:241:10 | ControlFlowNode for var | 2 |
| 243 | split15 | test.py:243:8:243:14 | ControlFlowNode for UnaryExpr | 1 |
| 243 | split15 | test.py:243:8:243:14 | ControlFlowNode for UnaryExpr | 1 |
| 243 | split15 | test.py:243:19:243:28 | ControlFlowNode for Attribute | 2 |
| 248 | split16 | test.py:248:8:248:11 | ControlFlowNode for cond | 2 |
| 250 | split16 | test.py:250:8:250:8 | ControlFlowNode for x | 1 |
| 250 | split16 | test.py:250:8:250:8 | ControlFlowNode for x | 1 |
| 254 | dont_split_on_different_ssa | test.py:254:8:254:10 | ControlFlowNode for var | 2 |
| 259 | dont_split_on_different_ssa | test.py:259:8:259:22 | ControlFlowNode for Compare | 2 |
| 266 | split17 | test.py:266:8:266:10 | ControlFlowNode for var | 2 |
| 270 | split17 | test.py:270:8:270:14 | ControlFlowNode for UnaryExpr | 1 |
| 270 | split17 | test.py:270:8:270:14 | ControlFlowNode for UnaryExpr | 1 |
| 274 | split17 | test.py:274:8:274:10 | ControlFlowNode for var | 1 |
| 274 | split17 | test.py:274:8:274:10 | ControlFlowNode for var | 1 |
| 278 | split17 | test.py:278:8:278:10 | ControlFlowNode for var | 1 |
| 278 | split17 | test.py:278:8:278:10 | ControlFlowNode for var | 1 |
| 282 | split17 | test.py:282:8:282:10 | ControlFlowNode for var | 1 |
| 282 | split17 | test.py:282:8:282:10 | ControlFlowNode for var | 1 |
| 289 | split18 | test.py:289:8:289:10 | ControlFlowNode for var | 2 |
| 293 | split18 | test.py:293:8:293:22 | ControlFlowNode for Compare | 1 |
| 293 | split18 | test.py:293:8:293:22 | ControlFlowNode for Compare | 2 |
| 297 | split18 | test.py:297:8:297:18 | ControlFlowNode for Compare | 1 |
| 297 | split18 | test.py:297:8:297:18 | ControlFlowNode for Compare | 1 |
| 297 | split18 | test.py:297:8:297:18 | ControlFlowNode for Compare | 1 |
| 301 | split18 | test.py:301:8:301:10 | ControlFlowNode for var | 1 |
| 301 | split18 | test.py:301:8:301:10 | ControlFlowNode for var | 1 |
| 301 | split18 | test.py:301:8:301:10 | ControlFlowNode for var | 1 |
| 305 | split18 | test.py:305:8:305:10 | ControlFlowNode for var | 1 |
| 305 | split18 | test.py:305:8:305:10 | ControlFlowNode for var | 1 |
| 305 | split18 | test.py:305:8:305:10 | ControlFlowNode for var | 1 |
| 311 | split_on_boolean_only | test.py:311:8:311:8 | ControlFlowNode for x | 2 |
| 315 | split_on_boolean_only | test.py:315:8:315:20 | ControlFlowNode for Compare | 1 |
| 315 | split_on_boolean_only | test.py:315:8:315:20 | ControlFlowNode for Compare | 2 |
| 319 | split_on_boolean_only | test.py:319:8:319:8 | ControlFlowNode for x | 1 |
| 319 | split_on_boolean_only | test.py:319:8:319:8 | ControlFlowNode for x | 1 |
| 319 | split_on_boolean_only | test.py:319:8:319:8 | ControlFlowNode for x | 1 |
| 325 | split_on_none_aswell | test.py:325:8:325:8 | ControlFlowNode for x | 2 |
| 329 | split_on_none_aswell | test.py:329:8:329:20 | ControlFlowNode for Compare | 1 |
| 329 | split_on_none_aswell | test.py:329:8:329:20 | ControlFlowNode for Compare | 2 |
| 333 | split_on_none_aswell | test.py:333:8:333:16 | ControlFlowNode for Compare | 1 |
| 333 | split_on_none_aswell | test.py:333:8:333:16 | ControlFlowNode for Compare | 1 |
| 333 | split_on_none_aswell | test.py:333:8:333:16 | ControlFlowNode for Compare | 1 |
| 339 | split_on_or_defn | test.py:339:8:339:10 | ControlFlowNode for var | 2 |
| 341 | split_on_or_defn | test.py:341:8:341:14 | ControlFlowNode for UnaryExpr | 1 |
| 341 | split_on_or_defn | test.py:341:8:341:14 | ControlFlowNode for UnaryExpr | 1 |
| 341 | split_on_or_defn | test.py:341:19:341:26 | ControlFlowNode for Attribute | 2 |
| 350 | split_on_exception | test.py:350:8:350:15 | ControlFlowNode for UnaryExpr | 1 |
| 350 | split_on_exception | test.py:350:8:350:15 | ControlFlowNode for UnaryExpr | 1 |
| 354 | partially_useful_split | test.py:354:8:354:11 | ControlFlowNode for cond | 2 |
| 359 | partially_useful_split | test.py:359:8:359:8 | ControlFlowNode for x | 1 |
| 359 | partially_useful_split | test.py:359:8:359:8 | ControlFlowNode for x | 2 |
| 365 | dont_split_not_useful | test.py:365:8:365:11 | ControlFlowNode for cond | 2 |
| 370 | dont_split_not_useful | test.py:370:8:370:8 | ControlFlowNode for y | 2 |
| 377 | f | test.py:377:8:377:8 | ControlFlowNode for x | 2 |
| 377 | f | test.py:377:14:377:14 | ControlFlowNode for y | 2 |
| 379 | f | test.py:379:8:379:19 | ControlFlowNode for UnaryExpr | 1 |
| 379 | f | test.py:379:8:379:19 | ControlFlowNode for UnaryExpr | 1 |
| 379 | f | test.py:379:8:379:19 | ControlFlowNode for UnaryExpr | 1 |
| 379 | f | test.py:379:13:379:13 | ControlFlowNode for x | 1 |
| 379 | f | test.py:379:13:379:13 | ControlFlowNode for x | 1 |
| 379 | f | test.py:379:18:379:18 | ControlFlowNode for y | 2 |
| 384 | g | test.py:384:8:384:8 | ControlFlowNode for x | 2 |
| 384 | g | test.py:384:14:384:14 | ControlFlowNode for y | 2 |
| 386 | g | test.py:386:8:386:8 | ControlFlowNode for x | 1 |
| 386 | g | test.py:386:8:386:8 | ControlFlowNode for x | 1 |
| 386 | g | test.py:386:13:386:13 | ControlFlowNode for y | 2 |
| 393 | h | test.py:393:10:393:10 | ControlFlowNode for x | 2 |
| 394 | h | test.py:394:10:394:14 | ControlFlowNode for UnaryExpr | 2 |
| 395 | h | test.py:395:10:395:10 | ControlFlowNode for x | 1 |
| 395 | h | test.py:395:10:395:10 | ControlFlowNode for x | 1 |
| 396 | h | test.py:396:10:396:17 | ControlFlowNode for Attribute() | 2 |
| 401 | j | test.py:401:8:401:8 | ControlFlowNode for a | 2 |
| 401 | j | test.py:401:13:401:13 | ControlFlowNode for b | 2 |
| 402 | j | test.py:402:12:402:12 | ControlFlowNode for a | 1 |
| 402 | j | test.py:402:12:402:12 | ControlFlowNode for a | 1 |
| 414 | split_on_strings | test.py:414:8:414:16 | ControlFlowNode for Compare | 2 |
| 414 | split_on_strings | test.py:414:8:414:16 | ControlFlowNode for Compare | 2 |
| 420 | scipy_stylee | test.py:420:12:420:31 | ControlFlowNode for Compare | 2 |
| 421 | scipy_stylee | test.py:421:8:421:15 | ControlFlowNode for Compare | 2 |
| 423 | scipy_stylee | test.py:423:10:423:17 | ControlFlowNode for Compare | 2 |
| 425 | scipy_stylee | test.py:425:10:425:17 | ControlFlowNode for Compare | 2 |
| 433 | odasa_6674 | test.py:433:8:433:29 | ControlFlowNode for dont_understand_this() | 2 |
| 439 | odasa_6674 | test.py:439:12:439:20 | ControlFlowNode for UnaryExpr | 1 |
| 439 | odasa_6674 | test.py:439:12:439:20 | ControlFlowNode for UnaryExpr | 1 |
| 447 | odasa_6625 | test.py:447:8:447:25 | ControlFlowNode for Attribute() | 2 |
| 447 | odasa_6625 | test.py:447:30:447:47 | ControlFlowNode for Attribute() | 2 |
| 449 | odasa_6625 | test.py:449:8:449:18 | ControlFlowNode for Compare | 2 |
| 454 | avoid_redundant_split | test.py:454:8:454:8 | ControlFlowNode for a | 2 |
| 458 | avoid_redundant_split | test.py:458:8:458:8 | ControlFlowNode for x | 1 |
| 458 | avoid_redundant_split | test.py:458:8:458:8 | ControlFlowNode for x | 2 |
| 460 | avoid_redundant_split | test.py:460:8:460:8 | ControlFlowNode for x | 1 |
| 460 | avoid_redundant_split | test.py:460:8:460:8 | ControlFlowNode for x | 2 |
| 468 | avoid_redundant_split | test.py:468:8:468:10 | ControlFlowNode for var | 1 |
| 468 | avoid_redundant_split | test.py:468:8:468:10 | ControlFlowNode for var | 1 |
| 468 | avoid_redundant_split | test.py:468:8:468:10 | ControlFlowNode for var | 1 |
| 468 | avoid_redundant_split | test.py:468:8:468:10 | ControlFlowNode for var | 1 |

Просмотреть файл

@ -0,0 +1,9 @@
import python
from ControlFlowNode p, Scope s
where
p.getScope() = s and
(exists (p.getATrueSuccessor()) or exists(p.getAFalseSuccessor())) and
s instanceof Function
select
p.getLocation().getStartLine(), s.getName(), p, strictcount(p.getASuccessor())

Просмотреть файл

@ -0,0 +1,471 @@
def split1(cond):
if cond:
pass
if cond:
pass
def dont_split1(cond):
if cond:
pass
cond = f()
if cond:
pass
def dont_split2(cond):
if cond:
pass
for cond in seq: pass
if cond:
pass
def split2():
try:
call()
x = True
except:
x = False
if x:
pass
def unclear_split3():
try: # May be arguably better to split here.
call()
x = True
except:
x = False
if cond: # Currently split here
x = False
if x:
pass
def split4(x):
if x is None:
x = not_none()
c if b else c
return x
def split_carefully_5(x):
if x is None:
x = not_none()
if x:
pass
return x
def dont_split_globals():
if cond:
pass
call_could_alter_any_global()
if cond:
pass
def limit_splitting1(a,b,c,d):
if a is None: a = "a"
if b is None: b = "b"
if c is None: c = "c"
if d is None: d = "d"
pass
def limit_splitting2(a,b,c,d):
if a:
pass
if b:
pass
if c:
pass
if d:
pass
#These should be pruned
if a:
a1
if b:
b1
#But not these
if c:
c1
if d:
d1
def split_on_numbers():
try:
call()
x = -1
except:
x = 0
if x:
pass
def split_try_except_else():
try:
call()
except:
x = 0
else:
x = 1
if x:
pass
#Example taken from logging module
#Splitting should allow us to deduce that module2 is defined at point of use
def logging():
try:
import module1
import module2
except ImportError:
module1 = None
if module1:
inst = module2.Class()
#Handle 'not' as well.
def split5():
try:
call()
x = True
except:
x = False
if not x:
pass
def split6():
try:
call()
x = True
except:
x = False
if not not x:
pass
def split7():
try:
call()
x = not True
except:
x = not False
if x:
pass
def split8(cond):
if cond:
t = True
else:
t = False
if not cond:
if t:
pass
def split9(var):
if var is None:
a1
else:
a2
if var is not None:
b1
else:
b2
def split10(var):
if var:
a1
else:
a2
if var is not None:
b1
else:
b2
def split11(var):
if var is None:
a1
else:
a2
if var:
b1
else:
b2
def dont_split_on_unrelated_variables(var1, var2):
if var1 is None:
a1
else:
a2
if var2 is not None:
b1
else:
b2
def split12():
try:
call()
x = None
except:
import x
if x:
pass
def split13():
var = cond()
if var:
a1
else:
a2
try:
b1
finally:
if var:
a3
def split14():
flag = False
try:
x = something()
except Exception:
99
flag = True
if not flag:
#Should be split here
pass
def split15(var):
if var:
other = 0
if not var or other.attr: #other looks like it might be undefined, but it is defined.
pass
def split16():
x = True
if cond:
x = None
if x:
use(x)
def dont_split_on_different_ssa(var):
if var:
a1
else:
a2
var = func()
if var is not None:
b1
else:
b2
def split17(var):
#Should only be split once
if var:
a1
else:
a2
if not var:
b1
else:
b2
if var:
c1
else:
c2
if var:
d1
else:
d2
if var:
e1
else:
e2
def split18(var):
#Should only be split once
if var:
a1
else:
a2
if var is not None: #Distinguishes between False and None
b1
else:
b2
if var is None:
c1
else:
c2
if var:
d1
else:
d2
if var:
e1
else:
e2
def split_on_boolean_only(x):
if x:
a1
else:
a2
if x is not None:
b1
else:
b2
if x:
c1
else:
c2
def split_on_none_aswell(x):
if x:
a1
else:
a2
if x is not None:
b1
else:
b2
if x is None:
c1
else:
c2
def split_on_or_defn(var):
if var:
obj = thing()
if not var or obj.attr: # obj is defined if reached
x
def split_on_exception():
flag = False
try:
x = do_something()
except Exception:
flag = True
if not flag:
x # x is defined here
def partially_useful_split(cond):
if cond:
x = None
else:
x = something_or_none()
other_stuff()
if x:
a1
else:
a2
def dont_split_not_useful(cond, y):
if cond:
x = None
else:
x = something_or_none()
other_stuff()
if y:
a1
else:
a2
#Splittings with boolean expressions:
def f(x,y):
if x and y:
raise
if not (x or y):
raise
pass
def g(x,y):
if x and y:
raise
if x or y:
# Either x or y is true here (exclusive).
here
end
def h(x, y):
if (
(x and
not y) or
(x and
y.meth())
):
pass
def j(a, b):
if a or b:
if a:
here
else:
there
def split_on_strings():
try:
might_fail()
x = "yes+"
except:
x = "no"
#We want to split here, even though we can't (easily) prune
if x == "no":
pass
pass
def scipy_stylee(x):
assert x in ("a", "b", "c")
if x == "a":
pass
elif x == "b":
pass
elif x == "c":
pass
else:
#unreachable
pass
def odasa_6674(x):
valid = True
if dont_understand_this():
try:
may_raise()
score = 0
except KeyError:
valid = False
if not valid:
raise ValueError()
else:
score = 1
return score
def odasa_6625(k):
value = "hi"
if k.endswith('_min') or k.endswith('_max'):
value = 0
if k == 'tags':
return value + " there"
def avoid_redundant_split(a):
if a: # Should split here
x = unknown_thing()
else:
x = None
if x: # but not here,
pass
if x: # or here, because
pass
other_stuff()
try: # we want to split here
import foo
var = True
except:
var = False
if var:
foo.bar()

Просмотреть файл

@ -0,0 +1,31 @@
| test1.py | SSA Variable l0 | 6 | test1.py:6:5:6:6 | SSA Variable l0 | 6 |
| test1.py | SSA Variable l1 | 7 | test1.py:7:5:7:6 | SSA Variable l1 | 7 |
| test1.py | SSA Variable l2 | 8 | test1.py:8:5:8:6 | SSA Variable l2 | 8 |
| test1.py | SSA Variable no_phi | 5 | test1.py:5:5:5:10 | SSA Variable no_phi | 5 |
| test2.py | SSA Variable cond | 5 | test2.py:5:5:5:8 | SSA Variable cond | 5 |
| test2.py | SSA Variable l0 | 7 | test2.py:7:9:7:10 | SSA Variable l0 | 7 |
| test2.py | SSA Variable l0 | 9 | test2.py:9:9:9:10 | SSA Variable l0 | 9 |
| test2.py | SSA Variable l0 | 10 | test2.py:7:9:7:10 | SSA Variable l0 | 7 |
| test2.py | SSA Variable l0 | 10 | test2.py:9:9:9:10 | SSA Variable l0 | 9 |
| test2.py | SSA Variable with_phi | 4 | test2.py:4:5:4:12 | SSA Variable with_phi | 4 |
| test3.py | SSA Variable l0 | 9 | test3.py:9:13:9:14 | SSA Variable l0 | 9 |
| test3.py | SSA Variable l0 | 9 | test3.py:9:13:9:14 | SSA Variable l0 | 9 |
| test3.py | SSA Variable l0 | 11 | test3.py:9:13:9:14 | SSA Variable l0 | 9 |
| test3.py | SSA Variable l0 | 11 | test3.py:9:13:9:14 | SSA Variable l0 | 9 |
| test3.py | SSA Variable l0 | 13 | test3.py:9:13:9:14 | SSA Variable l0 | 9 |
| test3.py | SSA Variable l0 | 13 | test3.py:9:13:9:14 | SSA Variable l0 | 9 |
| test3.py | SSA Variable phi_in_try | 4 | test3.py:4:5:4:14 | SSA Variable phi_in_try | 4 |
| test4.py | SSA Variable del1 | 2 | test4.py:2:5:2:8 | SSA Variable del1 | 2 |
| test4.py | SSA Variable del2 | 8 | test4.py:8:5:8:8 | SSA Variable del2 | 8 |
| test4.py | SSA Variable x | 3 | test4.py:3:5:3:5 | SSA Variable x | 3 |
| test4.py | SSA Variable x | 5 | test4.py:5:5:5:5 | SSA Variable x | 5 |
| test4.py | SSA Variable x | 9 | test4.py:9:5:9:5 | SSA Variable x | 9 |
| test4.py | SSA Variable x | 11 | test4.py:11:13:11:13 | SSA Variable x | 11 |
| test4.py | SSA Variable x | 13 | test4.py:13:9:13:9 | SSA Variable x | 13 |
| test4.py | SSA Variable x | 14 | test4.py:11:13:11:13 | SSA Variable x | 11 |
| test4.py | SSA Variable x | 14 | test4.py:13:9:13:9 | SSA Variable x | 13 |
| test5.py | SSA Variable a | 0 | test5.py:4:9:4:9 | SSA Variable a | 4 |
| test5.py | SSA Variable a | 0 | test5.py:9:9:9:9 | SSA Variable a | 9 |
| test5.py | SSA Variable a | 4 | test5.py:4:9:4:9 | SSA Variable a | 4 |
| test5.py | SSA Variable a | 9 | test5.py:9:9:9:9 | SSA Variable a | 9 |
| test6.py | SSA Variable a | 4 | test6.py:4:9:4:9 | SSA Variable a | 4 |

Просмотреть файл

@ -0,0 +1,6 @@
import python
from SsaVariable var, SsaVariable def
where def = var.getAnUltimateDefinition()
select var.getLocation().getFile().getShortName(),
var.toString(), var.getLocation().getStartLine(), def, def.getLocation().getStartLine()

Просмотреть файл

@ -0,0 +1,10 @@
#Weird formatting is so that all uses and defn are on separate lines
#to assist checking test results.
def no_phi(cond):
l0 = 0
l1 = 1
l2 = l0 + l1
return l2

Просмотреть файл

@ -0,0 +1,11 @@
#Weird formatting is so that all uses and defn are on separate lines
#to assist checking test results.
def with_phi(
cond):
if cond:
l0 = 0
else:
l0 = 1
return l0

Просмотреть файл

@ -0,0 +1,14 @@
#Weird formatting is so that all uses and defn are on separate lines
#to assist checking test results.
def phi_in_try():
try:
try:
a_call()
finally:
l0 = 0
another_call()
except:
pass
return l0

Просмотреть файл

@ -0,0 +1,15 @@
def del1():
x = 0
del x
x = 0
return x
def del2():
x = 0
if random():
del x
else:
x = 1
return x

Просмотреть файл

@ -0,0 +1,11 @@
if x:
def a():
pass
else:
def a():
pass

Просмотреть файл

@ -0,0 +1,6 @@
if x:
def a():
pass
del a

Просмотреть файл

@ -0,0 +1,6 @@
| 5 | ControlFlowNode for cond | cond | other |
| 7 | ControlFlowNode for u2 | u2 | delete |
| 10 | ControlFlowNode for u3 | u3 | delete |
| 10 | ControlFlowNode for use | use | other |
| 18 | ControlFlowNode for u2 | u2 | delete |
| 21 | ControlFlowNode for u3 | u3 | delete |

Просмотреть файл

@ -0,0 +1,21 @@
from mod import cond
del u1
if cond:
u2 = 0
del u2
del u3
use(u3)
def f():
del u1
if cond:
u2 = 0
del u2
del u3
use(u3)

Просмотреть файл

@ -0,0 +1,14 @@
import python
from SsaVariable v, string kind, ControlFlowNode use, int line
where use = v.getAUse() and
(
kind = "delete" and v.getDefinition().isDelete()
or
kind = "other " and not v.getDefinition().isDelete()
)
and line = use.getLocation().getStartLine()
and line != 0
select line, use.toString(), v.getId(), kind

Просмотреть файл

@ -0,0 +1,12 @@
| test2.py | SSA Variable l0 | 10 | test2.py:7:9:7:10 | SSA Variable l0 | 7 | 7 |
| test2.py | SSA Variable l0 | 10 | test2.py:9:9:9:10 | SSA Variable l0 | 9 | 9 |
| test2.py | SSA Variable l1 | 19 | test2.py:14:5:14:6 | SSA Variable l1 | 14 | 16 |
| test2.py | SSA Variable l1 | 19 | test2.py:18:9:18:10 | SSA Variable l1 | 18 | 18 |
| test3.py | SSA Variable l0 | 11 | test3.py:9:13:9:14 | SSA Variable l0 | 9 | 10 |
| test3.py | SSA Variable l0 | 11 | test3.py:9:13:9:14 | SSA Variable l0 | 9 | 10 |
| test3.py | SSA Variable l0 | 13 | test3.py:9:13:9:14 | SSA Variable l0 | 9 | 10 |
| test3.py | SSA Variable l0 | 13 | test3.py:11:5:11:11 | SSA Variable l0 | 11 | 12 |
| test4.py | SSA Variable x | 14 | test4.py:11:13:11:13 | SSA Variable x | 11 | 11 |
| test4.py | SSA Variable x | 14 | test4.py:13:9:13:9 | SSA Variable x | 13 | 13 |
| test5.py | SSA Variable a | 0 | test5.py:4:9:4:9 | SSA Variable a | 4 | 4 |
| test5.py | SSA Variable a | 0 | test5.py:9:9:9:9 | SSA Variable a | 9 | 9 |

Просмотреть файл

@ -0,0 +1,7 @@
import python
from SsaVariable var, SsaVariable arg, BasicBlock pred
where pred = var.getPredecessorBlockForPhiArgument(arg)
select var.getLocation().getFile().getShortName(),
var.toString(), var.getLocation().getStartLine(), arg, arg.getLocation().getStartLine(), pred.getLastNode().getLocation().getStartLine()

Просмотреть файл

@ -0,0 +1,12 @@
| test2.py | SSA Variable l0 | 10 | test2.py:7:9:7:10 | SSA Variable l0 | 7 |
| test2.py | SSA Variable l0 | 10 | test2.py:9:9:9:10 | SSA Variable l0 | 9 |
| test2.py | SSA Variable l1 | 19 | test2.py:14:5:14:6 | SSA Variable l1 | 14 |
| test2.py | SSA Variable l1 | 19 | test2.py:18:9:18:10 | SSA Variable l1 | 18 |
| test3.py | SSA Variable l0 | 11 | test3.py:9:13:9:14 | SSA Variable l0 | 9 |
| test3.py | SSA Variable l0 | 11 | test3.py:9:13:9:14 | SSA Variable l0 | 9 |
| test3.py | SSA Variable l0 | 13 | test3.py:9:13:9:14 | SSA Variable l0 | 9 |
| test3.py | SSA Variable l0 | 13 | test3.py:11:5:11:11 | SSA Variable l0 | 11 |
| test4.py | SSA Variable x | 14 | test4.py:11:13:11:13 | SSA Variable x | 11 |
| test4.py | SSA Variable x | 14 | test4.py:13:9:13:9 | SSA Variable x | 13 |
| test5.py | SSA Variable a | 0 | test5.py:4:9:4:9 | SSA Variable a | 4 |
| test5.py | SSA Variable a | 0 | test5.py:9:9:9:9 | SSA Variable a | 9 |

Просмотреть файл

@ -0,0 +1,7 @@
import python
from SsaVariable var, SsaVariable arg
where arg = var.getAPhiInput()
select var.getLocation().getFile().getShortName(),
var.toString(), var.getLocation().getStartLine(), arg, arg.getLocation().getStartLine()

Просмотреть файл

@ -0,0 +1,10 @@
#Weird formatting is so that all uses and defn are on separate lines
#to assist checking test results.
def no_phi(cond):
l0 = 0
l1 = 1
l2 = l0 + l1
return l2

Просмотреть файл

@ -0,0 +1,19 @@
#Weird formatting is so that all uses and defn are on separate lines
#to assist checking test results.
def with_phi(
cond):
if cond:
l0 = 0
else:
l0 = 1
return l0
def with_phi2(
cond):
l1 = 0
if cond:
pass
else:
l1 = 1
return l1

Просмотреть файл

@ -0,0 +1,14 @@
#Weird formatting is so that all uses and defn are on separate lines
#to assist checking test results.
def phi_in_try():
try:
try:
a_call()
finally:
l0 = 0
another_call()
except:
pass
return l0

Просмотреть файл

@ -0,0 +1,15 @@
def del1():
x = 0
del x
x = 0
return x
def del2():
x = 0
if random():
del x
else:
x = 1
return x

Просмотреть файл

@ -0,0 +1,11 @@
if x:
def a():
pass
else:
def a():
pass

Просмотреть файл

@ -0,0 +1,6 @@
if x:
def a():
pass
del a

Просмотреть файл

@ -0,0 +1,2 @@
| 15 | SSA Variable module2 |
| 20 | SSA Variable x |

Просмотреть файл

@ -0,0 +1,20 @@
from outside import cond
try:
import module1
except ImportError:
quit()
module1
try:
import module2
except ImportError:
print("Error")
module2
if cond():
x = 0
x

Просмотреть файл

@ -0,0 +1,7 @@
import python
from SsaVariable var
where var.maybeUndefined()
select
var.getDefinition().getLocation().getStartLine(), var.toString()

Просмотреть файл

@ -0,0 +1,11 @@
| test1.py | ControlFlowNode for l0 | 8 | SSA Variable l0 | 6 |
| test1.py | ControlFlowNode for l1 | 8 | SSA Variable l1 | 7 |
| test1.py | ControlFlowNode for l2 | 9 | SSA Variable l2 | 8 |
| test1.py | Exit node for Module test1 | 0 | SSA Variable no_phi | 5 |
| test2.py | ControlFlowNode for cond | 6 | SSA Variable cond | 5 |
| test2.py | ControlFlowNode for l0 | 10 | SSA Variable l0 | 10 |
| test2.py | Exit node for Module test2 | 0 | SSA Variable with_phi | 4 |
| test3.py | ControlFlowNode for l0 | 13 | SSA Variable l0 | 13 |
| test3.py | Exit node for Module test3 | 0 | SSA Variable phi_in_try | 4 |
| test5.py | Exit node for Module test5 | 0 | SSA Variable a | 0 |
| test6.py | ControlFlowNode for a | 6 | SSA Variable a | 4 |

Просмотреть файл

@ -0,0 +1,6 @@
import python
from ControlFlowNode use, SsaVariable def
where def.getAUse() = use
select use.getLocation().getFile().getShortName(),
use.toString(), use.getLocation().getStartLine(), def.toString(), def.getLocation().getStartLine()

Просмотреть файл

@ -0,0 +1,10 @@
#Weird formatting is so that all uses and defn are on separate lines
#to assist checking test results.
def no_phi(cond):
l0 = 0
l1 = 1
l2 = l0 + l1
return l2

Просмотреть файл

@ -0,0 +1,11 @@
#Weird formatting is so that all uses and defn are on separate lines
#to assist checking test results.
def with_phi(
cond):
if cond:
l0 = 0
else:
l0 = 1
return l0

Просмотреть файл

@ -0,0 +1,14 @@
#Weird formatting is so that all uses and defn are on separate lines
#to assist checking test results.
def phi_in_try():
try:
try:
a_call()
finally:
l0 = 0
another_call()
except:
pass
return l0

Просмотреть файл

@ -0,0 +1,11 @@
if x:
def a():
pass
else:
def a():
pass

Просмотреть файл

@ -0,0 +1,6 @@
if x:
def a():
pass
del a

Просмотреть файл

@ -0,0 +1,26 @@
| test1.py | test1.py:5:5:5:10 | SSA Variable no_phi | 5 |
| test1.py | test1.py:6:5:6:6 | SSA Variable l0 | 6 |
| test1.py | test1.py:7:5:7:6 | SSA Variable l1 | 7 |
| test1.py | test1.py:8:5:8:6 | SSA Variable l2 | 8 |
| test2.py | test2.py:4:5:4:12 | SSA Variable with_phi | 4 |
| test2.py | test2.py:5:5:5:8 | SSA Variable cond | 5 |
| test2.py | test2.py:7:9:7:10 | SSA Variable l0 | 7 |
| test2.py | test2.py:9:9:9:10 | SSA Variable l0 | 9 |
| test2.py | test2.py:10:12:10:13 | SSA Variable l0 | 10 |
| test3.py | test3.py:4:5:4:14 | SSA Variable phi_in_try | 4 |
| test3.py | test3.py:9:13:9:14 | SSA Variable l0 | 9 |
| test3.py | test3.py:9:13:9:14 | SSA Variable l0 | 9 |
| test3.py | test3.py:11:5:11:11 | SSA Variable l0 | 11 |
| test3.py | test3.py:13:12:13:13 | SSA Variable l0 | 13 |
| test4.py | test4.py:2:5:2:8 | SSA Variable del1 | 2 |
| test4.py | test4.py:3:5:3:5 | SSA Variable x | 3 |
| test4.py | test4.py:5:5:5:5 | SSA Variable x | 5 |
| test4.py | test4.py:8:5:8:8 | SSA Variable del2 | 8 |
| test4.py | test4.py:9:5:9:5 | SSA Variable x | 9 |
| test4.py | test4.py:11:13:11:13 | SSA Variable x | 11 |
| test4.py | test4.py:13:9:13:9 | SSA Variable x | 13 |
| test4.py | test4.py:14:12:14:12 | SSA Variable x | 14 |
| test5.py | test5.py:0:0:0:0 | SSA Variable a | 0 |
| test5.py | test5.py:4:9:4:9 | SSA Variable a | 4 |
| test5.py | test5.py:9:9:9:9 | SSA Variable a | 9 |
| test6.py | test6.py:4:9:4:9 | SSA Variable a | 4 |

Просмотреть файл

@ -0,0 +1,7 @@
import python
from SsaVariable var
select var.getLocation().getFile().getShortName(),
var, var.getLocation().getStartLine()

Просмотреть файл

@ -0,0 +1,10 @@
#Weird formatting is so that all uses and defn are on separate lines
#to assist checking test results.
def no_phi(cond):
l0 = 0
l1 = 1
l2 = l0 + l1
return l2

Просмотреть файл

@ -0,0 +1,11 @@
#Weird formatting is so that all uses and defn are on separate lines
#to assist checking test results.
def with_phi(
cond):
if cond:
l0 = 0
else:
l0 = 1
return l0

Просмотреть файл

@ -0,0 +1,14 @@
#Weird formatting is so that all uses and defn are on separate lines
#to assist checking test results.
def phi_in_try():
try:
try:
a_call()
finally:
l0 = 0
another_call()
except:
pass
return l0

Просмотреть файл

@ -0,0 +1,15 @@
def del1():
x = 0
del x
x = 0
return x
def del2():
x = 0
if random():
del x
else:
x = 1
return x

Просмотреть файл

@ -0,0 +1,11 @@
if x:
def a():
pass
else:
def a():
pass

Просмотреть файл

@ -0,0 +1,6 @@
if x:
def a():
pass
del a

Просмотреть файл

@ -0,0 +1,14 @@
| 2 | boolops.py:2:9:6:25 | ControlFlowNode for UnaryExpr |
| 2 | boolops.py:2:9:6:25 | ControlFlowNode for UnaryExpr |
| 3 | boolops.py:3:13:3:13 | ControlFlowNode for x |
| 4 | boolops.py:4:17:6:24 | ControlFlowNode for UnaryExpr |
| 4 | boolops.py:4:17:6:24 | ControlFlowNode for UnaryExpr |
| 5 | boolops.py:5:22:5:23 | ControlFlowNode for y1 |
| 6 | boolops.py:6:22:6:23 | ControlFlowNode for z1 |
| 7 | boolops.py:7:8:11:23 | ControlFlowNode for UnaryExpr |
| 7 | boolops.py:7:8:11:23 | ControlFlowNode for UnaryExpr |
| 8 | boolops.py:8:12:8:12 | ControlFlowNode for x |
| 9 | boolops.py:9:15:11:22 | ControlFlowNode for UnaryExpr |
| 9 | boolops.py:9:15:11:22 | ControlFlowNode for UnaryExpr |
| 10 | boolops.py:10:20:10:21 | ControlFlowNode for y2 |
| 11 | boolops.py:11:20:11:21 | ControlFlowNode for z2 |

Просмотреть файл

@ -0,0 +1,12 @@
/**
* @name Branch
* @description Insert description here...
* @kind problem
* @problem.severity warning
*/
import python
from ControlFlowNode f
where f.isBranch() and f.getLocation().getFile().getShortName() = "boolops.py"
select f.getLocation().getStartLine(), f

Просмотреть файл

@ -0,0 +1,23 @@
| true_false_test.py | 14 | true_false_test.py:14:12:14:16 | ControlFlowNode for cond4 | ControlFlowNode for Pass |
| true_false_test.py | 15 | true_false_test.py:15:13:15:17 | ControlFlowNode for true4 | ControlFlowNode for Pass |
| true_false_test.py | 15 | true_false_test.py:15:13:15:19 | ControlFlowNode for true4() | ControlFlowNode for Pass |
| true_false_test.py | 17 | true_false_test.py:17:13:17:18 | ControlFlowNode for false4 | ControlFlowNode for Pass |
| true_false_test.py | 17 | true_false_test.py:17:13:17:20 | ControlFlowNode for false4() | ControlFlowNode for Pass |
| true_false_test.py | 19 | true_false_test.py:19:9:19:12 | ControlFlowNode for Pass | Entry node for Function func |
| true_false_test.py | 22 | true_false_test.py:22:13:22:17 | ControlFlowNode for true5 | ControlFlowNode for ExceptStmt |
| true_false_test.py | 22 | true_false_test.py:22:13:22:19 | ControlFlowNode for true5() | ControlFlowNode for ExceptStmt |
| true_false_test.py | 35 | true_false_test.py:35:18:35:26 | ControlFlowNode for range() | Entry node for Function func |
| true_false_test.py | 48 | true_false_test.py:48:17:48:24 | ControlFlowNode for true12() | ControlFlowNode for ExceptStmt |
| true_false_test.py | 48 | true_false_test.py:48:17:48:24 | ControlFlowNode for true12() | Entry node for Function func |
| true_succ.py | 8 | true_succ.py:8:21:8:39 | ControlFlowNode for open() | ControlFlowNode for ExceptStmt |
| true_succ.py | 8 | true_succ.py:8:21:8:39 | ControlFlowNode for open() | ControlFlowNode for f |
| true_succ.py | 9 | true_succ.py:9:17:9:23 | ControlFlowNode for Attribute | ControlFlowNode for ExceptStmt |
| true_succ.py | 9 | true_succ.py:9:17:9:23 | ControlFlowNode for Attribute | ControlFlowNode for f |
| true_succ.py | 9 | true_succ.py:9:17:9:32 | ControlFlowNode for Attribute() | ControlFlowNode for ExceptStmt |
| true_succ.py | 9 | true_succ.py:9:17:9:32 | ControlFlowNode for Attribute() | ControlFlowNode for f |
| true_succ.py | 11 | true_succ.py:11:17:11:19 | ControlFlowNode for sys | ControlFlowNode for f |
| true_succ.py | 11 | true_succ.py:11:17:11:24 | ControlFlowNode for Attribute | ControlFlowNode for f |
| true_succ.py | 11 | true_succ.py:11:17:11:27 | ControlFlowNode for Attribute() | ControlFlowNode for f |
| true_succ.py | 13 | true_succ.py:13:16:13:28 | ControlFlowNode for Compare | Entry node for Function example |
| true_succ.py | 13 | true_succ.py:13:31:13:39 | ControlFlowNode for Attribute() | Entry node for Function example |
| true_succ.py | 13 | true_succ.py:13:31:13:39 | ControlFlowNode for Attribute() | Entry node for Function example |

Просмотреть файл

@ -0,0 +1,16 @@
/**
* @name TrueFalseSuccessors Test
* @description Tests true/false successors
* @kind problem
* @problem.severity warning
*/
import python
from ControlFlowNode p, ControlFlowNode s
where
s = p.getAnExceptionalSuccessor()
or
// Add fake edges for node that raise out of scope
p.isExceptionalExit(_) and s = p.getScope().getEntryNode()
select p.getLocation().getFile().getShortName(), p.getLocation().getStartLine(), p, s.toString()

Просмотреть файл

Просмотреть файл

@ -0,0 +1,7 @@
import python
from ControlFlowNode f
where f.getATrueSuccessor() = f.getAFalseSuccessor()
select f.toString()

Просмотреть файл

@ -0,0 +1,82 @@
| boolops.py | 2 | boolops.py:2:9:6:25 | ControlFlowNode for UnaryExpr | ControlFlowNode for p | False |
| boolops.py | 2 | boolops.py:2:9:6:25 | ControlFlowNode for UnaryExpr | ControlFlowNode for p | True |
| boolops.py | 3 | boolops.py:3:13:3:13 | ControlFlowNode for x | ControlFlowNode for BoolExpr | True |
| boolops.py | 3 | boolops.py:3:13:3:13 | ControlFlowNode for x | ControlFlowNode for UnaryExpr | False |
| boolops.py | 4 | boolops.py:4:17:6:24 | ControlFlowNode for UnaryExpr | ControlFlowNode for UnaryExpr | False |
| boolops.py | 4 | boolops.py:4:17:6:24 | ControlFlowNode for UnaryExpr | ControlFlowNode for UnaryExpr | True |
| boolops.py | 5 | boolops.py:5:22:5:23 | ControlFlowNode for y1 | ControlFlowNode for UnaryExpr | True |
| boolops.py | 5 | boolops.py:5:22:5:23 | ControlFlowNode for y1 | ControlFlowNode for z1 | False |
| boolops.py | 6 | boolops.py:6:22:6:23 | ControlFlowNode for z1 | ControlFlowNode for UnaryExpr | False |
| boolops.py | 6 | boolops.py:6:22:6:23 | ControlFlowNode for z1 | ControlFlowNode for UnaryExpr | True |
| boolops.py | 7 | boolops.py:7:8:11:23 | ControlFlowNode for UnaryExpr | ControlFlowNode for Str | False |
| boolops.py | 7 | boolops.py:7:8:11:23 | ControlFlowNode for UnaryExpr | ControlFlowNode for Str | True |
| boolops.py | 8 | boolops.py:8:12:8:12 | ControlFlowNode for x | ControlFlowNode for BoolExpr | False |
| boolops.py | 8 | boolops.py:8:12:8:12 | ControlFlowNode for x | ControlFlowNode for UnaryExpr | True |
| boolops.py | 9 | boolops.py:9:15:11:22 | ControlFlowNode for UnaryExpr | ControlFlowNode for UnaryExpr | False |
| boolops.py | 9 | boolops.py:9:15:11:22 | ControlFlowNode for UnaryExpr | ControlFlowNode for UnaryExpr | True |
| boolops.py | 10 | boolops.py:10:20:10:21 | ControlFlowNode for y2 | ControlFlowNode for UnaryExpr | False |
| boolops.py | 10 | boolops.py:10:20:10:21 | ControlFlowNode for y2 | ControlFlowNode for z2 | True |
| boolops.py | 11 | boolops.py:11:20:11:21 | ControlFlowNode for z2 | ControlFlowNode for UnaryExpr | False |
| boolops.py | 11 | boolops.py:11:20:11:21 | ControlFlowNode for z2 | ControlFlowNode for UnaryExpr | True |
| true_false_test.py | 3 | true_false_test.py:3:8:3:12 | ControlFlowNode for cond1 | ControlFlowNode for cond2 | False |
| true_false_test.py | 3 | true_false_test.py:3:8:3:12 | ControlFlowNode for cond1 | ControlFlowNode for true1 | True |
| true_false_test.py | 5 | true_false_test.py:5:8:5:12 | ControlFlowNode for cond2 | ControlFlowNode for Pass | True |
| true_false_test.py | 5 | true_false_test.py:5:8:5:12 | ControlFlowNode for cond2 | ControlFlowNode for false2 | False |
| true_false_test.py | 9 | true_false_test.py:9:8:9:12 | ControlFlowNode for cond3 | ControlFlowNode for false3 | False |
| true_false_test.py | 9 | true_false_test.py:9:8:9:12 | ControlFlowNode for cond3 | ControlFlowNode for true3 | True |
| true_false_test.py | 14 | true_false_test.py:14:12:14:16 | ControlFlowNode for cond4 | ControlFlowNode for false4 | False |
| true_false_test.py | 14 | true_false_test.py:14:12:14:16 | ControlFlowNode for cond4 | ControlFlowNode for true4 | True |
| true_false_test.py | 20 | true_false_test.py:20:8:20:12 | ControlFlowNode for cond5 | ControlFlowNode for Try | True |
| true_false_test.py | 20 | true_false_test.py:20:8:20:12 | ControlFlowNode for cond5 | ControlFlowNode for false5 | False |
| true_false_test.py | 27 | true_false_test.py:27:8:27:12 | ControlFlowNode for cond6 | ControlFlowNode for cond7 | True |
| true_false_test.py | 27 | true_false_test.py:27:8:27:12 | ControlFlowNode for cond6 | ControlFlowNode for false6 | False |
| true_false_test.py | 28 | true_false_test.py:28:12:28:16 | ControlFlowNode for cond7 | ControlFlowNode for false7 | False |
| true_false_test.py | 28 | true_false_test.py:28:12:28:16 | ControlFlowNode for cond7 | ControlFlowNode for true7 | True |
| true_false_test.py | 34 | true_false_test.py:34:8:34:12 | ControlFlowNode for cond8 | ControlFlowNode for false8 | False |
| true_false_test.py | 34 | true_false_test.py:34:8:34:12 | ControlFlowNode for cond8 | ControlFlowNode for range | True |
| true_false_test.py | 39 | true_false_test.py:39:8:39:12 | ControlFlowNode for cond9 | ControlFlowNode for While | True |
| true_false_test.py | 39 | true_false_test.py:39:8:39:12 | ControlFlowNode for cond9 | ControlFlowNode for false9 | False |
| true_false_test.py | 40 | true_false_test.py:40:15:40:20 | ControlFlowNode for cond10 | ControlFlowNode for false10 | False |
| true_false_test.py | 40 | true_false_test.py:40:15:40:20 | ControlFlowNode for cond10 | ControlFlowNode for true10 | True |
| true_false_test.py | 45 | true_false_test.py:45:11:45:11 | ControlFlowNode for IntegerLiteral | ControlFlowNode for cond12 | True |
| true_false_test.py | 46 | true_false_test.py:46:12:46:17 | ControlFlowNode for cond12 | ControlFlowNode for Try | True |
| true_false_test.py | 46 | true_false_test.py:46:12:46:17 | ControlFlowNode for cond12 | ControlFlowNode for While | False |
| true_false_test.py | 55 | true_false_test.py:55:11:55:16 | ControlFlowNode for condw1 | ControlFlowNode for truew2 | True |
| true_false_test.py | 55 | true_false_test.py:55:11:55:16 | ControlFlowNode for condw1 | Exit node for Function func2 | False |
| true_false_test.py | 59 | true_false_test.py:59:8:59:13 | ControlFlowNode for condi1 | ControlFlowNode for truei1 | True |
| true_false_test.py | 59 | true_false_test.py:59:8:59:13 | ControlFlowNode for condi1 | Exit node for Function func3 | False |
| true_false_test.py | 63 | true_false_test.py:63:11:63:14 | ControlFlowNode for True | ControlFlowNode for no_branch | True |
| true_false_test.py | 69 | true_false_test.py:69:11:69:14 | ControlFlowNode for True | ControlFlowNode for Break | True |
| true_false_test.py | 71 | true_false_test.py:71:8:71:13 | ControlFlowNode for cond11 | ControlFlowNode for true11 | True |
| true_false_test.py | 71 | true_false_test.py:71:8:71:13 | ControlFlowNode for cond11 | Exit node for Function func5 | False |
| true_false_test.py | 75 | true_false_test.py:75:8:75:13 | ControlFlowNode for cond13 | ControlFlowNode for cond13a | False |
| true_false_test.py | 75 | true_false_test.py:75:8:75:13 | ControlFlowNode for cond13 | ControlFlowNode for true13 | True |
| true_false_test.py | 75 | true_false_test.py:75:18:75:24 | ControlFlowNode for cond13a | ControlFlowNode for BoolExpr | False |
| true_false_test.py | 75 | true_false_test.py:75:18:75:24 | ControlFlowNode for cond13a | ControlFlowNode for true13 | True |
| true_false_test.py | 77 | true_false_test.py:77:8:77:13 | ControlFlowNode for cond14 | ControlFlowNode for cond14a | True |
| true_false_test.py | 77 | true_false_test.py:77:8:77:13 | ControlFlowNode for cond14 | ControlFlowNode for cond15 | False |
| true_false_test.py | 77 | true_false_test.py:77:19:77:25 | ControlFlowNode for cond14a | ControlFlowNode for cond15 | False |
| true_false_test.py | 77 | true_false_test.py:77:19:77:25 | ControlFlowNode for cond14a | ControlFlowNode for true14 | True |
| true_false_test.py | 79 | true_false_test.py:79:15:79:20 | ControlFlowNode for cond15 | ControlFlowNode for false15 | False |
| true_false_test.py | 79 | true_false_test.py:79:15:79:20 | ControlFlowNode for cond15 | ControlFlowNode for true15 | True |
| true_false_test.py | 80 | true_false_test.py:80:15:80:20 | ControlFlowNode for cond16 | ControlFlowNode for cond17 | False |
| true_false_test.py | 80 | true_false_test.py:80:15:80:20 | ControlFlowNode for cond16 | ControlFlowNode for true16 | True |
| true_false_test.py | 80 | true_false_test.py:80:25:80:30 | ControlFlowNode for cond17 | ControlFlowNode for false16 | False |
| true_false_test.py | 80 | true_false_test.py:80:25:80:30 | ControlFlowNode for cond17 | ControlFlowNode for true16 | True |
| true_false_test.py | 81 | true_false_test.py:81:15:81:20 | ControlFlowNode for cond18 | ControlFlowNode for cond19 | True |
| true_false_test.py | 81 | true_false_test.py:81:15:81:20 | ControlFlowNode for cond18 | ControlFlowNode for false18 | False |
| true_false_test.py | 81 | true_false_test.py:81:26:81:31 | ControlFlowNode for cond19 | ControlFlowNode for false18 | False |
| true_false_test.py | 81 | true_false_test.py:81:26:81:31 | ControlFlowNode for cond19 | ControlFlowNode for true18 | True |
| true_false_test.py | 84 | true_false_test.py:84:11:84:16 | ControlFlowNode for cond20 | ControlFlowNode for Yield | True |
| true_false_test.py | 84 | true_false_test.py:84:11:84:16 | ControlFlowNode for cond20 | ControlFlowNode for cond21 | False |
| true_false_test.py | 84 | true_false_test.py:84:21:84:26 | ControlFlowNode for cond21 | ControlFlowNode for Yield | True |
| true_false_test.py | 84 | true_false_test.py:84:21:84:26 | ControlFlowNode for cond21 | ControlFlowNode for cond22 | False |
| true_false_test.py | 85 | true_false_test.py:85:11:85:16 | ControlFlowNode for cond23 | ControlFlowNode for Yield | False |
| true_false_test.py | 85 | true_false_test.py:85:11:85:16 | ControlFlowNode for cond23 | ControlFlowNode for cond24 | True |
| true_false_test.py | 85 | true_false_test.py:85:22:85:27 | ControlFlowNode for cond24 | ControlFlowNode for Yield | False |
| true_false_test.py | 85 | true_false_test.py:85:22:85:27 | ControlFlowNode for cond24 | ControlFlowNode for cond25 | True |
| true_succ.py | 4 | true_succ.py:4:8:4:15 | ControlFlowNode for filename | ControlFlowNode for Str | False |
| true_succ.py | 4 | true_succ.py:4:8:4:15 | ControlFlowNode for filename | ControlFlowNode for Try | True |
| true_succ.py | 13 | true_succ.py:13:16:13:28 | ControlFlowNode for Compare | ControlFlowNode for Str | False |
| true_succ.py | 13 | true_succ.py:13:16:13:28 | ControlFlowNode for Compare | ControlFlowNode for f | True |
| true_succ.py | 13 | true_succ.py:13:16:13:28 | ControlFlowNode for Compare | ControlFlowNode for f | True |

Просмотреть файл

@ -0,0 +1,15 @@
/**
* @name TrueFalseSuccessors Test
* @description Tests true/false successors
* @kind problem
* @problem.severity warning
*/
import python
from ControlFlowNode p, ControlFlowNode s, string which
where
s = p.getAFalseSuccessor() and which = "False"
or
s = p.getATrueSuccessor() and which = "True"
select p.getLocation().getFile().getShortName(), p.getLocation().getStartLine(), p, s.toString(), which

Просмотреть файл

@ -0,0 +1,14 @@
def boolops(x, y1, z1, y2, z2):
p = not(
x
and not (
y1 or
z1))
if not(
x
or not (
y2 and
z2)):
return b"true"
else:
return b"false"

Просмотреть файл

@ -0,0 +1,85 @@
def func():
if cond1:
true1
if cond2:
pass
else:
false2
if cond3:
true3
else:
false3
try:
if cond4:
true4()
else:
false4()
finally:
pass
if cond5:
try:
true5()
except:
pass
else:
false5
if cond6:
if cond7:
true7
else:
false7
else:
false6
if cond8:
for i in range(10):
pass
else:
false8
if cond9:
while cond10:
true10
false10
else:
false9
while 1:
if cond12:
try:
true12()
except IOError:
true12 = 0
def func2():
while condw1:
truew2
def func3():
if condi1:
truei1
def func4():
while True:
no_branch
if unreachable:
not reachable
def func5():
while True:
break
if cond11:
true11
def func6():
if cond13 or cond13a:
true13
if cond14 and cond14a:
true14
true15 if cond15 else false15
true16 if cond16 or cond17 else false16
true18 if cond18 and cond19 else false18
def func7():
yield cond20 or cond21 or cond22
yield cond23 and cond24 and cond25

Просмотреть файл

@ -0,0 +1,16 @@
#https://semmle.com/jira/browse/ODASA-1222
def example(filename):
if filename:
try:
f = None
try:
f = open(filename, 'w')
f.write('Hello')
except IOError:
sys.exit(1)
finally:
if f is not None: f.close()
assert u"This is a false successor to the comparison"

Просмотреть файл

@ -0,0 +1,42 @@
#Test that the flow control through nested trys is handled correctly.
def f1():
try:
x = call()
finally:
try:
another_call()
except:
pass
return x
def f2():
try:
x = call()
except:
try:
another_call()
finally:
x = 0
return x
def f3():
try:
x = call()
except:
try:
another_call()
except:
pass
return x
def f4():
try:
x = call()
finally:
try:
another_call()
finally:
x = 0
return x

Просмотреть файл

@ -0,0 +1,8 @@
| test.py | SSA Variable f1 | 3 | Exit node for Module test | 0 |
| test.py | SSA Variable f2 | 13 | Exit node for Module test | 0 |
| test.py | SSA Variable f3 | 23 | Exit node for Module test | 0 |
| test.py | SSA Variable f4 | 33 | Exit node for Module test | 0 |
| test.py | SSA Variable x | 5 | ControlFlowNode for x | 11 |
| test.py | SSA Variable x | 21 | ControlFlowNode for x | 21 |
| test.py | SSA Variable x | 31 | ControlFlowNode for x | 31 |
| test.py | SSA Variable x | 40 | ControlFlowNode for x | 41 |

Просмотреть файл

@ -0,0 +1,7 @@
import python
from SsaVariable var, ControlFlowNode use
where use = var.getAUse()
select var.getLocation().getFile().getShortName(),
var.toString(), var.getLocation().getStartLine(), use.toString(), use.getLocation().getStartLine()

Просмотреть файл

@ -0,0 +1,5 @@
| a | 1 |
| b | 2 |
| c | 3 |
| ctx | 22 |
| ex | 16 |

Просмотреть файл

@ -0,0 +1,12 @@
/**
* @name Definitions
* @description Insert description here...
* @kind problem
* @problem.severity warning
*/
import python
from Name d
where d.defines(_)
select d.getId(), d.getLocation().getStartLine()

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше