In most cases you can use the Coding metrics API to get information for your coding metrics. However, you may have a need to extract other data about your commits from the Commits API directly.
Aggregates from the Commits API will not match commit data in Flow reports. It represents raw and pre-filtered commit data and does not automatically transform data into what’s used in reports. Orphaned commits, deleted commits, outliers, trivial commits, and duplicate commits all appear in the API response.
Note: If you want to see values for Efficiency, Coding days, Commits per day, or Impact, use the Coding metrics API. Use the Commits API for other information like finding a list of commits or seeing the HALOC of specific commits.
If you use this API to gather commit data, here are some filters we recommend you use to have the data most closely match the data you’d see in Flow reports. You can use other filters as needed.
The standard filters to use are:
-
is_merge
=false -
exclude_outliers
=true -
smart_dedupe
=true -
is_trivial
=false -
is_pr_orphan
=false -
exclude_blocked
=true
Note: Make sure you filter by author_date
and not committer_date
. While committer dates and author dates are usually the same, in some cases, they can differ greatly. Flow reports use author_date
.
If you have no rules set for advanced outlier detection, set:
-
haloc_lt
=1000
Note: If your development process includes squashing and merging, you may see pre-squashed commits returned from the Commits API. These deleted commits cannot be filtered out of the API response.