isuttell/grunt-flow-type-check

View on GitHub

Showing 10 of 10 total issues

Function init has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

exports.init = function(grunt) {

  /**
   * Add the json arg for commands that accept it
   *
Severity: Minor
Found in tasks/lib/args.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 exports has 65 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    jshint: {
Severity: Major
Found in Gruntfile.js - About 2 hrs to fix

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

    module.exports = function(grunt) {
    
      // Flow control library
      var Flow = require('./lib/run').init(grunt);
      var FlowArgs = require('./lib/args').init(grunt);
    Severity: Major
    Found in tasks/flow.js - About 2 hrs to fix

      Function init has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      exports.init = function(grunt) {
      
        /**
         * Add the json arg for commands that accept it
         *
      Severity: Minor
      Found in tasks/lib/args.js - About 1 hr to fix

        Function init has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        exports.init = function(grunt) {
        
          /**
           * Run the flow command
           *
        Severity: Minor
        Found in tasks/lib/run.js - About 1 hr to fix

          Function run has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            exports.run = function(args, opts, input, done) {
          
              /**
               * Some errors we just need to alert the user, and some we need to fail
               *
          Severity: Minor
          Found in tasks/lib/run.js - About 1 hr to fix

            Function which has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

            function which(cmd) {
              if (absUnix(cmd)) { return cmd; }
            
              var pathEnv = (process.env.PATH || '').split(COLON);
              var pathExt = [''];
            Severity: Minor
            Found in tasks/lib/which.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 exports has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            module.exports = function(input, path) {
              if (!input || (input && typeof input.passed === 'undefined')) {
                return input;
              }
            
            
            Severity: Minor
            Found in tasks/lib/style.js - About 1 hr to fix

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

              exports.init = function(grunt) {
              
                /**
                 * Run the flow command
                 *
              Severity: Minor
              Found in tasks/lib/run.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 exports has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

              module.exports = function(input, path) {
                if (!input || (input && typeof input.passed === 'undefined')) {
                  return input;
                }
              
              
              Severity: Minor
              Found in tasks/lib/style.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