Exemplo n.º 1
0
 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), )
Exemplo n.º 2
0
    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)