Showing 136 of 152 total issues

Function install has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

exports.install = function(name, customDirectory) {
    'use strict';

    var fs  = require('fs-extra');
    var cwd = customDirectory || process.cwd();
Severity: Minor
Found in lib/mobo.js - About 2 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 exec has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

exports.exec = function(settings, dirName) {

    'use strict';

    exports.uploadMap = {};
Severity: Major
Found in lib/modules/import.js - About 2 hrs to fix

    Function exec has 51 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    exports.exec = function(customSettings) {
    
        'use strict';
    
        /** The projects custom settings.yaml */
    Severity: Major
    Found in lib/input/readSettings.js - About 2 hrs to fix

      Function generateTemplateData has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      exports.generateTemplateData = function(obj) {
          'use strict';
      
          var templateData = {};
      
      
      Severity: Major
      Found in lib/modelToText/transformModel.js - About 2 hrs to fix

        Function gefxExport has 50 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        exports.gefxExport = function(nodes, edges) {
            'use strict';
        
            var node;
            var edge;
        Severity: Minor
        Found in lib/modelToText/generateGraph.js - About 2 hrs to fix

          Function upgradeChangedProperties has 49 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          exports.upgradeChangedProperties = function(obj, modelPartName) {
          
              var messages = {}; // A message Set, that contains each message only once, the value beeing the counter
          
          
          
          Severity: Minor
          Found in lib/modelToModel/compatibilityLayer.js - About 1 hr to fix

            Function validateExpandedRegistry has 49 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            exports.validateExpandedRegistry = function(registry) {
                'use strict';
            
                return new Promise(function(resolve) {
            
            
            Severity: Minor
            Found in lib/util/validate.js - About 1 hr to fix

              Function analyzeType has 49 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              exports.analyzeType = function(obj) {
                  'use strict';
              
                  // Analyze the attribute type.
                  var inspect = obj.items || obj;
              Severity: Minor
              Found in lib/modelToModel/smwLayer.js - About 1 hr to fix

                Function generateCategory has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                exports.generateCategory = function(settings, obj, name, registry) {
                
                    // If smw_category is set to false, don't create a category
                    if (obj.smw_category === false) {
                        return false;
                Severity: Minor
                Found in lib/modelToText/transformModel.js - About 1 hr to fix

                  Function calculateSpecificsStatistics has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                  Open

                  exports.calculateSpecificsStatistics = function(registry) {
                  
                      var moboSchema   = require('./../schema/moboSchema');
                      var schema = moboSchema.formSchema.properties;
                  
                  
                  Severity: Minor
                  Found in lib/util/statistics.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 validate has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                  Open

                  exports.validate = function(objCollection, registry) {
                  
                      var errors = 0;
                  
                      for (var i = 0; i < objCollection.length; i++) {
                  Severity: Minor
                  Found in lib/modules/importHelper.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 calculateSpecificsStatistics has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  exports.calculateSpecificsStatistics = function(registry) {
                  
                      var moboSchema   = require('./../schema/moboSchema');
                      var schema = moboSchema.formSchema.properties;
                  
                  
                  Severity: Minor
                  Found in lib/util/statistics.js - About 1 hr to fix

                    Function generateTemplate has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    exports.generateTemplate = function(settings, obj, name, registry) {
                        'use strict';
                    
                        // If this is an abstract model, don't create a template for it
                        if (obj.$abstract) {
                    Severity: Minor
                    Found in lib/modelToText/transformModel.js - About 1 hr to fix

                      Function install has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      exports.install = function(name, customDirectory) {
                          'use strict';
                      
                          var fs  = require('fs-extra');
                          var cwd = customDirectory || process.cwd();
                      Severity: Minor
                      Found in lib/mobo.js - About 1 hr to fix

                        Function readFiles has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        exports.readFiles = function(files, type, callback) {
                        
                            'use strict';
                        
                            var content = {};
                        Severity: Minor
                        Found in lib/input/readProject.js - About 1 hr to fix

                          Function analyzeForms has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          exports.analyzeForms = function(forms) {
                              'use strict';
                          
                              for (var formName in forms) {
                          
                          
                          Severity: Minor
                          Found in lib/modelToText/generateGraph.js - About 1 hr to fix

                            Function applyImplicit has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            exports.applyImplicit = function(obj) {
                            
                                'use strict';
                            
                                var inspect = obj.items || obj;
                            Severity: Minor
                            Found in lib/modelToModel/compatibilityLayer.js - About 1 hr to fix

                              Function objToTemplate has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                              Open

                              exports.objToTemplate = function(name, obj) {
                              
                                  if (!obj || Object.keys(obj).length === 0) {
                                      return '{{' + name + '}}\n'; // No unnecessary linebreaks
                                  }
                              Severity: Minor
                              Found in lib/modules/importHelper.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 inherit has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                              Open

                              exports.inherit = function(obj, registry) {
                                  'use strict';
                              
                                  if (obj.$path) {
                                      exports.inheritanceStack.push(obj.$path);
                              Severity: Minor
                              Found in lib/modelToModel/intermediaryLayer.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 exec has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              exports.exec = function(fileMap, importHelper, lib, registry, callback) {
                              
                              
                                  //////////////////////////////////////
                                  // Imports                          //
                              Severity: Minor
                              Found in examples/hardware/import/data/import.js - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language