skylos 1.0.10__py3-none-any.whl → 2.5.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- skylos/__init__.py +9 -3
- skylos/analyzer.py +674 -168
- skylos/cfg_visitor.py +60 -0
- skylos/cli.py +719 -235
- skylos/codemods.py +277 -0
- skylos/config.py +50 -0
- skylos/constants.py +78 -0
- skylos/gatekeeper.py +147 -0
- skylos/linter.py +18 -0
- skylos/rules/base.py +20 -0
- skylos/rules/danger/calls.py +119 -0
- skylos/rules/danger/danger.py +157 -0
- skylos/rules/danger/danger_cmd/cmd_flow.py +75 -0
- skylos/rules/danger/danger_fs/__init__.py +0 -0
- skylos/rules/danger/danger_fs/path_flow.py +79 -0
- skylos/rules/danger/danger_net/__init__.py +0 -0
- skylos/rules/danger/danger_net/ssrf_flow.py +80 -0
- skylos/rules/danger/danger_sql/__init__.py +0 -0
- skylos/rules/danger/danger_sql/sql_flow.py +245 -0
- skylos/rules/danger/danger_sql/sql_raw_flow.py +96 -0
- skylos/rules/danger/danger_web/__init__.py +0 -0
- skylos/rules/danger/danger_web/xss_flow.py +170 -0
- skylos/rules/danger/taint.py +110 -0
- skylos/rules/quality/__init__.py +0 -0
- skylos/rules/quality/complexity.py +95 -0
- skylos/rules/quality/logic.py +96 -0
- skylos/rules/quality/nesting.py +101 -0
- skylos/rules/quality/structure.py +99 -0
- skylos/rules/secrets.py +325 -0
- skylos/server.py +554 -0
- skylos/visitor.py +502 -90
- skylos/visitors/__init__.py +0 -0
- skylos/visitors/framework_aware.py +437 -0
- skylos/visitors/test_aware.py +74 -0
- skylos-2.5.2.dist-info/METADATA +21 -0
- skylos-2.5.2.dist-info/RECORD +42 -0
- {skylos-1.0.10.dist-info → skylos-2.5.2.dist-info}/WHEEL +1 -1
- {skylos-1.0.10.dist-info → skylos-2.5.2.dist-info}/top_level.txt +0 -1
- skylos-1.0.10.dist-info/METADATA +0 -8
- skylos-1.0.10.dist-info/RECORD +0 -21
- test/compare_tools.py +0 -604
- test/diagnostics.py +0 -364
- test/sample_repo/app.py +0 -13
- test/sample_repo/sample_repo/commands.py +0 -81
- test/sample_repo/sample_repo/models.py +0 -122
- test/sample_repo/sample_repo/routes.py +0 -89
- test/sample_repo/sample_repo/utils.py +0 -36
- test/test_skylos.py +0 -456
- test/test_visitor.py +0 -220
- {test → skylos/rules}/__init__.py +0 -0
- {test/sample_repo → skylos/rules/danger}/__init__.py +0 -0
- {test/sample_repo/sample_repo → skylos/rules/danger/danger_cmd}/__init__.py +0 -0
- {skylos-1.0.10.dist-info → skylos-2.5.2.dist-info}/entry_points.txt +0 -0
skylos/cfg_visitor.py
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# import ast
|
|
2
|
+
|
|
3
|
+
# class BasicBlock:
|
|
4
|
+
# def __init__(self, id):
|
|
5
|
+
# self.id = id
|
|
6
|
+
# self.statements = []
|
|
7
|
+
# self.exits = []
|
|
8
|
+
# self.incoming = []
|
|
9
|
+
|
|
10
|
+
# def add_edge(self, target_block):
|
|
11
|
+
# self.exits.append(target_block)
|
|
12
|
+
# target_block.incoming.append(self)
|
|
13
|
+
|
|
14
|
+
# class CFGBuilder(ast.NodeVisitor):
|
|
15
|
+
# def __init__(self):
|
|
16
|
+
# self.blocks = []
|
|
17
|
+
# self.current_block = None
|
|
18
|
+
# self.cfgs = {}
|
|
19
|
+
|
|
20
|
+
# def _new_block(self):
|
|
21
|
+
# block = BasicBlock(len(self.blocks))
|
|
22
|
+
# self.blocks.append(block)
|
|
23
|
+
# return block
|
|
24
|
+
|
|
25
|
+
# def visit_FunctionDef(self, node):
|
|
26
|
+
# entry_block = self._new_block()
|
|
27
|
+
# self.cfgs[node.name] = entry_block
|
|
28
|
+
# self.current_block = entry_block
|
|
29
|
+
|
|
30
|
+
# for stmt in node.body:
|
|
31
|
+
# self.visit(stmt)
|
|
32
|
+
|
|
33
|
+
# def visit_If(self, node):
|
|
34
|
+
# self.current_block.statements.append(node.test)
|
|
35
|
+
|
|
36
|
+
# cond_block = self.current_block
|
|
37
|
+
# then_block = self._new_block()
|
|
38
|
+
# else_block = self._new_block()
|
|
39
|
+
# join_block = self._new_block()
|
|
40
|
+
|
|
41
|
+
# cond_block.add_edge(then_block)
|
|
42
|
+
# cond_block.add_edge(else_block)
|
|
43
|
+
|
|
44
|
+
# self.current_block = then_block
|
|
45
|
+
# for stmt in node.body:
|
|
46
|
+
# self.visit(stmt)
|
|
47
|
+
# self.current_block.add_edge(join_block)
|
|
48
|
+
|
|
49
|
+
# self.current_block = else_block
|
|
50
|
+
# for stmt in node.orelse:
|
|
51
|
+
# self.visit(stmt)
|
|
52
|
+
# self.current_block.add_edge(join_block)
|
|
53
|
+
|
|
54
|
+
# self.current_block = join_block
|
|
55
|
+
|
|
56
|
+
# def generic_visit(self, node):
|
|
57
|
+
# if isinstance(node, ast.stmt):
|
|
58
|
+
# if self.current_block:
|
|
59
|
+
# self.current_block.statements.append(node)
|
|
60
|
+
# super().generic_visit(node)
|