def _check_wrong_function_called(self, node: ast.Call) -> None: function_name = functions.given_function_called( node, FUNCTIONS_BLACKLIST, ) if function_name: self.add_violation( WrongFunctionCallViolation(node, text=function_name), )
def visit_Call(self, node: ast.Call) -> None: """ Used to find ``FUNCTIONS_BLACKLIST`` calls. Raises: WrongFunctionCallViolation """ function_name = given_function_called(node, FUNCTIONS_BLACKLIST) if function_name: self.add_violation(WrongFunctionCallViolation( node, text=function_name, )) self.generic_visit(node)