MCPcopy Create free account
hub / github.com/GPTScan/GPTScan / is_empty_function

Function is_empty_function

src/antlr4helper/callgraph.py:61–70  ·  view source on GitHub ↗
(content: str)

Source from the content-addressed store, hash-verified

59
60
61def is_empty_function(content: str) -> bool:
62 if "{" not in content:
63 return True
64 body = content[content.index("{")+1:content.rindex("}")].strip()
65 empty_line_num = len(body.split("\n\n")) - 1
66 if body == "":
67 return True
68 elif len(body.split(";")) + empty_line_num <= 3:
69 return True
70 return False
71
72
73def get_loc(content: str) -> int:

Callers 1

__cleanMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected