# Code Changes Calculation

Code changes calculation in TGA reports refers to the process of identifying the modifications made to your codebase between two specific points in time. This information is crucial for understanding the impact of code changes on test coverage and identifying test gaps.

## **Default Reference Build**

By default, TGA reports use the **last build prior to the selected date range** as the reference build for code changes calculation. This means the report will compare the most recent build within the specified timeframe to the latest build prior to the specified timeframe. This comparison is performed within the same branch.

## **Branching Scenarios**

When working with branched codebases, you may want to compare the current branch to a different branch as the reference point. This is particularly useful when analyzing changes introduced in a specific branch relative to a main or base branch.

## **Code Changes Between Branches**

SeaLights allows you to **select a different reference build for code changes calculation** in TGA reports,  when working with branched codebases. The system will automatically detect applications and branches where branching out has occurred (based on API calls declaring branching out). When creating a new TGA report for such a branch, users will be presented with two options for selecting the reference build:

* **Default Definition (Last Build Prior to Selected Range):** This option maintains the standard TGA report behavior. The reference build will be the last build executed in the branch before the user-defined date range for the new report.
* **Latest Build in Branching Out Point:** This new option empowers users to explicitly select the latest build from the point where the branch diverged from the main codebase.&#x20;

This provides greater flexibility and enables you to analyze code changes from the perspective of a different branch, offering deeper insights into the impact of specific changes.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sealights.io/knowledgebase/coverage-and-quality-insights/test-gaps-report/code-changes-calculation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
