Xiphe/Thrall

View on GitHub

Showing 20 of 22 total issues

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

/* jshint ignore: line */module.exports = function(
  thrallConfig,
  path,
  grunt,
  glob,
Severity: Major
Found in lib/mergeGruntPluginConfig.js - About 5 hrs to fix

    Function exports has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
    Open

    /* jshint ignore: line */module.exports = function(
      thrallConfig,
      path,
      grunt,
      glob,
    Severity: Minor
    Found in lib/mergeGruntPluginConfig.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 initConfig has 86 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function initConfig(grunt) {
      grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        srcFiles: 'lib/*.js',
        testFiles: [
    Severity: Major
    Found in gruntfile.js - About 3 hrs to fix

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

      module.exports = function taskFactory(
        thrallConfig,
        grunt,
        mergeGruntPluginConfig,
        applyTaskOptions,
      Severity: Major
      Found in lib/task.js - About 2 hrs to fix

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

        module.exports = function(_, grunt, cliOptions) {
          'use strict';
        
          /** @const */
          var OPTION_TYPE_ARRAY = 'array';
        Severity: Minor
        Found in lib/applyTaskOptions.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 exports has 61 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports = function(_, grunt, cliOptions) {
          'use strict';
        
          /** @const */
          var OPTION_TYPE_ARRAY = 'array';
        Severity: Major
        Found in lib/applyTaskOptions.js - About 2 hrs to fix

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

          module.exports = function initFactory(
            thrallConfig,
            path,
            grunt,
            loadGruntPlugins,
          Severity: Major
          Found in lib/init.js - About 2 hrs to fix

            Function initFactory has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

            module.exports = function initFactory(
              thrallConfig,
              path,
              grunt,
              loadGruntPlugins,
            Severity: Minor
            Found in lib/init.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 addTaskFactory has 50 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            module.exports = function addTaskFactory(
              task,
              baseInjector,
              thrallConfig,
              grunt,
            Severity: Minor
            Found in lib/addTasks.js - About 2 hrs to fix

              Function exports has 10 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                task,
                baseInjector,
                thrallConfig,
                grunt,
                glob,
              Severity: Major
              Found in lib/addTasks.js - About 1 hr to fix

                Function loadGruntPluginsFactory has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                module.exports = function loadGruntPluginsFactory(
                  thrallConfig,
                  grunt,
                  findupSync,
                  path,
                Severity: Minor
                Found in lib/loadGruntPlugins.js - About 1 hr to fix

                  Function getSubConfig has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    function getSubConfig(tokens, subtaskInjector) {
                      var subConfigPath = path.join.apply(
                        path,
                        [thrallConfig.dir, CONFIG_DIR].concat(tokens)
                      );
                  Severity: Minor
                  Found in lib/mergeGruntPluginConfig.js - About 1 hr to fix

                    Function addTasks has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      function addTasks(tasks) {
                        if (!_.isArray(tasks) || !tasks.length) {
                          tasks = getTasks();
                        }
                    
                    
                    Severity: Minor
                    Found in lib/addTasks.js - About 1 hr to fix

                      Function loadGruntPlugins has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        return function loadGruntPlugins() {
                          grunt.verbose.subhead(
                            'loading grunt plugins for "' + thrallConfig.name + '"...'
                          );
                      
                      
                      Severity: Minor
                      Found in lib/loadGruntPlugins.js - About 1 hr to fix

                        Function exports has 7 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                          thrallConfig,
                          path,
                          grunt,
                          loadGruntPlugins,
                          addTasks,
                        Severity: Major
                        Found in lib/init.js - About 50 mins to fix

                          Function exports has 7 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                            thrallConfig,
                            path,
                            grunt,
                            glob,
                            _,
                          Severity: Major
                          Found in lib/mergeGruntPluginConfig.js - About 50 mins to fix

                            Function exports has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                              thrallConfig,
                              grunt,
                              mergeGruntPluginConfig,
                              applyTaskOptions,
                              _,
                            Severity: Minor
                            Found in lib/task.js - About 45 mins to fix

                              Function exports has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                thrallConfig,
                                grunt,
                                findupSync,
                                path,
                                _
                              Severity: Minor
                              Found in lib/loadGruntPlugins.js - About 35 mins to fix

                                Function addTaskFactory has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                Open

                                module.exports = function addTaskFactory(
                                  task,
                                  baseInjector,
                                  thrallConfig,
                                  grunt,
                                Severity: Minor
                                Found in lib/addTasks.js - About 35 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 taskFactory has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                Open

                                module.exports = function taskFactory(
                                  thrallConfig,
                                  grunt,
                                  mergeGruntPluginConfig,
                                  applyTaskOptions,
                                Severity: Minor
                                Found in lib/task.js - About 35 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