# Quality Risks Exceed Code Changes

## Problem <a href="#problem" id="problem"></a>

I see a higher number of QRs in the Chrome Extension than the amount of modified/added code of my Pull Request. Few of the QRs are even in files not modified in my specific PR !

## Cause #1 (Most common) <a href="#cause-1-most-common" id="cause-1-most-common"></a>

The target branch contains commits that were not merged from the target branch to the pull request branch

<figure><img src="https://4057366433-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAjqTCMRYvHhDgsdPLUnc%2Fuploads%2FrBfPno1L1zgdoGSzELxs%2Fimage-20210317-161828.png?alt=media&#x26;token=ca6aea9e-8f27-4ac0-a8ff-c9fb9efddebd" alt="" width="563"><figcaption></figcaption></figure>

## Solution #1 <a href="#solution-1" id="solution-1"></a>

Configure the pull request flow to merge from the target branch (even if done locally) prior to running the build scanner

{% code overflow="wrap" lineNumbers="true" %}

```
//retrieve the PR source code from the Git based SCM
git clone git@github.repo/repo.git
​
//create a local integration branch starting from the target branch - do not push it to the remote
git checkout -b <local-integration-branch-name> <target-branch>
​
//Merge pull request into local integration branch
git pull --ff git@github.repo/repo.git <pull-request-branch>
​
...
//run sealights build
```

{% endcode %}

## Cause #2  <a href="#cause-2" id="cause-2"></a>

The target branch contains commits that were not reported to SeaLights and the user merged from the target branch to the pull request branch.

{% hint style="warning" %}
A common reason is with target branch that have builds reported based on predefined frequency (hourly, daily) rather than after every single merge (commit) to that branch.\
Sealights recommendation is for the later option.
{% endhint %}

<figure><img src="https://4057366433-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAjqTCMRYvHhDgsdPLUnc%2Fuploads%2Fo6KisPGACdwLJSFgV6W6%2Fimage-20210317-161840.png?alt=media&#x26;token=3d0b0e95-3215-4d8f-a5fd-35b35aa021f3" alt="" width="563"><figcaption></figcaption></figure>

## Solution #2 <a href="#solution-2" id="solution-2"></a>

Validate in the CI server (Jenkins, Bamboo…) that the every commit from the SCM (target branch) is reported to Sealights via an automated build.\
If not, initiate a build from both the target branch and then the PR branch.
