se0ga/project-lvl2-s321

View on GitHub

Showing 4 of 6 total issues

Function createAST has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const createAST = (obj1, obj2) => {
  const keys = _.union(Object.keys(obj1), Object.keys(obj2));
  return keys.map((key) => {
    if (_.isObject(obj1[key]) && _.isObject(obj2[key])) {
      return {
Severity: Minor
Found in src/ast.js - About 1 hr to fix

    Function render has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const render = (ast) => {
      const iter = (list, depth) => {
        const newList = list.map((elem) => {
          const { key } = elem;
          const oldValue = stringify(elem.oldValue, depth);
    Severity: Minor
    Found in src/renderers/diff.js - About 1 hr to fix

      Function iter has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        const iter = (list, depth) => {
          const newList = list.map((elem) => {
            const { key } = elem;
            const oldValue = stringify(elem.oldValue, depth);
            const newValue = stringify(elem.newValue, depth);
      Severity: Minor
      Found in src/renderers/diff.js - About 1 hr to fix

        Avoid too many return statements within this function.
        Open

            return {
              key,
              oldValue: obj1[key],
              newValue: obj2[key],
              type: 'changed',
        Severity: Major
        Found in src/ast.js - About 30 mins to fix
          Severity
          Category
          Status
          Source
          Language