Dataset: Issues & Pull Requests
Entity: Pull Requests
Field ID: additions
Type: Integer
Description: The number of lines of code added in the pull request. For issues, the value is calculated from resolving pull requests.
Source: App (Pull Requests) / Calculated (Issues)
Transformation logic:
Pull Requests: use the native diff data from the source application.
Issues: sum the lines added by all resolving pull requests.
From: |
|
Github (PRs, Issues) |
|
Gitlab (PRs, Issues) | Calculated from an API-based PR diff |
Bitbucket (PRs) |
|
Azure DevOps (PRs, Issues) | Calculated from a git-based code diff |
JIRA (Issues) | Inferred from resolving PRs |
ClickUp (Issues) | Inferred from resolving PRs |
Trello (Issues) | Inferred from resolving PRs |
Reporting Use Cases
The Lines Added field is a fundamental metric for quantifying the volume of new code being introduced into your projects. As a numeric field, it is highly versatile and can be used for filtering, aggregation, and creating advanced KPIs to understand your team's development patterns.
Filtering by PR Size: You can create reports that focus on pull requests of a specific size, which is useful for code review management and process compliance.
Identify Large PRs: Find pull requests that might be too large and difficult to review by using a filter like
Lines Added > 1000. This can help enforce best practices of keeping PRs small and focused.Analyze Minor Changes: Isolate small bug fixes or documentation updates by filtering for
Lines Added < 50.
Measuring Development Output: This field is a primary input for any metric related to the volume of work.
Total Output: A KPI with the custom formula
SUM(additions)will show the total number of lines of new code your team has shipped in a given period.Average PR Size: You can track whether PRs are staying manageable by calculating the average number of lines added per PR with
AVG(additions).
Custom Formulas for Advanced Health Metrics: additions is a key component in more sophisticated calculations that provide deeper insights into your code's health.
Refactoring Ratio: This important metric compares the amount of code being removed to the amount being added. It is calculated with a formula like
ROUND(SUM(deletions) / IF_ZERO(SUM(additions), 1) * 100, 2). A healthy ratio indicates that the team is actively removing old code and not just adding new features.Code Churn: additions is a core component of "code churn" (the total volume of changes). You can measure the total churn with the formula
SUM(additions) + SUM(deletions)(equivalent toSUM(lines_changed)).
