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 number of changes in a single pull request.
Definition
Batch size is calculated by the lines of code changed (lines added + lines removed) in a given pull request.
Excluding auto-generated files
Repositories often contain generated files, which could be related to e.g. package dependencies. In order to provide an accurate view of the real changes, Swarmia automatically cleans up the total change count of some commonly used generated files.
Excluded file names:
Cargo.toml
Manifest file for Cargo (Rust)
Cartfile.resolved
Carthage lockfile (iOS)
go.sum
Go dependency checksums
gradlew
Gradle wrapper script (Android)
gradlew.bat
Gradle wrapper script (Windows)
local.properties
Local Android config (machine-specific)
maven-metadata.xml
Maven metadata (Android/Java)
package-lock.json
NPM lockfile (JS/TS)
Package.resolved
SwiftPM lockfile (iOS)
pnpm-lock.yaml
pnpm lockfile (JS/TS)
Podfile.lock
CocoaPods lockfile (iOS)
yarn.lock
Yarn lockfile (JS/TS)
Excluded file extensions:
betterer.results
Betterer test snapshots (JS/TS)
bundle
Java/Maven/OSGi bundle descriptors (generated)
classpath
Eclipse / Gradle classpath metadata
iml
IntelliJ / Android Studio module files
lock
Generic lockfiles (Gradle, NPM, CocoaPods, etc.)
log
Build/runtime/crash logs
mode1v3
Old Xcode user state
mode2v3
Old Xcode user state
lock.hcl
Terraform lockfile
pbxuser
Xcode project user settings
perspectivev3
Xcode UI layout state
snap
Snapshot test files (Jest, AVA, etc.)
suo
Visual Studio solution user options
svg
Scalable Vector Graphics
xcuserstate
Xcode workspace state
Excluded directories:
.gradle
Gradle cache (Android)
.idea
IntelliJ/Android Studio project settings
.vscode
VS Code project settings
.xcuserdata
Xcode user-specific project data
.xcworkspace
Xcode workspace metadata (iOS/macOS)
app/build/generated
Android generated sources
app/build/intermediates
Android intermediate build outputs
node_modules
JavaScript dependencies (auto-generated)
Excluded top-level directories:
build
Build output (Android)
DerivedData
Xcode build output (iOS/macOS)
Example
A pull request with 541 lines added and 215 lines removed (+541 -215) has a batch size of 756.
Why it matters
Splitting work into small increments is a great way to improve delivery.
Small pull requests are easier to plan, review, and deploy.
We suggest keeping the pull request size under 500 lines of code and paying attention to work that ends up spanning over 1,000+ lines.
Read more in Analyzing pull request batch size
How to use it
In Swarmia, the chart that shows the pull request size vs cycle time shows a set of pull requests in the selected time frame and charts them based on their individual cycle time and the total number of lines of code changed in the pull request. This chart allows you to see correlations between the size of a pull request and its cycle time.

Seeing the distribution of larger batch sizes and higher cycle times can indicate that your team needs to focus on delivering smaller batch sizes. This change can improve not only your cycle time but also your quality.
See also Analyzing pull request batch size
Where to find it
You can find batch size metrics under Insights → Code → Batch size.
Last updated
Was this helpful?