Nhogs/popoto

View on GitHub
src/provider/provider.js

Summary

Maintainability
F
1 wk
Test Coverage
F
36%

File provider.js has 565 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import * as d3 from "d3";
import logger from "../logger/logger";
import query from "../query/query";
import graph from "../graph/graph";

Severity: Major
Found in src/provider/provider.js - About 1 day to fix

    Function getProvider has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
    Open

    provider.node.getProvider = function (label) {
        if (label === undefined) {
            logger.error("Node label is undefined, no label provider can be found.");
        } else {
            if (provider.node.Provider.hasOwnProperty(label)) {
    Severity: Minor
    Found in src/provider/provider.js - About 7 hrs 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 getReturnAttributes has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
    Open

    provider.node.getReturnAttributes = function (label) {
        var nProvider = provider.node.getProvider(label);
        var attributes = {}; // Object is used as a Set to merge possible duplicate in parents
    
        if (nProvider.hasOwnProperty("returnAttributes")) {
    Severity: Minor
    Found in src/provider/provider.js - About 5 hrs 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 getReturnAttributes has 50 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    provider.node.getReturnAttributes = function (label) {
        var nProvider = provider.node.getProvider(label);
        var attributes = {}; // Object is used as a Set to merge possible duplicate in parents
    
        if (nProvider.hasOwnProperty("returnAttributes")) {
    Severity: Minor
    Found in src/provider/provider.js - About 2 hrs to fix

      Function getSemanticValue has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

              "getSemanticValue": function (node) {
                  var text = "";
                  var displayAttr = provider.node.getDisplayAttribute(node.label);
                  if (node.type === graph.node.NodeTypes.VALUE) {
                      if (displayAttr === query.NEO4J_INTERNAL_ID) {
      Severity: Minor
      Found in src/provider/provider.js - About 1 hr 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 getProperty has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

      provider.node.getProperty = function (label, name) {
          var nProvider = provider.node.getProvider(label);
      
          if (!nProvider.hasOwnProperty(name)) {
              var providerIterator = nProvider;
      Severity: Minor
      Found in src/provider/provider.js - About 1 hr 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 getTextValue has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

              "getTextValue": function (node, maxLength) {
                  var text = "";
                  var displayAttr = provider.node.getDisplayAttribute(node.label);
                  if (node.type === graph.node.NodeTypes.VALUE) {
                      if (displayAttr === query.NEO4J_INTERNAL_ID) {
      Severity: Minor
      Found in src/provider/provider.js - About 1 hr 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 getProvider has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      provider.node.getProvider = function (label) {
          if (label === undefined) {
              logger.error("Node label is undefined, no label provider can be found.");
          } else {
              if (provider.node.Provider.hasOwnProperty(label)) {
      Severity: Minor
      Found in src/provider/provider.js - About 1 hr to fix

        Function getTextValue has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                "getTextValue": function (node, maxLength) {
                    var text = "";
                    var displayAttr = provider.node.getDisplayAttribute(node.label);
                    if (node.type === graph.node.NodeTypes.VALUE) {
                        if (displayAttr === query.NEO4J_INTERNAL_ID) {
        Severity: Minor
        Found in src/provider/provider.js - About 1 hr to fix

          Function getSemanticValue has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  "getSemanticValue": function (node) {
                      var text = "";
                      var displayAttr = provider.node.getDisplayAttribute(node.label);
                      if (node.type === graph.node.NodeTypes.VALUE) {
                          if (displayAttr === query.NEO4J_INTERNAL_ID) {
          Severity: Minor
          Found in src/provider/provider.js - About 1 hr to fix

            Avoid deeply nested control flow statements.
            Open

                                if (nProvider.hasOwnProperty("children")) {
                                    if (nProvider["children"].indexOf(label) > -1) {
                                        logger.debug("No provider is defined for label (" + label + "), parent (" + p + ") will be used");
                                        // A provider containing the required label in its children definition has been found it will be cloned.
            
            
            Severity: Major
            Found in src/provider/provider.js - About 45 mins to fix

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

                  "getTextValue": function (link) {
                      if (link.type === graph.link.LinkTypes.VALUE) {
                          // Links between node and list of values.
              
                          if (provider.node.isTextDisplayed(link.target)) {
              Severity: Minor
              Found in src/provider/provider.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

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

                      "getCSSClass": function (node, element) {
                          var labelAsCSSName = node.label.replace(/[^0-9a-z\-_]/gi, '');
              
                          var cssClass = "ppt-node__" + element;
              
              
              Severity: Minor
              Found in src/provider/provider.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

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

                  "getCSSClass": function (link, element) {
                      var cssClass = "ppt-link__" + element;
              
                      if (link.type === graph.link.LinkTypes.VALUE) {
                          cssClass = cssClass + "--value";
              Severity: Minor
              Found in src/provider/provider.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

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

                      "getSemanticValue": function (node) {
                          var text = "";
                          var displayAttr = provider.node.getDisplayAttribute(node.label);
                          if (node.type === graph.node.NodeTypes.VALUE) {
                              if (displayAttr === query.NEO4J_INTERNAL_ID) {
              Severity: Major
              Found in src/provider/provider.js and 1 other location - About 1 day to fix
              src/provider/provider.js on lines 1022..1052

              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 290.

              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

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

                      "getTextValue": function (node, maxLength) {
                          var text = "";
                          var displayAttr = provider.node.getDisplayAttribute(node.label);
                          if (node.type === graph.node.NodeTypes.VALUE) {
                              if (displayAttr === query.NEO4J_INTERNAL_ID) {
              Severity: Major
              Found in src/provider/provider.js and 1 other location - About 1 day to fix
              src/provider/provider.js on lines 1066..1095

              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 290.

              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

              provider.taxonomy.getCSSClass = function (label, element) {
                  if (provider.taxonomy.Provider.hasOwnProperty("getCSSClass")) {
                      return provider.taxonomy.Provider.getCSSClass(label, element);
                  } else {
                      if (provider.taxonomy.DEFAULT_PROVIDER.hasOwnProperty("getCSSClass")) {
              Severity: Major
              Found in src/provider/provider.js and 1 other location - About 4 hrs to fix
              src/provider/provider.js on lines 53..63

              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 126.

              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

              provider.link.getCSSClass = function (link, element) {
                  if (provider.link.Provider.hasOwnProperty("getCSSClass")) {
                      return provider.link.Provider.getCSSClass(link, element);
                  } else {
                      if (provider.link.DEFAULT_PROVIDER.hasOwnProperty("getCSSClass")) {
              Severity: Major
              Found in src/provider/provider.js and 1 other location - About 4 hrs to fix
              src/provider/provider.js on lines 259..269

              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 126.

              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

              provider.link.getDistance = function (link) {
                  if (provider.link.Provider.hasOwnProperty("getDistance")) {
                      return provider.link.Provider.getDistance(link);
                  } else {
                      if (provider.link.DEFAULT_PROVIDER.hasOwnProperty("getDistance")) {
              Severity: Major
              Found in src/provider/provider.js and 3 other locations - About 4 hrs to fix
              src/provider/provider.js on lines 29..39
              src/provider/provider.js on lines 83..93
              src/provider/provider.js on lines 241..251

              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 123.

              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

              provider.link.getSemanticValue = function (link) {
                  if (provider.link.Provider.hasOwnProperty("getSemanticValue")) {
                      return provider.link.Provider.getSemanticValue(link);
                  } else {
                      if (provider.link.DEFAULT_PROVIDER.hasOwnProperty("getSemanticValue")) {
              Severity: Major
              Found in src/provider/provider.js and 3 other locations - About 4 hrs to fix
              src/provider/provider.js on lines 29..39
              src/provider/provider.js on lines 65..75
              src/provider/provider.js on lines 241..251

              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 123.

              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

              provider.taxonomy.getTextValue = function (label) {
                  if (provider.taxonomy.Provider.hasOwnProperty("getTextValue")) {
                      return provider.taxonomy.Provider.getTextValue(label);
                  } else {
                      if (provider.taxonomy.DEFAULT_PROVIDER.hasOwnProperty("getTextValue")) {
              Severity: Major
              Found in src/provider/provider.js and 3 other locations - About 4 hrs to fix
              src/provider/provider.js on lines 29..39
              src/provider/provider.js on lines 65..75
              src/provider/provider.js on lines 83..93

              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 123.

              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

              provider.link.getTextValue = function (link) {
                  if (provider.link.Provider.hasOwnProperty("getTextValue")) {
                      return provider.link.Provider.getTextValue(link);
                  } else {
                      if (provider.link.DEFAULT_PROVIDER.hasOwnProperty("getTextValue")) {
              Severity: Major
              Found in src/provider/provider.js and 3 other locations - About 4 hrs to fix
              src/provider/provider.js on lines 65..75
              src/provider/provider.js on lines 83..93
              src/provider/provider.js on lines 241..251

              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 123.

              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 (nProvider.hasOwnProperty("returnAttributes")) {
                          for (var j = 0; j < nProvider.returnAttributes.length; j++) {
                              if (nProvider.returnAttributes[j] === query.NEO4J_INTERNAL_ID) {
                                  attributes[query.NEO4J_INTERNAL_ID.queryInternalName] = true;
                              } else {
              Severity: Major
              Found in src/provider/provider.js and 1 other location - About 3 hrs to fix
              src/provider/provider.js on lines 456..464

              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 100.

              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 (nProvider.hasOwnProperty("returnAttributes")) {
                      for (var i = 0; i < nProvider.returnAttributes.length; i++) {
                          if (nProvider.returnAttributes[i] === query.NEO4J_INTERNAL_ID) {
                              attributes[query.NEO4J_INTERNAL_ID.queryInternalName] = true;
                          } else {
              Severity: Major
              Found in src/provider/provider.js and 1 other location - About 3 hrs to fix
              src/provider/provider.js on lines 469..477

              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 100.

              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

              provider.node.getCSSClass = function (node, element) {
                  return provider.node.getProperty(node.label, "getCSSClass")(node, element);
              };
              Severity: Major
              Found in src/provider/provider.js and 2 other locations - About 50 mins to fix
              src/provider/provider.js on lines 584..586
              src/provider/provider.js on lines 636..638

              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 3 locations. Consider refactoring.
              Open

              provider.node.getColor = function (node, style) {
                  return provider.node.getProperty(node.label, "getColor")(node, style);
              };
              Severity: Major
              Found in src/provider/provider.js and 2 other locations - About 50 mins to fix
              src/provider/provider.js on lines 584..586
              src/provider/provider.js on lines 645..647

              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 3 locations. Consider refactoring.
              Open

              provider.node.getTextValue = function (node, parameter) {
                  return provider.node.getProperty(node.label, "getTextValue")(node, parameter);
              };
              Severity: Major
              Found in src/provider/provider.js and 2 other locations - About 50 mins to fix
              src/provider/provider.js on lines 636..638
              src/provider/provider.js on lines 645..647

              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 (link.type === graph.link.LinkTypes.VALUE) {
                          return (13 / 8) * (provider.node.getSize(link.source) + provider.node.getSize(link.target));
                      } else {
              Severity: Minor
              Found in src/provider/provider.js and 1 other location - About 45 mins to fix
              src/provider/provider.js on lines 159..161

              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 50.

              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 {
                          return (20 / 8) * (provider.node.getSize(link.source) + provider.node.getSize(link.target));
                      }
              Severity: Minor
              Found in src/provider/provider.js and 1 other location - About 45 mins to fix
              src/provider/provider.js on lines 157..159

              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 50.

              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 8 locations. Consider refactoring.
              Open

              provider.node.isTextDisplayed = function (node) {
                  return provider.node.getProperty(node.label, "getIsTextDisplayed")(node);
              };
              Severity: Major
              Found in src/provider/provider.js and 7 other locations - About 40 mins to fix
              src/provider/provider.js on lines 598..600
              src/provider/provider.js on lines 608..610
              src/provider/provider.js on lines 625..627
              src/provider/provider.js on lines 655..657
              src/provider/provider.js on lines 666..668
              src/provider/provider.js on lines 676..678
              src/provider/provider.js on lines 686..688

              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 49.

              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 8 locations. Consider refactoring.
              Open

              provider.node.getSize = function (node) {
                  return provider.node.getProperty(node.label, "getSize")(node);
              };
              Severity: Major
              Found in src/provider/provider.js and 7 other locations - About 40 mins to fix
              src/provider/provider.js on lines 598..600
              src/provider/provider.js on lines 608..610
              src/provider/provider.js on lines 617..619
              src/provider/provider.js on lines 655..657
              src/provider/provider.js on lines 666..668
              src/provider/provider.js on lines 676..678
              src/provider/provider.js on lines 686..688

              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 49.

              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 8 locations. Consider refactoring.
              Open

              provider.node.getSVGPaths = function (node) {
                  return provider.node.getProperty(node.label, "getSVGPaths")(node);
              };
              Severity: Major
              Found in src/provider/provider.js and 7 other locations - About 40 mins to fix
              src/provider/provider.js on lines 598..600
              src/provider/provider.js on lines 617..619
              src/provider/provider.js on lines 625..627
              src/provider/provider.js on lines 655..657
              src/provider/provider.js on lines 666..668
              src/provider/provider.js on lines 676..678
              src/provider/provider.js on lines 686..688

              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 49.

              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 8 locations. Consider refactoring.
              Open

              provider.node.getNodeDisplayType = function (node) {
                  return provider.node.getProperty(node.label, "getDisplayType")(node);
              };
              Severity: Major
              Found in src/provider/provider.js and 7 other locations - About 40 mins to fix
              src/provider/provider.js on lines 598..600
              src/provider/provider.js on lines 608..610
              src/provider/provider.js on lines 617..619
              src/provider/provider.js on lines 625..627
              src/provider/provider.js on lines 655..657
              src/provider/provider.js on lines 676..678
              src/provider/provider.js on lines 686..688

              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 49.

              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 8 locations. Consider refactoring.
              Open

              provider.node.getImageWidth = function (node) {
                  return provider.node.getProperty(node.label, "getImageWidth")(node);
              };
              Severity: Major
              Found in src/provider/provider.js and 7 other locations - About 40 mins to fix
              src/provider/provider.js on lines 598..600
              src/provider/provider.js on lines 608..610
              src/provider/provider.js on lines 617..619
              src/provider/provider.js on lines 625..627
              src/provider/provider.js on lines 655..657
              src/provider/provider.js on lines 666..668
              src/provider/provider.js on lines 676..678

              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 49.

              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 8 locations. Consider refactoring.
              Open

              provider.node.getImagePath = function (node) {
                  return provider.node.getProperty(node.label, "getImagePath")(node);
              };
              Severity: Major
              Found in src/provider/provider.js and 7 other locations - About 40 mins to fix
              src/provider/provider.js on lines 598..600
              src/provider/provider.js on lines 608..610
              src/provider/provider.js on lines 617..619
              src/provider/provider.js on lines 625..627
              src/provider/provider.js on lines 655..657
              src/provider/provider.js on lines 666..668
              src/provider/provider.js on lines 686..688

              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 49.

              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 8 locations. Consider refactoring.
              Open

              provider.node.getSemanticValue = function (node) {
                  return provider.node.getProperty(node.label, "getSemanticValue")(node);
              };
              Severity: Major
              Found in src/provider/provider.js and 7 other locations - About 40 mins to fix
              src/provider/provider.js on lines 608..610
              src/provider/provider.js on lines 617..619
              src/provider/provider.js on lines 625..627
              src/provider/provider.js on lines 655..657
              src/provider/provider.js on lines 666..668
              src/provider/provider.js on lines 676..678
              src/provider/provider.js on lines 686..688

              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 49.

              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 8 locations. Consider refactoring.
              Open

              provider.node.getIsGroup = function (node) {
                  return provider.node.getProperty(node.label, "getIsGroup")(node);
              };
              Severity: Major
              Found in src/provider/provider.js and 7 other locations - About 40 mins to fix
              src/provider/provider.js on lines 598..600
              src/provider/provider.js on lines 608..610
              src/provider/provider.js on lines 617..619
              src/provider/provider.js on lines 625..627
              src/provider/provider.js on lines 666..668
              src/provider/provider.js on lines 676..678
              src/provider/provider.js on lines 686..688

              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 49.

              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

              provider.node.filterNodeValueQuery = function (node, initialQuery) {
                  return provider.node.getProperty(node.label, "filterNodeValueQuery")(node, initialQuery);
              };
              Severity: Minor
              Found in src/provider/provider.js and 2 other locations - About 35 mins to fix
              src/provider/provider.js on lines 704..706
              src/provider/provider.js on lines 708..710

              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

              provider.node.filterNodeCountQuery = function (node, initialQuery) {
                  return provider.node.getProperty(node.label, "filterNodeCountQuery")(node, initialQuery);
              };
              Severity: Minor
              Found in src/provider/provider.js and 2 other locations - About 35 mins to fix
              src/provider/provider.js on lines 700..702
              src/provider/provider.js on lines 708..710

              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

              provider.node.filterNodeRelationQuery = function (node, initialQuery) {
                  return provider.node.getProperty(node.label, "filterNodeRelationQuery")(node, initialQuery);
              };
              Severity: Minor
              Found in src/provider/provider.js and 2 other locations - About 35 mins to fix
              src/provider/provider.js on lines 700..702
              src/provider/provider.js on lines 704..706

              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

              There are no issues that match your filters.

              Category
              Status