Showing 136 of 152 total issues

Function analyzeType has a Cognitive Complexity of 23 (exceeds 5 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 3 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 80 lines of code (exceeds 25 allowed). Consider refactoring.
Open

exports.exec = function(settings, registry) {
    'use strict';

    return new Promise(function(resolve) {

Severity: Major
Found in lib/modelToText/generateWikiStructure.js - About 3 hrs to fix

    File generateGraph.js has 298 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    //////////////////////////////////////////
    // Requirements                         //
    //////////////////////////////////////////
    
    var fs         = require('fs-extra');
    Severity: Minor
    Found in lib/modelToText/generateGraph.js - About 3 hrs to fix

      Function enhanceWithForm has 76 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      exports.enhanceWithForm = function(objCollection, formSchema) {
      
          if (formSchema && formSchema.$path) {
      
              var newCollection = [];
      Severity: Major
      Found in lib/modules/importHelper.js - About 3 hrs to fix

        Function generateForm has 74 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        exports.generateForm = function(settings, obj, name, registry) {
            'use strict';
        
            //////////////////////////////////////////
            // GENERAL FORM ATTRIBUTES              //
        Severity: Major
        Found in lib/modelToText/transformForm.js - About 2 hrs to fix

          Function readFiles has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
          Open

          exports.readFiles = function(files, type, callback) {
          
              'use strict';
          
              var content = {};
          Severity: Minor
          Found in lib/input/readProject.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

          File handlebarsExtended.js has 288 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

           // This module loads the handlebars template engine and adds custom extensions
           // Those are mainly helper functions that make wikitext generation easier
          
          var handlebars = require('handlebars');
          
          
          Severity: Minor
          Found in lib/util/handlebarsExtended.js - About 2 hrs to fix

            Function exports has 70 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            module.exports = function(grunt) {
            
                // Show elapsed time at the end
                require('time-grunt')(grunt);
            
            
            Severity: Major
            Found in Gruntfile.js - About 2 hrs to fix

              Function callParser has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
              Open

              exports.callParser = function(settings, generator, data, registry, generated) {
                  'use strict';
              
                  for (var name in data) {
              
              
              Severity: Minor
              Found in lib/modelToText/generateWikiStructure.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 extend has 68 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              exports.extend = function(obj, $extend, registry) {
                  'use strict';
              
                  var ref = $extend || obj.$extend || false;
              
              
              Severity: Major
              Found in lib/modelToModel/intermediaryLayer.js - About 2 hrs to fix

                Function convertPropertyArray has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                Open

                exports.convertPropertyArray = function(items, objId) {
                
                    'use strict';
                
                    var propertyObject = {};
                Severity: Minor
                Found in lib/modelToModel/compatibilityLayer.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 a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                Open

                exports.exec = function(customSettings) {
                
                    'use strict';
                
                    /** The projects custom settings.yaml */
                Severity: Minor
                Found in lib/input/readSettings.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 printProperty has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                exports.printProperty = function(attr) {
                    'use strict';
                
                    var result = '';
                    var inspect = attr.items || attr;
                Severity: Major
                Found in lib/util/handlebarsExtended.js - About 2 hrs to fix

                  Function upload has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  exports.upload = function(settings, uploadMap) {
                  
                      if (Object.keys(uploadMap).length === 0) {
                          log('[i] No pages to upload');
                  
                  
                  Severity: Major
                  Found in lib/modules/import.js - About 2 hrs to fix

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

                    exports.exec = function(settings, registry) {
                        'use strict';
                    
                        exports.outlineTemplate = moboUtil.loadTemplate(exports, 'outline.wikitext', settings);
                    
                    
                    Severity: Major
                    Found in lib/modelToText/generateOutline.js - About 2 hrs to fix

                      Function upgradeChangedProperties has a Cognitive Complexity of 17 (exceeds 5 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 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 generateTemplate has a Cognitive Complexity of 17 (exceeds 5 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 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 drilldownInfo has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      exports.drilldownInfo = function(obj, registry) {
                      
                          var drilldowninfo = [];
                          var fieldName;
                          var field;
                      Severity: Major
                      Found in lib/modelToText/transformModel.js - About 2 hrs to fix

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

                        exports.exec = function(settings, jobs) {
                        
                            'use strict';
                        
                            var i = 0;
                        Severity: Major
                        Found in lib/modules/nuke.js - About 2 hrs to fix

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

                          exports.postProcessing = function(modelPart) {
                              'use strict';
                          
                              for (var key in modelPart) {
                          
                          
                          Severity: Minor
                          Found in lib/modelToModel/intermediaryLayer.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

                          Severity
                          Category
                          Status
                          Source
                          Language