Showing 136 of 152 total issues

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 'Text';
    Severity: Major
    Found in lib/modelToModel/smwLayer.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                  return 'Record';
      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

          Avoid too many return statements within this function.
          Open

                      return 'r="125" g="235" b="143"';
          Severity: Major
          Found in lib/modelToText/generateGraph.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="209" g="110" 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 '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="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 'Telephone number';
                    Severity: Major
                    Found in lib/modelToModel/smwLayer.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

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

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

                        exports.objToFunction = function(name, obj) {
                        
                            var wikitext = '{{' + name + ':\n';
                        
                            for (var propertyName in obj) {
                        Severity: Minor
                        Found in lib/modules/importHelper.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 writeFile has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                        module.exports.writeFile = function(generated, dir, extension) {
                        
                            'use strict';
                        
                            return new Promise(function(resolve) {
                        Severity: Minor
                        Found in lib/output/writeExportFiles.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 webserver has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                                var webserver = require('http').createServer(function(request, response) {
                        
                                    request.addListener('end', function() {
                        
                                        // If the webapp requests a file from the /_processed/ directory
                        Severity: Minor
                        Found in lib/cli.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 loadTemplate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                        exports.loadTemplate = function(scope, templateFileName, settings, internalTemplate) {
                        
                            handlebars.setMoboSettings(settings);
                        
                            var templateName = templateFileName.substr(0, templateFileName.lastIndexOf('.'));
                        Severity: Minor
                        Found in lib/util/moboUtil.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 upgradeFormLinks has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                        exports.upgradeFormLinks = function(obj) {
                        
                            var inspect = obj.items || obj;
                        
                            if (inspect.format && inspect.format.indexOf('/form/') > -1) {
                        Severity: Minor
                        Found in lib/modelToModel/compatibilityLayer.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