> For the complete documentation index, see [llms.txt](https://docs.sealights.io/knowledgebase/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sealights.io/knowledgebase/coverage-and-quality-insights/test-gaps-report/code-changes-calculation.md). Agents can also search and read this documentation through its [MCP server](https://docs.sealights.io/knowledgebase/~gitbook/mcp).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
