Title: | Metrics for Your Code Repository |
---|---|
Description: | Metrics for your code repository. Call one function to generate an interactive dashboard displaying the state of your code. |
Authors: | Mark Padgham [aut, cre] |
Maintainer: | Mark Padgham <[email protected]> |
License: | GPL-3 |
Version: | 0.1.6.079 |
Built: | 2025-02-21 12:37:56 UTC |
Source: | https://github.com/ropensci-review-tools/repometrics |
Apply pkgstats across the git history of a package
repo_pkgstats_history(path, step_days = 1L, num_cores = -1L)
repo_pkgstats_history(path, step_days = 1L, num_cores = -1L)
path |
Path to local repository containing an R package. |
step_days |
Analyse package at intervals of this number of days. The
last commit for each day is chosen. For example, |
num_cores |
Number of cores to use in multi-core processing. Has no
effect on Windows operating systems, on which calculations are always
single-core only. Negative values are subtracted from number of available
cores, determined as |
NULL
if path
is not an R package, or if no pkgstats
results are able to be extracted. Otherwise, a list of three items:
desc_data Containing data from DESCRIPTION
files, along with data on
numbers of functions.
loc Containing data on "lines-of-code" for all languages and sub-directories within package.
stats Containing statistics on (mean, medium, and sum) of various properties of each function in package.
Other data:
repometrics_data()
,
repometrics_data_repo()
,
repometrics_data_user()
Start quarto dashboard with results of main repometrics_data_repo function.
repometrics_dashboard( data, action = "preview", ctb_threshold = NULL, max_ctbs = NULL )
repometrics_dashboard( data, action = "preview", ctb_threshold = NULL, max_ctbs = NULL )
data |
Data on repository and all contributors as returned from repometrics_data function applied to one package. |
action |
One of "preview", to start and open a live preview of the dashboard website, or "render" to render a static version without previewing or opening. |
ctb_threshold |
An optional single numeric value between 0 and 1. If specified, contributions are arranged in cumulative order, and the contributor data reduced to only those who contribute to this proportion of all contributions. |
max_ctbs |
Optional maximum number of contributors to be included. This
is an alternative way to reduce number of contributors presented in
dashboard, and may only be specified if |
(Invisibly) Path to main "index.html" document of quarto site. Note
that the site must be served with action = "preview"
, and will not work by
simply opening this "index.html" file.
This function collates all data for a local R package or repository needed to create a dashboard with the repometrics_dashboard function. It combines data from both the repometrics_data_repo and repometrics_data_user functions.
repometrics_data( path, step_days = 1L, num_cores = -1L, ended_at = Sys.time(), nyears = 1 )
repometrics_data( path, step_days = 1L, num_cores = -1L, ended_at = Sys.time(), nyears = 1 )
path |
Path to local repository containing an R package. |
step_days |
Analyse package at intervals of this number of days. The
last commit for each day is chosen. For example, |
num_cores |
Number of cores to use in multi-core processing. Has no
effect on Windows operating systems, on which calculations are always
single-core only. Negative values are subtracted from number of available
cores, determined as |
ended_at |
Parameter used in some aspects of resultant data to limit
the end date of data collection. Defaults to |
nyears |
Parameter <= 1 determining fraction of a year over which data
up until |
A list of three forms of data:
"pkgstats" containing statistics on the historical development of package code, derived from the pkgstats package;
"rm" containing data from GitHub on the repository, including data on contributors, issues, pull requests, and people watching and starring the repository.
"contributors" as a named list of data on every individual contributor to the repository, whether by code contributions or GitHub issues or discussions.
Other data:
repo_pkgstats_history()
,
repometrics_data_repo()
,
repometrics_data_user()
This forms part of the data collated by the main repometrics_data function, along with detailed data on individual contributors extracted by the repometrics_data_user function.
repometrics_data_repo(path, step_days = 1L, num_cores = -1L)
repometrics_data_repo(path, step_days = 1L, num_cores = -1L)
path |
Path to local repository containing an R package. |
step_days |
Analyse package at intervals of this number of days. The
last commit for each day is chosen. For example, |
num_cores |
Number of cores to use in multi-core processing. Has no
effect on Windows operating systems, on which calculations are always
single-core only. Negative values are subtracted from number of available
cores, determined as |
A list with two main items:
"pkgstats" Containing summary data from apply pkgstats
routines
across the git history of the repository.
"cm" Containing data used to derive "CHAOSS metrics", primarily from GitHub data.
Other data:
repo_pkgstats_history()
,
repometrics_data()
,
repometrics_data_user()
This forms part of the data collated by the main repometrics_data function, along with data on repository structure and historical developed extracted by the repometrics_data_repo function.
repometrics_data_user( login, ended_at = Sys.time(), nyears = 1, n_per_page = 100 )
repometrics_data_user( login, ended_at = Sys.time(), nyears = 1, n_per_page = 100 )
login |
GitHub login of user |
ended_at |
Parameter used in some aspects of resultant data to limit
the end date of data collection. Defaults to |
nyears |
Parameter <= 1 determining fraction of a year over which data
up until |
n_per_page |
Number of items per page to pass to GitHub GraphQL API requests. This should never need to be changed. |
A list of the following data.frame
objects:
commit_cmt
with details of commits made on commits
commits
with summaries of all repositories to which user made commits
followers
A list of followers of specified user
following
A list of other people who nominated user is following
general
with some general information about specified user
issue_cmts
with information on all issue comments made by user
issues
with information on all issues opened by user
Other data:
repo_pkgstats_history()
,
repometrics_data()
,
repometrics_data_repo()