Showing 2 of 8 total issues
Function findDiff
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
const findDiff = (data1, data2) => { const keys = _.sortBy(_.uniq([...Object.keys(data1), ...Object.keys(data2)])); const result = keys.map((key) => { const { [key]: oldValue } = data1; const { [key]: newValue } = data2;
- Read upRead up
Avoid too many return
statements within this function. Open
Open
return { key, value: oldValue, type: 'unchanged' };