LogoLogo
Book a demoLog in
  • Swarmia documentation
  • Getting started
    • Get started in 15 minutes
    • Integrations
      • GitHub
        • GitHub Enterprise Server
        • Multiple GitHub organizations
        • Forked repositories
        • Troubleshooting
          • Reinstalling the Swarmia GitHub app
          • Updating app permissions
          • Installing Swarmia outside of GitHub Marketplace
      • Jira
        • Jira Server and Jira Data Center
        • Multiple Jira organizations
        • Limiting Jira project access
      • Linear
        • Private Linear teams
        • Disconnect Linear
      • Slack
        • Private Slack channels
      • Authentication
        • Google Single Sign-On
          • Frequently asked questions
        • Okta Single Sign-On
      • HR systems
      • Data export
        • Data cloud
        • Export data as a CSV file
      • Other integrations
        • Other issue tracker integrations
        • Other source code hosting integrations
  • Configurations for data quality
    • Teams & members
      • Creating & managing teams
        • Teams API
      • Contributors
      • Roles and permissions
      • Inviting team members
    • Issue tracker configuration
      • Jira configuration
      • Jira best practices
      • Linear configuration
    • Pull request exclusions
    • Linking pull requests to issues
    • Investment categories
    • Deployments
      • Generate deployments from merged pull requests
      • Generate deployments from GitHub deployments
      • Generate deployments from GitHub checks
      • Generate deployments via the API
        • Generate deployments for monorepos via the API
    • Sprint configuration
  • Use cases
    • Improve pull request flow
      • Pull request insights
      • Reducing pull request cycle time
      • Review code faster
      • Managing pull requests in progress with the Pull Request view
      • Diagnosing low pull request throughput
      • Analyzing pull request batch size
  • Improve your team's focus
    • Optimizing issue cycle time
    • Analyzing activity patterns on Work Log
    • Grouping activity on the Work Log view
    • Focus summary
  • Balance engineering investments
    • Activity and effort-based models
    • Categorizing work
    • Common problems with balancing engineering investment
  • Deliver strategic initiatives
    • Forecasting initiatives
  • Capitalize software development costs
  • Run developer experience surveys
    • Creating a survey
    • Managing surveys
    • Viewing and sharing survey results
    • How we show your survey responses
    • Survey communication guide and templates
  • Track DORA metrics
    • Automatic change failure detection
    • How Swarmia links PRs to deployments
  • Coach software developers
  • Get visibility into your CI pipeline
  • Continuous improvement
    • Working agreements
  • Notifications
    • Team notifications
    • Personal notifications
  • Notes
  • Retrospectives with Swarmia
  • Metrics & definitions
    • Pull request cycle time
      • What's the difference between "Change lead time" and "Pull request cycle time" metrics in Swarmia?
    • Issue cycle time
      • Defining issue lifecycle and cycle time
    • Developer effort (FTEs)
  • DORA metrics
    • Change lead time
    • Deployment frequency
    • Mean time to recovery
    • Change failure rate
  • Throughput
  • Time to deploy
  • Batch size
  • Flow efficiency
  • Scope creep
  • Sprints
  • GitHub Copilot metrics
  • Frequently asked questions
    • How do you treat weekends in metrics?
    • Tracking squashed commits
    • How do merge queues affect my metrics?
    • Why is my commit not visible in Swarmia?
    • How do I account for people leaving my organization?
  • Resources
    • Security & data retention
      • Data security
      • Data access
      • Swarmia IP Addresses
      • Single Sign-On (SSO) / SAML
      • Can I get a copy of the SOC 2 Type II audit report?
      • Deleting your organization
  • Pricing & plans
    • Compare plans
    • Free plan
    • Do I need a credit card to start a free trial?
    • What are the differences between the individual modules and the standard plan?
    • How do you determine the number of developers for billing?
    • What happens to customers with the Lite plan after the December 2024 pricing and plan change?
  • Changelog
On this page
  • Reducing the amount of large pull requests
  • Excluding auto-generated files

Was this helpful?

  1. Use cases
  2. Improve pull request flow

Analyzing pull request batch size

Batch size measures how much work is bundled up in a change. Swarmia offers tools for evaluating pull request batch size by looking at the total amount of changes.

PreviousDiagnosing low pull request throughputNextImprove your team's focus

Last updated 2 months ago

Was this helpful?

There are several ways of measuring the complexity of pull requests. Analyzing at the amount of changes, or the absolute size of the diff, is the most common and robust way to do this.

While there are circumstances where very large pull requests are valid, it's recommended to break down the work to smaller increments.

The main benefit of doing so is an improved flow of work. This tends to happen because the team is changing things in smaller increments, which are quicker to author, and also easier to review. Reviews can be more thorough when there are less changes to analyze at one go, and this adds up to an increase in the quality of the code base. Furthermore, smaller changes help get the reviews more quickly than, say, for a 500+ line monster, which might be demoralizing to even start looking at.

Reducing the amount of large pull requests

There's no absolute limit to a large pull request, but what matters most is the typical batch size. We recommend keeping close attention on the amount of PRs with more than 200 lines of changes.

The pull request provide visibility to the typical batch size, and the batch size distribution. Teams can see how many large PRs are going through the system, and analyze these more closely.

By interacting with the distribution, you can analyze a section or sections in the distribution. Doing this filters both the scatter plot and the table containing detailed pull request information to the selected bucket(s).

We recommend looking for patterns or similarities to help analyze what's driving a trend for a large batch size, or significantly lower cycle time. You may find that certain themes of work, some repositories, or specific features often result in bigger batches, or changes that take significantly more time and effort.

Excluding auto-generated files

It's important to focus on only the actual changes when analyzing pull requests. However, repositories often contain generated files, which could be related to e.g. package dependencies.

In order to provide an accurate view to the real changes, Swarmia automatically cleans up the total change count of some commonly used generated files.

Excluded file names:

Cargo.toml
go.sum
maven-metadata.xml
package-lock.json
pnpm-lock.yaml
yarn.lock

Excluded file extensions:

.betterer.results
.bundle
.classpath
.lock.hcl
.lock
.snap
.suo

Excluded directories:

generated

and on the top level only,

vendor

See also:

Diagnosing low pull request throughput
Batch Size Insights