cobraphp 0.1.0.dev8__py3-none-any.whl → 0.1.0.dev9__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.
@@ -12,7 +12,7 @@ from ._call_graph_nodes import CallEdge, CallNode, FuncNode, SiteNode
12
12
  __all__ = ["CallGraph", "CallNode", "FuncNode", "SiteNode", "CallEdge"]
13
13
 
14
14
 
15
- class CallGraph(AbcGraphQuerier[CallNode, CallEdge]): # type: ignore[misc]
15
+ class CallGraph(AbcGraphQuerier[CallNode, CallEdge]):
16
16
  """Call graph tracking function declarations and call sites.
17
17
 
18
18
  Uses cpg2py.Storage backend for directed multigraph representation.
@@ -9,7 +9,7 @@ from cpg2py import AbcEdgeQuerier, AbcNodeQuerier, Storage
9
9
  from ._errors import StaticAnalysisError
10
10
 
11
11
 
12
- class CallNode(AbcNodeQuerier): # type: ignore[misc]
12
+ class CallNode(AbcNodeQuerier):
13
13
  """Abstract base for call graph node metadata.
14
14
 
15
15
  Extends AbcNodeQuerier to access call graph node properties
@@ -161,7 +161,7 @@ class SiteNode(CallNode):
161
161
  self._storage_ref.set_node_prop(self.node_id, "caller_id", value)
162
162
 
163
163
 
164
- class CallEdge(AbcEdgeQuerier): # type: ignore[misc]
164
+ class CallEdge(AbcEdgeQuerier):
165
165
  """Storage wrapper for call graph edge (call site to callee).
166
166
 
167
167
  Attributes:
@@ -187,9 +187,9 @@ class CallEdge(AbcEdgeQuerier): # type: ignore[misc]
187
187
  @property
188
188
  def callsite_node_id(self) -> str:
189
189
  """AST node ID of call expression (alias for from_nid)."""
190
- return cast(str, self.from_nid)
190
+ return self.from_nid
191
191
 
192
192
  @property
193
193
  def callee_node_id(self) -> str:
194
194
  """AST node ID of function declaration (alias for to_nid)."""
195
- return cast(str, self.to_nid)
195
+ return self.to_nid
@@ -472,7 +472,7 @@ class _Recognizer:
472
472
  def _type_name(self, node: Node) -> Node | None:
473
473
  for child in self._ast.succ(node):
474
474
  if child.node_type in _NAME_TYPES:
475
- return cast(Node, child)
475
+ return child
476
476
  if child.node_type == "NullableType":
477
477
  inner = _first_child(self._ast, child)
478
478
  if inner is not None and inner.node_type in _NAME_TYPES:
@@ -2,8 +2,6 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import cast
6
-
7
5
  from php_parser_py import AST, Node
8
6
 
9
7
  from ._call_graph import CallGraph
@@ -129,7 +127,7 @@ def _get_arg_expression_id(ast: AST, arg_node_id: str) -> str | None:
129
127
  children = list(ast.succ(arg_node))
130
128
  if not children:
131
129
  return None
132
- return cast(str, children[0].id)
130
+ return children[0].id
133
131
 
134
132
 
135
133
  def _get_param_variable_id(ast: AST, param_node_id: str) -> str | None:
@@ -139,5 +137,5 @@ def _get_param_variable_id(ast: AST, param_node_id: str) -> str | None:
139
137
  return None
140
138
  for child in ast.succ(param_node):
141
139
  if child.node_type == "Expr_Variable":
142
- return cast(str, child.id)
140
+ return child.id
143
141
  return None
@@ -10,7 +10,7 @@ from cpg2py import AbcEdgeQuerier, AbcGraphQuerier, AbcNodeQuerier, Storage
10
10
  from ._errors import StaticAnalysisError
11
11
 
12
12
 
13
- class DataFlowNode(AbcNodeQuerier): # type: ignore[misc]
13
+ class DataFlowNode(AbcNodeQuerier):
14
14
  """Storage wrapper for dataflow graph node taint metadata."""
15
15
 
16
16
  def __init__(self, storage: Storage, node_id: str) -> None:
@@ -34,7 +34,7 @@ class DataFlowNode(AbcNodeQuerier): # type: ignore[misc]
34
34
  return len(self.taints) > 0
35
35
 
36
36
 
37
- class DataFlowEdge(AbcEdgeQuerier): # type: ignore[misc]
37
+ class DataFlowEdge(AbcEdgeQuerier):
38
38
  """Storage wrapper for dataflow graph edge."""
39
39
 
40
40
  def __init__(self, storage: Storage, f_nid: str, t_nid: str, e_type: str) -> None:
@@ -42,7 +42,7 @@ class DataFlowEdge(AbcEdgeQuerier): # type: ignore[misc]
42
42
  self._storage_ref = storage
43
43
 
44
44
 
45
- class DataFlowGraph(AbcGraphQuerier[DataFlowNode, DataFlowEdge]): # type: ignore[misc]
45
+ class DataFlowGraph(AbcGraphQuerier[DataFlowNode, DataFlowEdge]):
46
46
  """Data flow graph tracking taint propagation via cpg2py Storage."""
47
47
 
48
48
  def __init__(self) -> None:
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cobraphp
3
- Version: 0.1.0.dev8
3
+ Version: 0.1.0.dev9
4
4
  Summary: Placeholder for the Python interface of CobraPHP, a static taint analyzer for PHP projects.
5
5
  License-Expression: GPL-2.0-only
6
6
  Requires-Python: >=3.11.5
7
7
  Description-Content-Type: text/markdown
8
8
  License-File: LICENSE
9
- Requires-Dist: cpg2py==1.2.2
9
+ Requires-Dist: cpg2py==1.2.3
10
10
  Requires-Dist: php-parser-py==3.0.1
11
11
  Requires-Dist: semgrep==1.85.0
12
12
  Requires-Dist: setuptools<82
@@ -11,15 +11,15 @@ cobraphp/results.py,sha256=fc5CUVPZ__SDdKyxQ1UyQJt3FSM6yfzOfaBCGL1Wtss,3055
11
11
  cobraphp/analysis/__init__.py,sha256=s-5zkF4CmBl-WwB97kUF7Jws8oW49zNpVJQwhLcBzIQ,3197
12
12
  cobraphp/analysis/_ast_types.py,sha256=vi0gkMxFHLDK7Jd_Qgj1h5iVf9BTGR2x5OhOtIkkq5E,926
13
13
  cobraphp/analysis/_call_builder.py,sha256=g1PDH1W--dPMDU7fqNHtvNFf0dHOQrn4iAeY1e0ZgaE,5353
14
- cobraphp/analysis/_call_graph.py,sha256=nlo_8VCvc5JzVTrH7MMicbT49Rgwd-EuAewLrJoALx8,8081
15
- cobraphp/analysis/_call_graph_nodes.py,sha256=MuXtGdNe4iNals-0yPeLhykdxEr1JEjk1h_YypLLIaA,6205
14
+ cobraphp/analysis/_call_graph.py,sha256=ZZvQcAS1fj-xVRlgxvSVA7-pypvoMoFneTcSBcs3YMU,8059
15
+ cobraphp/analysis/_call_graph_nodes.py,sha256=JqRbiommhzqiaUZEG-ffE_dZgEajfn4w18qISmB_8eo,6139
16
16
  cobraphp/analysis/_callee_index.py,sha256=Xe182lfniuDRLO5SikQxZBmvjhEWp22xMDl72KtQGek,5854
17
17
  cobraphp/analysis/_database_write_reach.py,sha256=7QX01xuwbOR-Z4G5_y9T2NZY5ctk_s2RtpthCEIxDaI,9255
18
- cobraphp/analysis/_database_writes.py,sha256=-CbUA1ox3nmhbBJjY5VL0BYkCtabcfrrvp7AeRZ2uaY,75811
18
+ cobraphp/analysis/_database_writes.py,sha256=LcpM5AG91_0A4fuuzTovGDcBvFERgNKMOVQotC_7wSI,75799
19
19
  cobraphp/analysis/_declarations.py,sha256=_ex7gSD6sTyKWv38SjuC66qNkUDz4_pYukKPE9_9as0,1122
20
20
  cobraphp/analysis/_defuse_assignments.py,sha256=f_LrdQeNExdSpGsadjKETd4GI97HC_64C3Qq4BAbO-c,1466
21
21
  cobraphp/analysis/_defuse_builder.py,sha256=Jvbe9micUGx4oEQYK6ZM9PJya_HJL24pvB_mpIAQY1Q,10969
22
- cobraphp/analysis/_defuse_interproc.py,sha256=kNBICZkbYxEwtLtPfkxEPsNe_aHN_rHQ8K-n4OANOSw,4749
22
+ cobraphp/analysis/_defuse_interproc.py,sha256=lnkl4Z5aXD7uppFRfxtT4q3jHpDfhn64CFw1vlu4C8M,4702
23
23
  cobraphp/analysis/_defuse_values.py,sha256=1T2D6T4XWz1mK1y_fkw5h5WUlI1c-rlOG7X0X6GwP54,3210
24
24
  cobraphp/analysis/_errors.py,sha256=cn71QQpesqbkitJdkg9bMIcvXlPixRxol7CjOMZM0i0,531
25
25
  cobraphp/analysis/_file_filter.py,sha256=8z9-2ZANnjRGqDbnP6UQcUf0Hpjf_4C72yTgC8cqcDw,6056
@@ -30,7 +30,7 @@ cobraphp/analysis/_project_root.py,sha256=cuS_sOGZBqDp5H6HWn_xLaxAyVlsfxwADgc0Mh
30
30
  cobraphp/analysis/_records.py,sha256=ZTC9RCL1DoOi7ctLvBk6P10QqXaOqdxoNX776UUuuRE,6026
31
31
  cobraphp/analysis/_semgrep_runner.py,sha256=HwLfxi3Ql86IRQhyNvvtoa-uOPkWF168GfGed7d8_SA,14588
32
32
  cobraphp/analysis/_source_kinds.py,sha256=0LH0kkSQ13c7Ys2kf4QhwuCpyKKC3rn6c9ZXadkr47Q,144
33
- cobraphp/analysis/_taint_graph.py,sha256=UZePCPW4dcfwckJ5R4UuIetIoNcJc4Io_H4qX0rZWro,7814
33
+ cobraphp/analysis/_taint_graph.py,sha256=xKrUP4vF0EA-6iqyQ14hu-giMnxpYzJW1FZBnaMd3tY,7748
34
34
  cobraphp/analysis/_taint_propagator.py,sha256=xmP_3G9T5Sgeie7yeq6Fca9bUsRyOnnwYzf-gyD_-iQ,10741
35
35
  cobraphp/analysis/_taint_rules.py,sha256=b77hFwh6zURdqfx6jWZwTbS24hE03t7wtlYEckgaO5I,4822
36
36
  cobraphp/analysis/_value_dependency.py,sha256=AlMPHJLaEyMfdUeaDe2w3b9M5MU37_Jz8eEvYVG6Mq0,4333
@@ -39,8 +39,8 @@ cobraphp/analysis/frameworks.toml,sha256=1DOuupZ5vpIsSxygKywFA3d6jElGvn6-fL2_wsu
39
39
  cobraphp/analysis/php_ast_types.toml,sha256=yMtPKzOHDY9nm6NCKtMzxziug1z29kC3rSfh2bk46DM,1598
40
40
  cobraphp/analysis/rules/database_taint.yaml,sha256=xCx64v2RjponPfEYZOQUqSqP_ltV8YB-t5NldjOstcI,3495
41
41
  cobraphp/analysis/rules/user_input_taint.yaml,sha256=47nknffSg_wIKGPg8Ya-r4POa4nWswopju2IEkcFvtc,6998
42
- cobraphp-0.1.0.dev8.dist-info/licenses/LICENSE,sha256=-cN1ob5KQfe3AwHdg8kcuJ5BVnR4hZt37vN1pS14JQU,18091
43
- cobraphp-0.1.0.dev8.dist-info/METADATA,sha256=wViDAWn01uDA3F7uAzjvIGUcsQSZBBmWNwty1lXLZXk,6822
44
- cobraphp-0.1.0.dev8.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
45
- cobraphp-0.1.0.dev8.dist-info/top_level.txt,sha256=55CayiaOZMnPngJQf8IqO50E-l0BQONI8DTpnn-gtJk,9
46
- cobraphp-0.1.0.dev8.dist-info/RECORD,,
42
+ cobraphp-0.1.0.dev9.dist-info/licenses/LICENSE,sha256=-cN1ob5KQfe3AwHdg8kcuJ5BVnR4hZt37vN1pS14JQU,18091
43
+ cobraphp-0.1.0.dev9.dist-info/METADATA,sha256=HnkIiRSYVBsZjK5QPV1IpJfttq_lsK9Js_cUJEgk_eY,6822
44
+ cobraphp-0.1.0.dev9.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
45
+ cobraphp-0.1.0.dev9.dist-info/top_level.txt,sha256=55CayiaOZMnPngJQf8IqO50E-l0BQONI8DTpnn-gtJk,9
46
+ cobraphp-0.1.0.dev9.dist-info/RECORD,,