The calculation of metrics regarding new code should depend on the new way of detecting "new lines".
A "new line" is now defined in different ways depending on the context and on the available data:
- If it's a long lived branch -> Use changed dates of each line (either coming from SCM or generated) and compare them with the start of the leak period;
- If it's a SLB or P/R -> Try to load this information from the scanner report. If it's present, this info was provided by the SCM plugin, which detected which lines are new compared to the target branch. Otherwise, fallback to using the changed dates of each line, comparing with the time when the branch was created.