OHDSI / ROhdsiWebApi

An R package for interfacing with a WebAPI instance
https://ohdsi.github.io/ROhdsiWebApi
10 stars 17 forks source link

Variables created but not used #20

Closed schuemie closed 4 years ago

schuemie commented 5 years ago

Running OhdsiRTools::checkUsagePackage("ROhdsiWebApi") generates the following messages (in the develop branch):

getConceptSetsAndConceptsFromCohort: local variable ‘httpheader’ assigned but may not be used (C:/Git/ROhdsiWebApi/R/CohortDefinition.R:361)
getConceptSetsAndConceptsFromCohort: local variable ‘url’ assigned but may not be used (C:/Git/ROhdsiWebApi/R/CohortDefinition.R:360)
getSetExpressionConceptIds: local variable ‘webApiVersion’ assigned but may not be used (C:/Git/ROhdsiWebApi/R/ConceptSet.R:183)

Does anyone have an idea why these variables are created? Can we just remove those lines?

gowthamrao commented 5 years ago

Agree - i dont know. This function does not call an API endpoint directly, but uses another function getCohortDefinitionExpression

So, i think these two lines are not needed (httpheader and url) https://github.com/OHDSI/ROhdsiWebApi/blob/90340f066ea350b7eb5fdcf184961d79164ecd48/R/CohortDefinition.R#L329

https://github.com/OHDSI/ROhdsiWebApi/blob/90340f066ea350b7eb5fdcf184961d79164ecd48/R/CohortDefinition.R#L328

webApiVersion seems to be used in this conditional logic here https://github.com/OHDSI/ROhdsiWebApi/blob/90340f066ea350b7eb5fdcf184961d79164ecd48/R/CohortDefinition.R#L322

alondhe commented 4 years ago

Removed those extraneous lines