MrBoolean/tb

View on GitHub

Showing 16 of 47 total issues

Function walkThrough has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

module.exports = function walkThrough(spec, config, path, checkDifference) {
  var result = {};
  var few = [];
  var key;
  var isDefined;
Severity: Minor
Found in lib/tree/walk-through.js - About 5 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 validate has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

module.exports = function validate(child, key, value, path) {
  var type = typeOf(value);
  var index;
  var item;
  var isValid;
Severity: Minor
Found in lib/tree/validate.js - About 5 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 exportProgram has 85 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function exportProgram(program) {
  program
    .command('doc <sources...>')
    .description('run setup')
    .option('-o, --output [output]')
Severity: Major
Found in lib/command/doc.js - About 3 hrs to fix

    Function exportProgram has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

    module.exports = function exportProgram(program) {
      program
        .command('doc <sources...>')
        .description('run setup')
        .option('-o, --output [output]')
    Severity: Minor
    Found in lib/command/doc.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 generate has 77 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        .action(function generate(sources, options) {
          function log() {
            if (!options.verbose) {
              return;
            }
    Severity: Major
    Found in lib/command/doc.js - About 3 hrs to fix

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

      NumberNode.prototype.validate = function validate(value, path) {
        return runValidation([
          {
            runable: this.options.greaterThan,
            validator: {
      Severity: Major
      Found in lib/node/number.js - About 2 hrs to fix

        Function walkThrough has 67 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports = function walkThrough(spec, config, path, checkDifference) {
          var result = {};
          var few = [];
          var key;
          var isDefined;
        Severity: Major
        Found in lib/tree/walk-through.js - About 2 hrs to fix

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

          module.exports = function runConditional(child, result, key, path) {
            var condition;
            var index;
            var executor;
          
          
          Severity: Minor
          Found in lib/tree/run-conditional.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 prepareEach has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

          module.exports = function prepareEach(item) {
            var data = {};
            var key;
            var spec;
            var optKey;
          Severity: Minor
          Found in lib/command/doc/prepare-each.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 validate has 55 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          module.exports = function validate(child, key, value, path) {
            var type = typeOf(value);
            var index;
            var item;
            var isValid;
          Severity: Major
          Found in lib/tree/validate.js - About 2 hrs to fix

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

            ArrayNode.prototype.validate = function validate(value, path) {
              var count = value.length;
            
              return runValidation([
                {
            Severity: Major
            Found in lib/node/array.js - About 2 hrs to fix

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

              StringNode.prototype.validate = function validate(value, path) {
                var count = value.length;
              
                return runValidation([
                  {
              Severity: Major
              Found in lib/node/string.js - About 2 hrs to fix

                Function runConditional has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                module.exports = function runConditional(child, result, key, path) {
                  var condition;
                  var index;
                  var executor;
                
                
                Severity: Minor
                Found in lib/tree/run-conditional.js - About 1 hr to fix

                  Function prepareEach has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  module.exports = function prepareEach(item) {
                    var data = {};
                    var key;
                    var spec;
                    var optKey;
                  Severity: Minor
                  Found in lib/command/doc/prepare-each.js - About 1 hr to fix

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

                    module.exports = function runValidation(options, value, path) {
                      var index;
                      var item;
                    
                      for (index = 0; index < options.length; index++) {
                    Severity: Minor
                    Found in lib/util/run-validation.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

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

                    BooleanNode.prototype.validate = function validate(value, path) {
                      if (this.options.expectToBe !== null && this.options.expectToBe !== value) {
                        throw new ConfigError(util.format(
                          'Expect to be "%s" - go "%s"',
                          (this.options.expectToBe === true) ? 'true' : 'false',
                    Severity: Minor
                    Found in lib/node/boolean.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