Closing Curly Brace Marked as Uncovered

We have an issue where our Sonar is reporting code coverage isn’t showing the last curly brace of a try catch block not being covered. There are 3 occurrences of this happening within the same file. We have also seen this occur in other places like using statements.

Below is an example of a code block that is similar to our issue. Has anyone come across similar issues? Were you able to remediate the issue?

public FubarMethod()
{
    try
    {
    }
    catch
    {
      _logger.Log();
    } <- Uncovered Line
}

Hi,

Welcome to the community!

For coverage, we go 100% by what your coverage report says. So if that } is showing up as uncovered in SonarQube Cloud, its because your coverage report says its uncovered.

Sorry, but you’ll need to take this up with whomever supplies your coverage engine.

 
HTH,
Ann