lib/input/readProject.js

Summary

Maintainability
C
1 day
Test Coverage

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

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 walk has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    exports.walk = function(dir, callback) {
    
        'use strict';
    
        var results = [];
    Severity: Minor
    Found in lib/input/readProject.js - About 1 hr to fix

      Function interpretFile has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

      exports.interpretFile = function(file, fileName, relativeFilePath, fileExtension) {
      
          var obj;
          var isObject = true;
      
      
      Severity: Minor
      Found in lib/input/readProject.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 interpretFile has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      exports.interpretFile = function(file, fileName, relativeFilePath, fileExtension) {
      
          var obj;
          var isObject = true;
      
      
      Severity: Minor
      Found in lib/input/readProject.js - About 1 hr to fix

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

        exports.exec = function(importModelDir) {
        
            'use strict';
        
            return new Promise(function(resolve, reject) {
        Severity: Minor
        Found in lib/input/readProject.js - About 1 hr to fix

          There are no issues that match your filters.

          Category
          Status