New code period shows rising amount of conditons. But Gate/Measures is not asking to cover them?

Hi Community,

I am running into some inconsistencies or conceptual missunderstandings on “New Code” on my side. I hope you can help to clarify. I was playing arround. New Code is configured for the shown branch as “Previous Version”. Accordingly the graph under “Activity” tab shows conditions rising from 41 to 50.

Everything fine so far. Going to “Measures” I would expect to find these conditions und “Coverage - On new code - Conditions to Cover”. But there I find 0. This is were I am getting confused. Is my expectation wrong? Shouldn’t it show 9 conditions to cover? Are there any setting which might leed to this behaviour?

Must-share information (formatted with Markdown):

    • Version 8.9.6 (build 50800) Scans are performed within azure pipelines context
  • trying to understand the missmatch of condtions to cover
  • reading docs

Hey there.

The New Code Period defines the date after which lines of code are considered new, and it’s from that (the set of changed lines) that most other metrics on new code are calculated from.

But there are times when this makes representing the New Code Period on a chart about uncovered conditions difficult to understand because other factors than deliberately changed lines of source code can affect these measures.

For example, you might be facing a scenario maybe some tests didn’t succeed or some tests were removed – this would clearly affect the number of uncovered conditions but not actually be caused by having changed any of the source code. So the measure will change and be recorded… but this happened outside of “New Code”.

This could also happen if you analyzed some previously unanalyzed code (like removing an exclusion for Javascript files), because those lines would be backdated… but chronologically the change in measures (like Lines of Code) would only be updated for the new analyses (lines are backdated, not measures).

It’s confusing to write about, I’m sure it’s also confusing to read about. And I understand this is all confusing when you’ve been handed a chart that overlays the New Code Period. Your brain is supposed to make some connection. I’ll refer this to our UX experts.

It might help you to check the CI logs from builds before/after the jump (and the resulting coverage reports, if they’re handy). Any change in number of tests / test success? An unxpected change in the number of files indexed?

Hey Collin,

thanks a lot for your answer. Yes, first time reading, it was slightly confusing but it pushed me in the correct dirrection! I checked the analyzed code and the actual changes. Indeed some test cases were removed. No new code but more uncovered conditions leading to the confusing graphs. But to be fair … absolutly correct.