| line | code | calls | time | 
|---|
| 1 | { | 0 | 0 | 
| 2 | checkmate::assertFile(path, access = "r") | 2 | 0 | 
| 3 | findings <- NULL | 2 | 0.01 | 
| 4 | dots <- list(...) | 2 | 0 | 
| 5 | check_file_layout_defaults <- formals(check_file_layout) | 2 | 0 | 
| 6 | check_functions_defaults <- append(formals(check_functions_in_file), formals(check_function_layout)) | 2 | 0 | 
| 7 | known_defaults <- append(check_file_layout_defaults, check_functions_defaults) | 2 | 0 | 
| 8 | if (!all(names(dots) %in% names(known_defaults))) { | 2 | 0 | 
| 9 | stop(paste("got unkown argument(s): ", paste(names(dots)[!names(dots) %in% names(known_defaults)], collapse = ", "))) | 0 | 0 | 
| 10 | } | 0 | 0 | 
| 11 | arguments <- append(list(path = path), dots) | 2 | 0 | 
| 12 | use <- utils::modifyList(check_file_layout_defaults, arguments, keep.null = TRUE) | 2 | 0 | 
| 13 | arguments_to_use <- use[names(use) %in% names(check_file_layout_defaults)] | 2 | 0 | 
| 14 | arguments_to_use <- arguments_to_use[arguments_to_use != ""] | 2 | 0 | 
| 15 | finding <- tryCatch(do.call("check_file_layout", arguments_to_use), cleanr = function(e) return(e[["message"]])) | 2 | 0 | 
| 16 | findings <- c(findings, finding) | 2 | 0 | 
| 17 | use <- utils::modifyList(check_functions_defaults, arguments, keep.null = TRUE) | 2 | 0 | 
| 18 | arguments_to_use <- use[names(use) %in% names(check_functions_defaults)] | 2 | 0 | 
| 19 | arguments_to_use <- arguments_to_use[arguments_to_use != ""] | 2 | 0 | 
| 20 | arguments_to_use <- arguments_to_use[names(arguments_to_use) != "function_name"] | 2 | 0 | 
| 21 | finding <- tryCatch(do.call("check_functions_in_file", arguments_to_use), cleanr = function(e) return(e[["message"]])) | 2 | 0 | 
| 22 | findings <- c(findings, finding) | 2 | 0.05 | 
| 23 | findings <- tidy_findings(findings) | 2 | 0 | 
| 24 | if (!is.null(findings)) { | 2 | 0 | 
| 25 | throw(paste(names(findings), findings, sep = " ", collapse = "\n")) | 1 | 0 | 
| 26 | } | 0 | 0 | 
| 27 | return(invisible(TRUE)) | 1 | 0 | 
| 28 | } | 0 | 0 |