If a file that ends with a new line char (\n), we count it as a line in the file in the scanner, but it doesn't get detected as a new line when working with git diff to detect new lines of code, in the context of SLB and PRs.
The behavior in the context of leak periods is unknown (haven't tested it).
As a result, if the entire file is new and it ends with a new line char, the measure of lines will not match the measure of new lines.
For example: A new file with the content 'my\nfile\n' will have 3 "lines" and 2 "new lines".
The solution will be to detect this situation when getting the list of changed lines from the SCM and add the last line when it makes sense.
See mismatching numbers here:
Result from /api/measures/component: