Showing 136 of 152 total issues

Avoid deeply nested control flow statements.
Open

                    if (registry.smw_template[templateName + '.wikitext']) {
                        wikitext += registry.smw_template[templateName + '.wikitext'];
                    } else {
                        log('[E] ' + model.$filepath + ' references to non exisiting template: ' + model[mode].template);
                    }
Severity: Major
Found in lib/util/moboUtil.js - About 45 mins to fix

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

    exports.addParameters = function(paramObj, lineBreak) {
        'use strict';
        var html = '';
        for (var paramName in paramObj) {
            var paramValue = paramObj[paramName];
    Severity: Minor
    Found in lib/util/handlebarsExtended.js - About 45 mins to fix

    Cognitive Complexity

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

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

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

    Further reading

    Avoid deeply nested control flow statements.
    Open

                    } else if (exports.nodes[modelPageName]) {
    
                        edge = _.cloneDeep(edgeTemplate);
    
                        // Checks if first char is uppercase. If it is, it references to a Template
    Severity: Major
    Found in lib/modelToText/generateGraph.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                          for (var paramName in field.sf_form) {
                              paramObj[paramName] = field.sf_form[paramName];
                          }
      Severity: Major
      Found in lib/util/handlebarsExtended.js - About 45 mins to fix

        Function callParser has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        exports.callParser = function(settings, generator, data, registry, generated) {
        Severity: Minor
        Found in lib/modelToText/generateWikiStructure.js - About 35 mins to fix

          Function exec has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          exports.exec = function(fileMap, importHelper, lib, registry, callback) {
          Severity: Minor
          Found in examples/hardware/import/data/import.js - About 35 mins to fix

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

            exports.exec = function(settings, registry) {
            
                exports.settings = settings;
                exports.registry = registry;
            
            
            Severity: Minor
            Found in lib/modelToModel/smwLayer.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 arrayReferencesObjectKey has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            exports.arrayReferencesObjectKey = function(obj, arrayName, objName) {
                if (obj[objName]) {
                    for (var j = 0; j < obj[arrayName].length; j++) {
                        var requirement = obj[arrayName][j];
                        if (!obj.properties[requirement] && requirement !== '*') {
            Severity: Minor
            Found in lib/util/validate.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 resolveReference has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            exports.resolveReference = function(url, hint) {
            
                /** If an error occurs, this gives a hint in which file */
                if (hint) {
                    hint = ' ' + hint + ': ';
            Severity: Minor
            Found in lib/util/moboUtil.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 getPagesInNamespace has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            exports.getPagesInNamespace = function(err, info, next, data) {
            
                if (data && data.query && data.query.allpages) {
            
                    // Give feedback how many pages in which namespaces will be deleted
            Severity: Minor
            Found in lib/modules/nuke.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 programmaticImport has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            exports.programmaticImport = function(fileMap, dirName, callback) {
            
                // Delete the import.js from the map, since it will be loaded dynamically
                delete fileMap['import.js'];
            
            
            Severity: Minor
            Found in lib/modules/import.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 objCollectionToWikitext has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            exports.objCollectionToWikitext = function(objCollection) {
            
                var wikitext = '';
            
                for (var i = 0; i < objCollection.length; i++) {
            Severity: Minor
            Found in lib/modules/importHelper.js - About 35 mins to fix

            Cognitive Complexity

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

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

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

            Further reading

            Avoid too many return statements within this function.
            Open

                return finalSettings;
            Severity: Major
            Found in lib/input/readSettings.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                          return 'Geographic coordinate';
              Severity: Major
              Found in lib/modelToModel/smwLayer.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                            return 'Temperature';
                Severity: Major
                Found in lib/modelToModel/smwLayer.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                              return 'r="149" g="91" b="244"';
                  Severity: Major
                  Found in lib/modelToText/generateGraph.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                        return 'r="165" g="165" b="165"';
                    Severity: Major
                    Found in lib/modelToText/generateGraph.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                  return 'r="244" g="91" b="91"';
                      Severity: Major
                      Found in lib/modelToText/generateGraph.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                    return 'Date';
                        Severity: Major
                        Found in lib/modelToModel/smwLayer.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                      return 'Quantity';
                          Severity: Major
                          Found in lib/modelToModel/smwLayer.js - About 30 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language