inheritdoc issues identified unnecessarily

I find ReSharper 2017.2.2 identifying a lack of <inheritdoc /> as a Potential Code Quality Issues even when there is nothing to inherit. Consider the below example. The MyException constructor could inherit documentation from the base constructor, but the base constructor only provides a summary. Since the child constructor also provides a summary there is nothing to inherit.

I suggest that ReSharper only suggest <inheritdoc /> when the sub class/method is missing documentation that the parent includes. This would be very handy indeed.

Is it ReSharper guidance that all inherited classes / methods always use <inheritdoc />? I would be interested in more information on the guidance around this issue.



1 comment
Official comment

Hello Terrence,

thanks for your question. ReSharper currently always makes a hint for adding the tag, when the base implementation provides some kind of documentation (like summary, exceptions or remarks). In your case, I agree that inheriting the base documentation is not meaningful. We should actually check if there is any other tag left for inheritance. That is especially important for exception documentation.

All inspections around inheritdoc are still pretty new, and even in Roslyn, this feature is not yet finalized. For the next minor release, I will try to get this particular case fixed. Meanwhile, you can either suppress the warning with a comment, or disable the inspection completely if it bothers you. Generally speaking, I think that we can't expect a world without false positives, but let's see!

Hope that helps. If you have any further questions or recommendations, I'd be glad to hear from you.


Please sign in to leave a comment.