Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-3710

Branch/Condition Coverage Display Improvement

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 3.1, 3.1.1
    • Fix Version/s: None
    • Component/s: Coverage & Tests
    • Labels:
      None

      Description

      In sonar 3.1, branch coverage is diplay like the following example:

      181 1 2/4 if (parent == null || child == null)

      { 182 // an event without associated path information 183 return null; 184 }

      185 else {
      186 int index = child.getIndex();
      187 1 2/2 if (index > 0)

      { 188 return PathFactoryImpl.getInstance().create(parent, child.getName(), index, false); 189 }

      else

      { 190 return PathFactoryImpl.getInstance().create(parent, child.getName(), false); 191 }

      In the first branch we have 2 covered conditions and we know the branch as
      never been true, however we dont know which condition have been evaluated to
      true. Ok in this case both have been evaluated to true, but when having 1/4
      or 3/4 in there than its impossible to know.

      A good way of presenting this would be,

      T/F for the branch in one column, and then in another column for each condition also T/F description.

      Merging this with line coverage needs to be figured out.

      Thanks..

      Check discussion in: http://sonar.15.n6.nabble.com/Metric-for-method-level-code-coverage-td5001317.html

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                jmecosta Jorge Costa
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: