Skip to content

Commit

Permalink
Update assess_size_codebase.R
Browse files Browse the repository at this point in the history
Addresses #362 

## Description

This change only list files with R source code. An example of a "valid" package where this metric fails is [bayesPop](https://cran.r-project.org/web/packages/bayesPop/index.html) because it has an RDA file inside the R directory.
  • Loading branch information
Gotfrid authored Feb 14, 2025
1 parent 39489b2 commit 70f8688
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion R/assess_size_codebase.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ assess_size_codebase.pkg_install <- function(x, ...) {
assess_size_codebase.pkg_source <- function(x, ...) {
pkg_metric_eval(class = "pkg_metric_size_codebase", {
# create character vector of function files
files <- list.files(path = file.path(x$path, "R"), full.names = T)
files <- list.files(
path = file.path(x$path, "R"),
pattern = "\\.R$",
full.names = TRUE,
ignore.case = TRUE
)

# define the function for counting code base
count_lines <- function(x){
Expand Down

0 comments on commit 70f8688

Please sign in to comment.