Package implementation added

This commit is contained in:
2026-02-03 14:51:45 +00:00
parent 5be7caa10d
commit 2073350af9
10 changed files with 462 additions and 1 deletions

41
README.md Normal file
View File

@@ -0,0 +1,41 @@
<!-- README.md is generated from README.Rmd. Please edit that file -->
# RComplexity
<!-- badges: start -->
<!-- badges: end -->
The goal of RComplexity is to scan a directory or file for R functions
provide a cyclic complexity score for each.
## Installation
You can install the development version of RComplexity like so:
``` r
remotes::install_git("https://git.avsdev.uk/R/RComplexity")
```
## Example
``` r
RComplexity::complexityDir("R", TRUE)
#> ...
#> # A tibble: 13 × 4
#> where what type complexity
#> <chr> <chr> <chr> <int>
#> 1 R/complexityFunction.R:141:26 getOutputComplexities FUNCTION 5
#> 2 R/complexityFunction.R:152:5 [[anon_fn]] FUNCTION 5
#> 3 R/complexityFunction.R:64:28 getFunctionComplexities FUNCTION 4
#> 4 R/complexityFunction.R:75:5 [[anon_fn]] FUNCTION 4
#> 5 R/complexityFunction.R:42:23 getExpressionLines FUNCTION 3
#> 6 R/complexityFunction.R:221:28 getObserverComplexities FUNCTION 3
#> 7 R/complexityFunction.R:234:5 [[anon_fn]] FUNCTION 3
#> 8 R/complexityDir.R:6:18 complexityDir FUNCTION 2
#> 9 R/complexityFunction.R:2:24 getFileComplexities FUNCTION 2
#> 10 R/complexityDir.R:11:32 [[anon_fn]] FUNCTION 1
#> 11 R/complexityFile.R:4:19 complexityFile FUNCTION 1
#> 12 R/complexityFunction.R:6:63 [[anon_fn]] FUNCTION 1
#> 13 R/complexityFunction.R:13:5 [[anon_fn]] FUNCTION 1
```