I work on a lot of PHP projects and I really like the way PHPUnit handles this. You can exclude code from the coverage analysis with annotations. You basically flag classes, methods or functions with @codeCoverageIgnore and can even wrap blocks of code with @codeCoverageIgnoreStart and @codeCoverageIgnoreEnd. That way, developers directly see whether the code they are working on is covered.
I know that Istanbul and JaCoCo have similar annotations. If your language/tools don't, you're left with conventions and that often doesn't work so well. Humans are humans, after all.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I work on a lot of PHP projects and I really like the way PHPUnit handles this. You can exclude code from the coverage analysis with annotations. You basically flag classes, methods or functions with
@codeCoverageIgnore
and can even wrap blocks of code with@codeCoverageIgnoreStart
and@codeCoverageIgnoreEnd
. That way, developers directly see whether the code they are working on is covered.I know that Istanbul and JaCoCo have similar annotations. If your language/tools don't, you're left with conventions and that often doesn't work so well. Humans are humans, after all.