check_cyclomatic_complexity {packager} | R Documentation |
Check Cyclomatic Complexity
Description
Run
cyclocomp_package_dir
on the
package throwing an error when the maximum complexity is exceeded.
Usage
check_cyclomatic_complexity(path = ".", max_complexity = 10)
Arguments
path |
Path to the package directory (see
|
max_complexity |
The maximum |
Value
Invisibly TRUE
if
maximum cyclomatic complexity
is not exceeded, throws an error
otherwise.
See Also
Other maintenance functions:
check_archive()
,
check_codetags()
,
check_news()
,
check_usage()
,
get_check_status()
Examples
## Not run:
# download and untar sources of some archived package
package <- "excerptr"
root <- paste0("http://cran.r-project.org/src/contrib/Archive/", package)
version <- "1.0.0"
tarball <- paste0(paste(package, version, sep = "_"), ".tar.gz")
remote_tarball <- paste(root, tarball, sep = "/")
local_tarball <- file.path(tempdir(), tarball)
utils::download.file(remote_tarball, local_tarball)
utils::untar(local_tarball, exdir = tempdir())
res <- tryCatch(check_cyclomatic_complexity(path = file.path(tempdir(),
package)),
error = identity)
print(res)
## End(Not run)
[Package packager version 1.15.2 Index]