Sonar pull request question

Hello everybody
I am quite new to sonar and I have some questions regarding pull request analysis.

In a pull request only and exclusively the changes of that pull request are analysed?

The duplicated lines in a pull request are analysed only for the changes themselves or is a comparison made with the whole project looking for duplicity?

Thanks in advance

The results of a pull request should only include changed lines – and, duplication in the context of a pull request is calculated only on the lines included in the pull request. It won’t be until the code is merged that you can be sure you are introducing no duplicate code in the context of your entire codebase.