hugheylab/pmparser

lintr found issues with code

Closed this issue · 0 comments

  1. R/drop_pmid_version.R line 31: Compound semicolons are discouraged. Replace them by a newline. (https://github.com/hugheylab/pmparser/blob/master/R/drop_pmid_version.R#L31)
    qStart; tableName; tableKeep; # so glue works in dopar   
  2. R/drop_pmid_version.R line 31: Trailing semicolons are not needed. (https://github.com/hugheylab/pmparser/blob/master/R/drop_pmid_version.R#L31)
    qStart; tableName; tableKeep; # so glue works in dopar   
  3. R/get_pubmed_files.R line 88: Trailing semicolons are not needed. (https://github.com/hugheylab/pmparser/blob/master/R/get_pubmed_files.R#L88)
    remoteDir;   
  4. R/get_pubmed_files.R line 104: Trailing semicolons are not needed. (https://github.com/hugheylab/pmparser/blob/master/R/get_pubmed_files.R#L104)
    remoteDir;   
  5. R/modify_pubmed_db.R line 221: Compound semicolons are discouraged. Replace them by a newline. (https://github.com/hugheylab/pmparser/blob/master/R/modify_pubmed_db.R#L221)
    deleteStart; sourceKeep; # so glue works in dopar   
  6. R/modify_pubmed_db.R line 221: Trailing semicolons are not needed. (https://github.com/hugheylab/pmparser/blob/master/R/modify_pubmed_db.R#L221)
    deleteStart; sourceKeep; # so glue works in dopar   
  7. R/parse_element.R line 156: 1:.N is likely to be wrong in the empty edge case. Use seq_len(.N) instead. (https://github.com/hugheylab/pmparser/blob/master/R/parse_element.R#L156)
    dPmid[rep.int(1:.N, nIds)],   
  8. R/parse_element.R line 208: 1:.N is likely to be wrong in the empty edge case. Use seq_len(.N) instead. (https://github.com/hugheylab/pmparser/blob/master/R/parse_element.R#L208)
    dPmid[rep.int(1:.N, nHist)],   
  9. R/parse_element.R line 278: 1:.N is likely to be wrong in the empty edge case. Use seq_len(.N) instead. (https://github.com/hugheylab/pmparser/blob/master/R/parse_element.R#L278)
    dPmid[rep.int(1:.N, xml_length(x1))],   
  10. R/parse_element.R line 305: 1:.N is likely to be wrong in the empty edge case. Use seq_len(.N) instead. (https://github.com/hugheylab/pmparser/blob/master/R/parse_element.R#L305)
    dPmid[rep.int(1:.N, nDescPerPmid)],   
  11. R/parse_element.R line 311: 1:.N is likely to be wrong in the empty edge case. Use seq_len(.N) instead. (https://github.com/hugheylab/pmparser/blob/master/R/parse_element.R#L311)
    x3[, descriptor_pos := 1:.N, by = pmid]   
  12. R/parse_element.R line 324: 1:.N is likely to be wrong in the empty edge case. Use seq_len(.N) instead. (https://github.com/hugheylab/pmparser/blob/master/R/parse_element.R#L324)
    x3[rep.int(1:.N, nQualPerDesc), colnames(dPmid), with = FALSE],   
  13. R/parse_element.R line 358: 1:.N is likely to be wrong in the empty edge case. Use seq_len(.N) instead. (https://github.com/hugheylab/pmparser/blob/master/R/parse_element.R#L358)
    dPmid[rep.int(1:.N, n)],   
  14. R/parse_element.R line 385: 1:.N is likely to be wrong in the empty edge case. Use seq_len(.N) instead. (https://github.com/hugheylab/pmparser/blob/master/R/parse_element.R#L385)
    dPmid[rep.int(1:.N, n)],   
  15. R/parse_element.R line 412: 1:.N is likely to be wrong in the empty edge case. Use seq_len(.N) instead. (https://github.com/hugheylab/pmparser/blob/master/R/parse_element.R#L412)
    dPmid[rep.int(1:.N, n)],   
  16. R/parse_element.R line 437: 1:.N is likely to be wrong in the empty edge case. Use seq_len(.N) instead. (https://github.com/hugheylab/pmparser/blob/master/R/parse_element.R#L437)
    dPmid[rep.int(1:.N, nBanksPerPmid)],   
  17. R/parse_element.R line 440: 1:.N is likely to be wrong in the empty edge case. Use seq_len(.N) instead. (https://github.com/hugheylab/pmparser/blob/master/R/parse_element.R#L440)
    x5 = x4[rep.int(1:.N, nAccsPerBank)]   
  18. R/parse_element.R line 457: 1:.N is likely to be wrong in the empty edge case. Use seq_len(.N) instead. (https://github.com/hugheylab/pmparser/blob/master/R/parse_element.R#L457)
    dPmid[rep.int(1:.N, n)],   
  19. R/parse_element.R line 479: 1:.N is likely to be wrong in the empty edge case. Use seq_len(.N) instead. (https://github.com/hugheylab/pmparser/blob/master/R/parse_element.R#L479)
    dPmid[rep.int(1:.N, x3)],   
  20. R/parse_element.R line 484: 1:.N is likely to be wrong in the empty edge case. Use seq_len(.N) instead. (https://github.com/hugheylab/pmparser/blob/master/R/parse_element.R#L484)
    x5[, abstract_pos := 1:.N, by = pmid]   
  21. R/parse_person.R line 26: 1:.N is likely to be wrong in the empty edge case. Use seq_len(.N) instead. (https://github.com/hugheylab/pmparser/blob/master/R/parse_person.R#L26)
    dPmidNow[rep.int(1:.N, nPersons)],   
  22. R/parse_person.R line 39: 1:.N is likely to be wrong in the empty edge case. Use seq_len(.N) instead. (https://github.com/hugheylab/pmparser/blob/master/R/parse_person.R#L39)
    dPerson[, person_pos := 1:.N, by = pmid]   
  23. R/parse_person.R line 69: 1:.N is likely to be wrong in the empty edge case. Use seq_len(.N) instead. (https://github.com/hugheylab/pmparser/blob/master/R/parse_person.R#L69)
    dAffil[, affil_idx := 1:.N]   
  24. R/parse_person.R line 98: 1:.N is likely to be wrong in the empty edge case. Use seq_len(.N) instead. (https://github.com/hugheylab/pmparser/blob/master/R/parse_person.R#L98)
    dPerson[, person_idx := 1:.N]   

To have lintr ignore any of these issues, add the appropriate lines of those shown below to lint_ignore.csv at the top-level of the repository:

filename,line_number,message,line
R/drop_pmid_version.R,31,Compound semicolons are discouraged. Replace them by a newline.,qStart; tableName; tableKeep; # so glue works in dopar
R/drop_pmid_version.R,31,Trailing semicolons are not needed.,qStart; tableName; tableKeep; # so glue works in dopar
R/get_pubmed_files.R,88,Trailing semicolons are not needed.,remoteDir;
R/get_pubmed_files.R,104,Trailing semicolons are not needed.,remoteDir;
R/modify_pubmed_db.R,221,Compound semicolons are discouraged. Replace them by a newline.,deleteStart; sourceKeep; # so glue works in dopar
R/modify_pubmed_db.R,221,Trailing semicolons are not needed.,deleteStart; sourceKeep; # so glue works in dopar
R/parse_element.R,156,1:.N is likely to be wrong in the empty edge case. Use seq_len(.N) instead.,"dPmid[rep.int(1:.N, nIds)],"
R/parse_element.R,208,1:.N is likely to be wrong in the empty edge case. Use seq_len(.N) instead.,"dPmid[rep.int(1:.N, nHist)],"
R/parse_element.R,278,1:.N is likely to be wrong in the empty edge case. Use seq_len(.N) instead.,"dPmid[rep.int(1:.N, xml_length(x1))],"
R/parse_element.R,305,1:.N is likely to be wrong in the empty edge case. Use seq_len(.N) instead.,"dPmid[rep.int(1:.N, nDescPerPmid)],"
R/parse_element.R,311,1:.N is likely to be wrong in the empty edge case. Use seq_len(.N) instead.,"x3[, descriptor_pos := 1:.N, by = pmid]"
R/parse_element.R,324,1:.N is likely to be wrong in the empty edge case. Use seq_len(.N) instead.,"x3[rep.int(1:.N, nQualPerDesc), colnames(dPmid), with = FALSE],"
R/parse_element.R,358,1:.N is likely to be wrong in the empty edge case. Use seq_len(.N) instead.,"dPmid[rep.int(1:.N, n)],"
R/parse_element.R,385,1:.N is likely to be wrong in the empty edge case. Use seq_len(.N) instead.,"dPmid[rep.int(1:.N, n)],"
R/parse_element.R,412,1:.N is likely to be wrong in the empty edge case. Use seq_len(.N) instead.,"dPmid[rep.int(1:.N, n)],"
R/parse_element.R,437,1:.N is likely to be wrong in the empty edge case. Use seq_len(.N) instead.,"dPmid[rep.int(1:.N, nBanksPerPmid)],"
R/parse_element.R,440,1:.N is likely to be wrong in the empty edge case. Use seq_len(.N) instead.,"x5 = x4[rep.int(1:.N, nAccsPerBank)]"
R/parse_element.R,457,1:.N is likely to be wrong in the empty edge case. Use seq_len(.N) instead.,"dPmid[rep.int(1:.N, n)],"
R/parse_element.R,479,1:.N is likely to be wrong in the empty edge case. Use seq_len(.N) instead.,"dPmid[rep.int(1:.N, x3)],"
R/parse_element.R,484,1:.N is likely to be wrong in the empty edge case. Use seq_len(.N) instead.,"x5[, abstract_pos := 1:.N, by = pmid]"
R/parse_person.R,26,1:.N is likely to be wrong in the empty edge case. Use seq_len(.N) instead.,"dPmidNow[rep.int(1:.N, nPersons)],"
R/parse_person.R,39,1:.N is likely to be wrong in the empty edge case. Use seq_len(.N) instead.,"dPerson[, person_pos := 1:.N, by = pmid]"
R/parse_person.R,69,1:.N is likely to be wrong in the empty edge case. Use seq_len(.N) instead.,"dAffil[, affil_idx := 1:.N]"
R/parse_person.R,98,1:.N is likely to be wrong in the empty edge case. Use seq_len(.N) instead.,"dPerson[, person_idx := 1:.N]"
 

Warning, lint_ignore.csv contains lines not found in the current code:
R/get_citation.R line 5: Variable and function name style should be camelCase.
r published_date = name = NULL
R/get_parsing_tables.R line 2: Variable and function name style should be camelCase.
r xml_filename = NULL
R/get_parsing_tables.R line 94: Variable and function name style should be camelCase.
r r[[tableName]][, xml_filename := ac]
R/get_pubmed_files.R line 15: Variable and function name style should be camelCase.
r sub_dir = subDir = . = xml_filename = NULL
R/get_pubmed_files.R line 20: Variable and function name style should be camelCase.
r dNow[, sub_dir := subDir]}
R/get_pubmed_files.R line 58: Variable and function name style should be camelCase.
r md5_match = md5_computed = md5_provided = NULL
R/get_pubmed_files.R line 61: Variable and function name style should be camelCase.
r d[, md5_match := md5_computed == md5_provided]
R/get_pubmed_files.R line 69: Variable and function name style should be camelCase.
r md5_download = xml_download = f = sub_dir = xml_filename = md5_filename =
R/get_pubmed_files.R line 70: Variable and function name style should be camelCase.
r md5_match = NULL
R/get_pubmed_files.R line 80: Variable and function name style should be camelCase.
r fileInfo[, md5_download := NA_integer_]
R/get_pubmed_files.R line 82: Variable and function name style should be camelCase.
r fileInfo[, md5_download := xml_download]}
R/get_pubmed_files.R line 91: Variable and function name style should be camelCase.
r fileInfo[is.na(md5_download), md5_download := r]
R/get_pubmed_files.R line 107: Variable and function name style should be camelCase.
r fileInfo[!(md5_match), xml_download := r]
R/get_test_standard.R line 19: Variable and function name style should be camelCase.
r .N = pmid = N = . = step = NULL
R/get_test_standard.R line 51: Variable and function name style should be camelCase.
r sub_dir = .N = sample_base = NULL
R/get_test_standard.R line 62: Variable and function name style should be camelCase.
r dFile[, sample_base := gsub('\\.xml.*$', '', sampleBase)][]}
R/get_test_standard.R line 92: Variable and function name style should be camelCase.
r parsed$pmid_status = parsed$pmid_status[[2L]]
R/get_test_standard.R line 99: Variable and function name style should be camelCase.
r sub_dir = NULL
R/get_test_standard.R line 106: Variable and function name style should be camelCase.
r sub_dir = xml_download = xml_filename = md5_filename = NULL
R/modify_pubmed_db.R line 41: Variable and function name style should be camelCase.
r processed = .N = md5_match = xml_filename = . = step = NULL
R/parse_element.R line 149: Variable and function name style should be camelCase.
r .N = id_type = NULL
R/parse_element.R line 168: Variable and function name style should be camelCase.
r pub_date = y = m = d = NULL
R/parse_element.R line 187: Variable and function name style should be camelCase.
r x4[, pub_date := as.Date(sprintf('%s-%s-%s', y, m, d))]
R/parse_element.R line 201: Variable and function name style should be camelCase.
r .N = pub_date = y = m = d = NULL
R/parse_element.R line 214: Variable and function name style should be camelCase.
r x4[, pub_date := as.Date(sprintf('%s-%s-%s', y, m, d))]
R/parse_element.R line 224: Variable and function name style should be camelCase.
r medline_date = pub_month_tmp1 = pub_month = pub_day_tmp = pub_day = pub_year =
R/parse_element.R line 225: Variable and function name style should be camelCase.
r pub_month_tmp2 = pub_date = date_idx = NULL
R/parse_element.R line 242: Variable and function name style should be camelCase.
r x2[is.na(pub_year), date_idx := regexpr('[0-9]{4}', medline_date)]
R/parse_element.R line 244: Variable and function name style should be camelCase.
r pub_year := as.integer(substr(medline_date, date_idx, date_idx + 3L))]
R/parse_element.R line 245: Variable and function name style should be camelCase.
r x2[, date_idx := NULL]
R/parse_element.R line 253: Variable and function name style should be camelCase.
r x2[, pub_month_tmp1 := tolower(pub_month)]
R/parse_element.R line 256: Variable and function name style should be camelCase.
r x3[, pub_day_tmp := pub_day]
R/parse_element.R line 257: Variable and function name style should be camelCase.
r x3[is.na(pub_day_tmp), pub_day_tmp := '01']
R/parse_element.R line 259: Variable and function name style should be camelCase.
r pub_date := as.Date(
R/parse_element.R line 271: Variable and function name style should be camelCase.
r .N = NULL
R/parse_element.R line 289: Variable and function name style should be camelCase.
r indexing_method = .N = descriptor_pos = pmid = NULL
R/parse_element.R line 311: Variable and function name style should be camelCase.
r x3[, descriptor_pos := 1:.N, by = pmid]
R/parse_element.R line 313: Variable and function name style should be camelCase.
r x3[, descriptor_pos := ai]}
R/parse_element.R line 346: Variable and function name style should be camelCase.
r .N = NULL
R/parse_element.R line 373: Variable and function name style should be camelCase.
r .N = NULL
R/parse_element.R line 403: Variable and function name style should be camelCase.
r .N = NULL
R/parse_element.R line 424: Variable and function name style should be camelCase.
r .N = accession_number = NULL
R/parse_element.R line 441: Variable and function name style should be camelCase.
r x5[, accession_number := unlist(lapply(x3, xml_text))]
R/parse_element.R line 450: Variable and function name style should be camelCase.
r .N = NULL
R/parse_element.R line 468: Variable and function name style should be camelCase.
r .N = abstract_pos = copyright = pmid = NULL
R/parse_element.R line 484: Variable and function name style should be camelCase.
r x5[, abstract_pos := 1:.N, by = pmid]
R/parse_element.R line 486: Variable and function name style should be camelCase.
r x5[, abstract_pos := as.integer()]}
R/parse_person.R line 4: Variable and function name style should be camelCase.
r . = pmid = .N = equal_contrib = collective_name = person_pos =
R/parse_person.R line 5: Variable and function name style should be camelCase.
r affiliation_pos = affiliation = affil_idx = person_idx = n_affil_ids =
R/parse_person.R line 6: Variable and function name style should be camelCase.
r n_person_ids = n_total_ids = id_pos = NULL
R/parse_person.R line 34: Variable and function name style should be camelCase.
r dPerson[, equal_contrib := xml_attr(x2, 'EqualContrib')]
R/parse_person.R line 35: Variable and function name style should be camelCase.
r dPerson[, collective_name :=
R/parse_person.R line 39: Variable and function name style should be camelCase.
r dPerson[, person_pos := 1:.N, by = pmid]
R/parse_person.R line 41: Variable and function name style should be camelCase.
r dPerson[, person_pos := ai]}
R/parse_person.R line 50: Variable and function name style should be camelCase.
r dAffil[, affiliation_pos := seq_len(.N), by = cols]
R/parse_person.R line 69: Variable and function name style should be camelCase.
r dAffil[, affil_idx := 1:.N]
R/parse_person.R line 74: Variable and function name style should be camelCase.
r dAffil[, affil_idx := NULL]
R/parse_person.R line 75: Variable and function name style should be camelCase.
r dAffilId[, affil_idx := NULL]
R/parse_person.R line 98: Variable and function name style should be camelCase.
r dPerson[, person_idx := 1:.N]
R/parse_person.R line 102: Variable and function name style should be camelCase.
r dPerson[, person_idx := NULL]
R/parse_person.R line 103: Variable and function name style should be camelCase.
r dAllId[, person_idx := NULL]
R/parse_person.R line 108: Variable and function name style should be camelCase.
r x10[is.na(n_affil_ids), n_affil_ids := 0]
R/parse_person.R line 109: Variable and function name style should be camelCase.
r x10[, n_person_ids := n_total_ids - n_affil_ids]
R/parse_person.R line 114: Variable and function name style should be camelCase.
r dAllId[, id_pos := seq_len(.N), by = cols]
R/parse_person.R line 116: Variable and function name style should be camelCase.
r dPersonId[, id_pos := NULL]
R/parse_pubmed_xml.R line 12: Variable and function name style should be camelCase.
r status = xml_filename = parseFunc = NULL
R/parse_pubmed_xml.R line 35: Variable and function name style should be camelCase.
r if (isEmpty(tableSuffix)) dPmid[, xml_filename := NULL]
R/parse_pubmed_xml.R line 61: Variable and function name style should be camelCase.
r xml_filename = filenameNow = NULL
R/utilities.R line 2: Variable and function name style should be camelCase.
r status = xml_filename = NULL
R/utilities.R line 9: Variable and function name style should be camelCase.
r . = xml_filename = NULL
R/utilities.R line 77: Variable and function name style should be camelCase.
r . = xml_filename = step = NULL
R/utilities.R line 128: Variable and function name style should be camelCase.
r paste_ = function(...) {
tests/testthat/test_get_pubmed_files.R line 33: Variable and function name style should be camelCase.
r fileInfo[, md5_match := as.numeric(md5_match)]