caverav / auditforge

Either all code paths should have explicit returns, or none of them JS-0045
Anti-pattern
Minor
11 days ago11 days old
Expected to return a value at the end of arrow function
218          return query.exec();
219        }
220      })
221      .then(row => {222        if (!row)
223          reject({ fn: 'NotFound', message: 'Vulnerability not found' });
224        else {
Expected to return a value at the end of arrow function
208    var query = Vulnerability.findById(vulnIdMerge);
209    query
210      .exec()
211      .then(row => {212        if (!row)
213          reject({ fn: 'NotFound', message: 'Vulnerability not found' });
214        else {
Expected to return a value at the end of arrow function
108    var query = Vulnerability.findByIdAndUpdate(vulnerabilityId, vulnerability);
109    query
110      .exec()
111      .then(row => {112        if (!row)
113          reject({ fn: 'NotFound', message: 'Vulnerability not found' });
114        else {
Expected to return a value at the end of arrow function
 776    query.select('findings');
 777    query
 778      .exec()
 779      .then(row => { 780        if (!row)
 781          throw {
 782            fn: 'NotFound',
Expected to return a value at the end of arrow function
 754          return row.save({ validateBeforeSave: false }); // Disable schema validation since scope changed from Array to String
 755        }
 756      })
 757      .then(() => { 758        if (sortAuto)
 759          return Audit.updateSortFindings(isAdmin, auditId, userId, null);
 760        else resolve('Audit Finding updated successfully');