bookbrainz/bookbrainz-site

View on GitHub
src/server/helpers/diffFormatters/entity.js

Summary

Maintainability
F
4 days
Test Coverage

File entity.js has 394 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * Copyright (C) 2016  Ben Ockmore
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
Severity: Minor
Found in src/server/helpers/diffFormatters/entity.js - About 5 hrs to fix

    Function formatEntityDiffs has 44 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function formatEntityDiffs(diffs, entityType, entityFormatter) {
        if (!diffs) {
            return [];
        }
    
    
    Severity: Minor
    Found in src/server/helpers/diffFormatters/entity.js - About 1 hr to fix

      Function formatAliasModified has 41 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function formatAliasModified(change) {
          if (change.path.length > 3 && change.path[3] === 'name') {
              return [
                  base.formatChange(
                      change,
      Severity: Minor
      Found in src/server/helpers/diffFormatters/entity.js - About 1 hr to fix

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

        function formatEntityChange(entity, change) {
            const aliasChanged =
                _.isEqual(change.path, ['aliasSet']) ||
                _.isEqual(change.path.slice(0, 2), ['aliasSet', 'aliases']) ||
                _.isEqual(change.path.slice(0, 2), ['aliasSet', 'defaultAlias']);
        Severity: Minor
        Found in src/server/helpers/diffFormatters/entity.js - About 1 hr to fix

          Function formatAddOrDeleteRelationshipSet has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function formatAddOrDeleteRelationshipSet(entity, change) {
              const changes = [];
              let allRelationships;
              if (change.kind === 'N') {
                  allRelationships = change.rhs.relationships;
          Severity: Minor
          Found in src/server/helpers/diffFormatters/entity.js - About 1 hr to fix

            Function formatEntityChange has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

            function formatEntityChange(entity, change) {
                const aliasChanged =
                    _.isEqual(change.path, ['aliasSet']) ||
                    _.isEqual(change.path.slice(0, 2), ['aliasSet', 'aliases']) ||
                    _.isEqual(change.path.slice(0, 2), ['aliasSet', 'defaultAlias']);
            Severity: Minor
            Found in src/server/helpers/diffFormatters/entity.js - About 55 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function formatRelationship has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

            function formatRelationship(entity, change) {
                if (change.kind === 'N') {
                    return formatAddOrDeleteRelationshipSet(entity, change);
                }
                if (change.kind === 'A') {
            Severity: Minor
            Found in src/server/helpers/diffFormatters/entity.js - About 45 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function formatAlias has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            function formatAlias(change) {
                const aliasSetAdded =
                    change.kind === 'N' && _.isEqual(change.path, ['aliasSet']);
                if (aliasSetAdded) {
                    return formatNewAliasSet(change);
            Severity: Minor
            Found in src/server/helpers/diffFormatters/entity.js - About 35 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Avoid too many return statements within this function.
            Open

                return null;
            Severity: Major
            Found in src/server/helpers/diffFormatters/entity.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return formatChangedAnnotation(change);
              Severity: Major
              Found in src/server/helpers/diffFormatters/entity.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                    return null;
                Severity: Major
                Found in src/server/helpers/diffFormatters/entity.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return authorCreditFormatter.format(change);
                  Severity: Major
                  Found in src/server/helpers/diffFormatters/entity.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                        return [];
                    Severity: Major
                    Found in src/server/helpers/diffFormatters/entity.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return formatNewDisambiguation(change);
                      Severity: Major
                      Found in src/server/helpers/diffFormatters/entity.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                            return null;
                        Severity: Major
                        Found in src/server/helpers/diffFormatters/entity.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                  return formatChangedDisambiguation(change);
                          Severity: Major
                          Found in src/server/helpers/diffFormatters/entity.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                    return formatAddOrDeleteRelationshipSet(entity, change);
                            Severity: Major
                            Found in src/server/helpers/diffFormatters/entity.js - About 30 mins to fix

                              Function formatIdentifier has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function formatIdentifier(change) {
                                  const identifierSetAdded =
                                      change.kind === 'N' && _.isEqual(change.path, ['identifierSet']);
                                  if (identifierSetAdded) {
                                      return formatNewIdentifierSet(change);
                              Severity: Minor
                              Found in src/server/helpers/diffFormatters/entity.js - About 25 mins to fix

                              Cognitive Complexity

                              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                              A method's cognitive complexity is based on a few simple rules:

                              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                              • Code is considered more complex for each "break in the linear flow of the code"
                              • Code is considered more complex when "flow breaking structures are nested"

                              Further reading

                              Similar blocks of code found in 4 locations. Consider refactoring.
                              Open

                                  if (change.path.length > 3 && change.path[3] === 'value') {
                                      return [
                                          base.formatChange(
                                              change,
                                              `Identifier ${change.path[2]} -> Value`,
                              Severity: Major
                              Found in src/server/helpers/diffFormatters/entity.js and 3 other locations - About 2 hrs to fix
                              src/server/helpers/diffFormatters/entity.js on lines 77..85
                              src/server/helpers/diffFormatters/entity.js on lines 87..95
                              src/server/helpers/diffFormatters/entity.js on lines 135..140

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 77.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 4 locations. Consider refactoring.
                              Open

                                  if (change.path.length > 3 && change.path[3] === 'sortName') {
                                      return [
                                          base.formatChange(
                                              change,
                                              `Alias ${change.path[2]} -> Sort Name`,
                              Severity: Major
                              Found in src/server/helpers/diffFormatters/entity.js and 3 other locations - About 2 hrs to fix
                              src/server/helpers/diffFormatters/entity.js on lines 77..85
                              src/server/helpers/diffFormatters/entity.js on lines 135..140
                              src/server/helpers/diffFormatters/entity.js on lines 199..207

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 77.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 4 locations. Consider refactoring.
                              Open

                                  if (change.path.length > 3 && change.path[3] === 'name') {
                                      return [
                                          base.formatChange(
                                              change,
                                              `Alias ${change.path[2]} -> Name`,
                              Severity: Major
                              Found in src/server/helpers/diffFormatters/entity.js and 3 other locations - About 2 hrs to fix
                              src/server/helpers/diffFormatters/entity.js on lines 87..95
                              src/server/helpers/diffFormatters/entity.js on lines 135..140
                              src/server/helpers/diffFormatters/entity.js on lines 199..207

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 77.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 4 locations. Consider refactoring.
                              Open

                                  if (change.path.length > 7 && change.path[7] === 'textValue') {
                                      return [
                                          base.formatChange(change,
                                              `Relationship Attribute ${change.path[2]} -> Value`, (side) => side && [side])
                                      ];
                              Severity: Major
                              Found in src/server/helpers/diffFormatters/entity.js and 3 other locations - About 2 hrs to fix
                              src/server/helpers/diffFormatters/entity.js on lines 77..85
                              src/server/helpers/diffFormatters/entity.js on lines 87..95
                              src/server/helpers/diffFormatters/entity.js on lines 199..207

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 77.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 2 locations. Consider refactoring.
                              Open

                                  if (aliasSetChanged) {
                                      if (change.kind === 'A') {
                                          // Alias added to or deleted from set
                                          return formatAliasAddOrDelete(change);
                                      }
                              Severity: Major
                              Found in src/server/helpers/diffFormatters/entity.js and 1 other location - About 1 hr to fix
                              src/server/helpers/diffFormatters/entity.js on lines 234..244

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 55.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 2 locations. Consider refactoring.
                              Open

                                  if (identifierSetChanged) {
                                      if (change.kind === 'A') {
                                          // Identifier added to or deleted from set
                                          return formatIdentifierAddOrDelete(change);
                                      }
                              Severity: Major
                              Found in src/server/helpers/diffFormatters/entity.js and 1 other location - About 1 hr to fix
                              src/server/helpers/diffFormatters/entity.js on lines 154..164

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 55.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 2 locations. Consider refactoring.
                              Open

                                  const relationshipChanged =
                                      _.isEqual(change.path, ['relationshipSet']) ||
                                      _.isEqual(change.path.slice(0, 2), ['relationshipSet', 'relationships']);
                              Severity: Minor
                              Found in src/server/helpers/diffFormatters/entity.js and 1 other location - About 50 mins to fix
                              src/server/helpers/diffFormatters/entity.js on lines 383..385

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 51.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 2 locations. Consider refactoring.
                              Open

                                  const identifierChanged =
                                      _.isEqual(change.path, ['identifierSet']) ||
                                      _.isEqual(change.path.slice(0, 2), ['identifierSet', 'identifiers']);
                              Severity: Minor
                              Found in src/server/helpers/diffFormatters/entity.js and 1 other location - About 50 mins to fix
                              src/server/helpers/diffFormatters/entity.js on lines 390..392

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 51.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 2 locations. Consider refactoring.
                              Open

                                  const aliasSetChanged =
                                      change.path.length > 1 && change.path[0] === 'aliasSet' &&
                                      change.path[1] === 'aliases';
                              Severity: Minor
                              Found in src/server/helpers/diffFormatters/entity.js and 1 other location - About 50 mins to fix
                              src/server/helpers/diffFormatters/entity.js on lines 231..233

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 51.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 2 locations. Consider refactoring.
                              Open

                                  const identifierSetChanged =
                                      change.path.length > 1 && change.path[0] === 'identifierSet' &&
                                      change.path[1] === 'identifiers';
                              Severity: Minor
                              Found in src/server/helpers/diffFormatters/entity.js and 1 other location - About 50 mins to fix
                              src/server/helpers/diffFormatters/entity.js on lines 151..153

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 51.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 2 locations. Consider refactoring.
                              Open

                                      if (relationship.sourceBbid === entity.get('bbid')) {
                                          changes.push(
                                              base.formatRow(
                                                  change.kind, key, [relationship.targetBbid, ...attributes], [relationship.targetBbid, ...attributes]
                                              )
                              Severity: Minor
                              Found in src/server/helpers/diffFormatters/entity.js and 1 other location - About 35 mins to fix
                              src/server/helpers/diffFormatters/entity.js on lines 314..320

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 47.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 2 locations. Consider refactoring.
                              Open

                                      else {
                                          changes.push(
                                              base.formatRow(
                                                  change.kind, key, [relationship.sourceBbid, ...attributes], [relationship.sourceBbid, ...attributes]
                                              )
                              Severity: Minor
                              Found in src/server/helpers/diffFormatters/entity.js and 1 other location - About 35 mins to fix
                              src/server/helpers/diffFormatters/entity.js on lines 307..313

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 47.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 3 locations. Consider refactoring.
                              Open

                                      const key = relationship.type && relationship.type.label ? `Relationship: ${relationship.type.label}` : 'Relationship';
                              Severity: Minor
                              Found in src/server/helpers/diffFormatters/entity.js and 2 other locations - About 35 mins to fix
                              src/server/helpers/diffFormatters/entity.js on lines 266..266
                              src/server/helpers/diffFormatters/entity.js on lines 332..332

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 46.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 3 locations. Consider refactoring.
                              Open

                                  const key = rhs.type && rhs.type.label ? `Relationship : ${rhs.type.label}` : 'Relationship';
                              Severity: Minor
                              Found in src/server/helpers/diffFormatters/entity.js and 2 other locations - About 35 mins to fix
                              src/server/helpers/diffFormatters/entity.js on lines 302..302
                              src/server/helpers/diffFormatters/entity.js on lines 332..332

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 46.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 3 locations. Consider refactoring.
                              Open

                                  const key = lhs.type && lhs.type.label ? `Relationship : ${lhs.type.label}` : 'Relationship';
                              Severity: Minor
                              Found in src/server/helpers/diffFormatters/entity.js and 2 other locations - About 35 mins to fix
                              src/server/helpers/diffFormatters/entity.js on lines 266..266
                              src/server/helpers/diffFormatters/entity.js on lines 302..302

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 46.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 2 locations. Consider refactoring.
                              Open

                                  if (change.path.length > REQUIRED_DEPTH && change.path[3] === 'type' &&
                                          change.path[4] === 'label') {
                              Severity: Minor
                              Found in src/server/helpers/diffFormatters/entity.js and 1 other location - About 30 mins to fix
                              src/server/helpers/diffFormatters/entity.js on lines 99..100

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 45.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 2 locations. Consider refactoring.
                              Open

                                      change.path.length >= REQUIRED_DEPTH && change.path[3] === 'language' &&
                                      change.path[4] === 'name';
                              Severity: Minor
                              Found in src/server/helpers/diffFormatters/entity.js and 1 other location - About 30 mins to fix
                              src/server/helpers/diffFormatters/entity.js on lines 210..211

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 45.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              There are no issues that match your filters.

                              Category
                              Status