Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Slather 2.8.5 generates Cobertura file wtih incorrect hit count for condition lines

Open
#582 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
ruby
Domain
testing-qa

Research direction

Start by tracing the Cobertura report generation for branch and condition coverage, then inspect how Slather reads Xcode coverage data for lines containing macros. Reproduce the reported case with the supplied command and compare the generated hit count with condition coverage on line 27. Done means the report no longer shows zero hits alongside 100% condition coverage for that case.

Written by the indexing model from the issue text.

Description

When running slather coverage -x --output-directory Coverage/ --arch arm64 --scheme MyScheme whe noticed that the Cobertura file generated by Slather had lines where the hits="0" but the condition-coverage="100%". If the condition-coverage is at 100%, it would have had to have hit that line.

If the hits="0", how can the condition-converage be 100%?

 <line number="23" branch="true" hits="13" condition-coverage="100% (3/3)">
  <conditions>
    <condition number="0" type="jump" coverage="100%"/>
  </conditions>
</line>
<line number="24" branch="false" hits="13"/>
<line number="25" branch="true" hits="13" condition-coverage="0% (0/2)">
  <conditions>
    <condition number="0" type="jump" coverage="0%"/>
  </conditions>
</line>
<line number="26" branch="true" hits="0" condition-coverage="0% (0/2)"> 
  <conditions>
    <condition number="0" type="jump" coverage="0%"/>
  </conditions>
</line>
<line number="27" branch="true" hits="0" condition-coverage="100% (1/1)">  <-------- How can hits=0 with condition-coverage 100%
  <conditions>
    <condition number="0" type="jump" coverage="100%"/>
  </conditions>
</line>

	22 |  for (SomeElement *childNode in node.children) {
	23 |	  if ([childNode.name isEqualToString:SomeThing]) {
	24 |	    [self _doSomething:childNode];
	25 |	  } else {
	26 |	    SomeMacroForPrintingWithIfInIt(@"someMessage %@", childNode.name);
	27 |	  }
	28 |	}	

Note the problematic line is line 27 having a hit=0 with a condiiton-coverage=100%.

Dominant language
Ruby
Stars
1.6k
Forks
239
Avg merge
10h 19m
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from SlatherOrg/slather

All issues in SlatherOrg/slather

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.