prantlf/grunt-move

View on GitHub

Showing 5 of 7 total issues

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

module.exports = function (grunt) {
  var tmp = os.tmpdir(),
      succeedingTasks = [
        'move:empty', 'move:missing', 'move:rename',
        'move:move_with_rename', 'move:move_without_rename',
Severity: Major
Found in Gruntfile.js - About 6 hrs to fix

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

    module.exports = function (grunt) {
      grunt.registerMultiTask('move', 'Moves and renames files and directories.', function () {
        var done = this.async(),
            options = this.options({
              ignoreMissing: false,
    Severity: Minor
    Found in tasks/move.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 78 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function (grunt) {
      grunt.registerMultiTask('move', 'Moves and renames files and directories.', function () {
        var done = this.async(),
            options = this.options({
              ignoreMissing: false,
    Severity: Major
    Found in tasks/move.js - About 3 hrs to fix

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

          function moveAll(file, allDone) {
            if (!file.src.length) {
              if (!options.ignoreMissing) {
                grunt.fail.warn('No files or directories found at ' +
                  colorette.cyan(file.orig.src) + '.');
      Severity: Major
      Found in tasks/move.js - About 2 hrs to fix

        Function moveOne has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              function moveOne(src, oneDone) {
                var dest = file.dest,
                    trailingChar = dest[dest.length - 1],
                    dir;
        
        
        Severity: Minor
        Found in tasks/move.js - About 1 hr to fix
          Severity
          Category
          Status
          Source
          Language