AxeRicin/frontend-project-46

View on GitHub

Showing 2 of 8 total issues

Function findDiff has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
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;
Severity: Minor
Found in src/gendiff.js - About 1 hr to fix

Avoid too many return statements within this function.
Open

return { key, value: oldValue, type: 'unchanged' };
Severity: Major
Found in src/gendiff.js - About 30 mins to fix
    Severity
    Category
    Status
    Source
    Language