@utils.check_messages('missing-docstring', 'empty-docstring')
def visit_functiondef(self, node):
    if (self.config.no_docstring_rgx.match(node.name) is None):
        ftype = ('method' if node.is_method() else 'function')
        if (is_property_setter(node) or is_property_deleter(node) or is_overload_stub(node)):
            return
        if isinstance(node.parent.frame(), astroid.ClassDef):
            overridden = False
            confidence = (interfaces.INFERENCE if utils.has_known_bases(node.parent.frame()) else interfaces.INFERENCE_FAILURE)
            for ancestor in node.parent.frame().ancestors():
                if ((node.name in ancestor) and isinstance(ancestor[node.name], astroid.FunctionDef)):
                    overridden = True
                    break
            self._check_docstring(ftype, node, report_missing=(not overridden), confidence=confidence)
        elif isinstance(node.parent.frame(), astroid.Module):
            self._check_docstring(ftype, node)
        else:
            return
@utils.check_messages('missing-docstring', 'empty-docstring')
def visit_functiondef(self, node):
    if (self.config.no_docstring_rgx.match(node.name) is None):
        ftype = ('method' if node.is_method() else 'function')
        if (is_property_setter(node) or is_property_deleter(node) or is_overload_stub(node)):
            return
        if isinstance(node.parent.frame(), astroid.ClassDef):
            overridden = False
            confidence = (interfaces.INFERENCE if utils.has_known_bases(node.parent.frame()) else interfaces.INFERENCE_FAILURE)
            for ancestor in node.parent.frame().ancestors():
                if ((node.name in ancestor) and isinstance(ancestor[node.name], astroid.FunctionDef)):
                    overridden = True
                    break
            self._check_docstring(ftype, node, report_missing=(not overridden), confidence=confidence)
        elif isinstance(node.parent.frame(), astroid.Module):
            self._check_docstring(ftype, node)
        else:
            return