Incorrect coverage report that flags line with `end`

See Codecov, where the line with end is flagged as uncovered, but lines leading up to it are covered. I wonder how to get the report working correctly?