I was getting odd coverage reports from one file in my Swift project. The file is a small wrapper around the swift-log library (https://github.com/apple/swift-log). In the summaries, it was shown as 171 lines, with only 25% coverage. But when I went to the actual file, it was shown correctly, with its 7 lines all covered.
I believe this is caused by the file having the same path in my project,
Sources/Logging/Logging.swift, as a file in swift-log. I checked the file that was uploaded to codecov.io and it looks like packages installed with the Swift Package Manager also get their coverage included in the report. Furthermore, when I renamed the file in my project, the problem went away.
This is a private repository. The commit before I renamed the file, which still shows the buggy behavior, is 9c1bdf7402e05c4b99d24944245e2d092d8a994e. The commit after renaming the file is 3e50e11bd10556d3ec8a2cef2152daa31b655086.