MCPcopy Index your code
hub / github.com/tirth8205/code-review-graph / _get_params

Method _get_params

code_review_graph/parser.py:6031–6049  ·  view source on GitHub ↗

Extract parameter list as a string.

(self, node, language: str, source: bytes)

Source from the content-addressed store, hash-verified

6029 return None
6030
6031 def _get_params(self, node, language: str, source: bytes) -> Optional[str]:
6032 """Extract parameter list as a string."""
6033 for child in node.children:
6034 param_types = (
6035 "parameters", "formal_parameters",
6036 "parameter_list", "formal_parameter_list",
6037 )
6038 if child.type in param_types:
6039 return child.text.decode("utf-8", errors="replace")
6040 # Solidity: parameters are direct children between ( and )
6041 if language == "solidity":
6042 params = [
6043 c.text.decode("utf-8", errors="replace")
6044 for c in node.children
6045 if c.type == "parameter"
6046 ]
6047 if params:
6048 return f"({', '.join(params)})"
6049 return None
6050
6051 def _get_return_type(self, node, language: str, source: bytes) -> Optional[str]:
6052 """Extract return type annotation if present."""

Calls

no outgoing calls

Tested by

no test coverage detected