Nhogs/popoto

View on GitHub

Showing 303 of 303 total issues

Function getRelevantLinks has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

query.getRelevantLinks = function (rootNode, targetNode, initialLinks) {
    var links = initialLinks.slice();
    var finalLinks = [];

    // Filter all links to keep only those containing a value or being the selected node.
Severity: Minor
Found in src/query/query.js - About 1 hr to fix

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

    fitTextRenderer.render = function (nodeSelection) {
    
        var backgroundRectSelection = nodeSelection
            .append("rect")
            .attr("fill", function (node) {
    Severity: Minor
    Found in src/graph/node/fitTextRenderer.js - About 1 hr to fix

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

      taxonomy.addTaxonomyChildren = function (selection) {
          selection.each(function (d) {
              var li = d3.select(this);
      
              var children = d.children;
      Severity: Minor
      Found in src/taxonomy/taxonomy.js - About 1 hr to fix

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

                row.graph.relationships.forEach(function (r) {
                    if (!edges.hasOwnProperty(r.id)) {
                        edges[r.id] = r;
                    }
                });
        Severity: Major
        Found in src/result/result.js and 1 other location - About 1 hr to fix
        src/result/result.js on lines 44..48

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

        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

                row.graph.nodes.forEach(function (n) {
                    if (!nodes.hasOwnProperty(n.id)) {
                        nodes[n.id] = n;
                    }
                });
        Severity: Major
        Found in src/result/result.js and 1 other location - About 1 hr to fix
        src/result/result.js on lines 50..54

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

        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

        Function collapseNode has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        node.collapseNode = function (clickedNode) {
            if (clickedNode.valueExpanded) { // node is collapsed only if it has been expanded first
                logger.debug("collapseNode (" + clickedNode.label + ")");
        
                graph.notifyListeners(graph.Events.GRAPH_NODE_VALUE_COLLAPSE, [clickedNode]);
        Severity: Minor
        Found in src/graph/node/node.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 loadSchema has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        graph.loadSchema = function (graphToLoad) {
            if (dataModel.nodes.length > 0) {
                logger.warn("graph.loadSchema is called but the graph is not empty.");
            }
        
        
        Severity: Minor
        Found in src/graph/graph.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

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

                    if (!graph.DISABLE_RELATION && linkTarget.hasOwnProperty("relationships") && linkTarget.relationships.length > 0) {
                        targetMargin = graph.node.getDonutOuterRadius(linkTarget);
                    }
        Severity: Major
        Found in src/graph/graph.js and 1 other location - About 1 hr to fix
        src/graph/graph.js on lines 840..842

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

        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 (!graph.DISABLE_RELATION && linkSource.hasOwnProperty("relationships") && linkSource.relationships.length > 0) {
                        sourceMargin = graph.node.getDonutOuterRadius(linkSource);
                    }
        Severity: Major
        Found in src/graph/graph.js and 1 other location - About 1 hr to fix
        src/graph/graph.js on lines 844..846

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

        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

        Function start has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function start(startParam) {
            logger.info("Popoto " + version + " start on " + startParam);
        
            graph.mainLabel = startParam;
        
        
        Severity: Minor
        Found in src/popoto.js - About 1 hr to fix

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

              targetNode.ty = n.ty + ((provider.link.getDistance(newLink)) * Math.sin(l.directionAngle - Math.PI / 2));
          Severity: Major
          Found in src/graph/graph.js and 1 other location - About 1 hr to fix
          src/graph/graph.js on lines 1013..1013

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

          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

              targetNode.tx = n.tx + ((provider.link.getDistance(newLink)) * Math.cos(l.directionAngle - Math.PI / 2));
          Severity: Major
          Found in src/graph/graph.js and 1 other location - About 1 hr to fix
          src/graph/graph.js on lines 1014..1014

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

          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

          Function collapseNode has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          node.collapseNode = function (clickedNode) {
              if (clickedNode.valueExpanded) { // node is collapsed only if it has been expanded first
                  logger.debug("collapseNode (" + clickedNode.label + ")");
          
                  graph.notifyListeners(graph.Events.GRAPH_NODE_VALUE_COLLAPSE, [clickedNode]);
          Severity: Minor
          Found in src/graph/node/node.js - About 1 hr to fix

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

                        childLi.append("span")
                            .attr("class", function (d) {
                                return "ppt-icon " + provider.taxonomy.getCSSClass(d.label, "span-icon");
                            })
                            .html(" ");
            Severity: Major
            Found in src/taxonomy/taxonomy.js and 1 other location - About 1 hr to fix
            src/taxonomy/taxonomy.js on lines 37..41

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

            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

                taxoli.append("span")
                    .attr("class", function (d) {
                        return "ppt-icon " + provider.taxonomy.getCSSClass(d.label, "span-icon");
                    })
                    .html(" ");
            Severity: Major
            Found in src/taxonomy/taxonomy.js and 1 other location - About 1 hr to fix
            src/taxonomy/taxonomy.js on lines 155..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 58.

            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

            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

              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 generateNodeCountQuery has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                query.generateNodeCountQuery = function (countedNode) {
                    var negativeElements = query.generateNegativeQueryElements();
                    var queryElements = query.generateQueryElements(dataModel.getRootNode(), countedNode, query.getRelevantLinks(dataModel.getRootNode(), countedNode, dataModel.links), true, true);
                    var queryMatchElements = queryElements.matchElements,
                        queryWhereElements = queryElements.whereElements.concat(negativeElements.whereElements),
                Severity: Minor
                Found in src/query/query.js - About 1 hr to fix

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

                      for (var prop in negativeElements.parameters) {
                          if (negativeElements.parameters.hasOwnProperty(prop)) {
                              queryParameters[prop] = negativeElements.parameters[prop];
                          }
                      }
                  Severity: Major
                  Found in src/query/query.js and 1 other location - About 1 hr to fix
                  src/query/query.js on lines 425..429

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

                  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

                      for (var prop in negativeElements.parameters) {
                          if (negativeElements.parameters.hasOwnProperty(prop)) {
                              queryParameters[prop] = negativeElements.parameters[prop];
                          }
                      }
                  Severity: Major
                  Found in src/query/query.js and 1 other location - About 1 hr to fix
                  src/query/query.js on lines 573..577

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

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language