ropensci / PostcodesioR
Showing 1 of 2 files from the diff.
Other files ignored by Codecov

@@ -20,10 +20,23 @@
Loading
20 20
#' }
21 21
#'
22 22
bulk_postcode_lookup <- function(postcodes) {
23 -
  if (!is.list(postcodes))
24 -
    stop("Please provide a list with postcodes.")
23 +
  check_list_limit(postcodes)
25 24
  r <- POST("https://api.postcodes.io/postcodes",
26 25
            body = postcodes,
27 26
            encode = "json")
28 27
  extract_results(r)
29 28
}
29 +
30 +
check_list_limit <- function(x) {
31 +
  if (!is.list(x))
32 +
    stop("Please provide a list with postcodes.")
33 +
  if (length(x) == 0)
34 +
    stop("Please provide a list with more than one postcode")
35 +
  # assuming httr::body_config which relies on jsonlite::toJSON
36 +
  # which parses all list values
37 +
  # https://github.com/jeroen/jsonlite/blob/
38 +
  # 71e2b3ab96dd8b12260b22d9a256865e59bf8351/R/asJSON.list.R
39 +
  count <- sum(sapply(x, length))
40 +
  if (count > 100)
41 +
    stop("Please prrovide a list with less than 100 postcodes.")
42 +
}
Files Coverage
R 89.51%
Project Totals (18 files) 89.51%
1
comment: false
2
language: R
3
sudo: false
4
cache: packages
5
after_success:
6
- Rscript -e 'covr::codecov()'
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading