server/models/service-manager.js
Function getDefinitionsFromDictionaryApi
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
serviceManager.getDefinitionsFromDictionaryApi = function (term, api_key, callback) {
// TODO: Further investigate ability to use HTTPS in calls to API
var url = "http://www.dictionaryapi.com/api/v1/references/medical/xml/" + encodeURIComponent(term.toLowerCase()) + "?key=" + api_key;
Avoid deeply nested control flow statements. Open
Open
if (Array.isArray(v.def[0].sensb[0].sens)) {
_.forEach(v.def[0].sensb, function (v,k) {
if (v.sens[0].dt[0]['_']) {