Nhogs/popoto

View on GitHub

Showing 113 of 303 total issues

Avoid too many return statements within this function.
Open

                    return "ppt-span-group";
Severity: Major
Found in src/queryviewer/queryviewer.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                        return "ppt-span-group";
    Severity: Major
    Found in src/queryviewer/queryviewer.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                          return "ppt-span-value";
      Severity: Major
      Found in src/queryviewer/queryviewer.js - About 30 mins to fix

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

        query.generateTaxonomyCountQuery = function (label) {
            var constraintAttr = provider.node.getConstraintAttribute(label);
        
            var whereElements = [];
        
        
        Severity: Minor
        Found in src/query/query.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

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

        graph.loadSchemaNode = function (nodeSchema, parentNode, index, parentLinkTotalCount, parentRel, isReverse) {
            var isGroupNode = provider.node.getIsGroup(nodeSchema);
            var parentAngle = graph.computeParentAngle(parentNode);
        
            var angleDeg;
        Severity: Minor
        Found in src/graph/graph.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

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

        tools.reset = function () {
            dataModel.nodes.length = 0;
            dataModel.links.length = 0;
        
            // Reinitialize internal label generator
        Severity: Minor
        Found in src/tools/tools.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

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

        function computeLines(words, targetWidth) {
            var line;
            var lineWidth0 = Infinity;
            var lines = [];
        
        
        Severity: Minor
        Found in src/graph/util/appendFittedText.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

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

        node.removeEmptyBranches = function (n) {
            var hasValues = n.hasOwnProperty("value") && n.value.length > 0;
        
            var childrenLinks = dataModel.links.filter(function (l) {
                return l.source === n;
        Severity: Minor
        Found in src/graph/node/node.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

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

        node.getTrunkNode = function (n) {
        
            for (var i = 0; i < dataModel.links.length; i++) {
                var l = dataModel.links[i];
                if (l.target === n) {
        Severity: Minor
        Found in src/graph/node/node.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

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

        result.updateResults = function () {
            if (result.hasChanged) {
                var resultsIndex = {};
                var index = 0;
        
        
        Severity: Minor
        Found in src/result/result.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

        Function generateNodeCountQuery has a Cognitive Complexity of 6 (exceeds 5 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 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

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

        result.parseGraphResultData = function (data) {
        
            var nodes = {}, edges = {};
        
            data.results[1].data.forEach(function (row) {
        Severity: Minor
        Found in src/result/result.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

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

        logger.log = function (logLevel, message) {
            if (console && logLevel >= logger.LEVEL) {
                if (logger.TRACE) {
                    message = message + "\n" + new Error().stack
                }
        Severity: Minor
        Found in src/logger/logger.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

        Severity
        Category
        Status
        Source
        Language