JoTrdl/grunt-dock

View on GitHub
lib/container.js

Summary

Maintainability
C
1 day
Test Coverage

Function start has 72 lines of code (exceeds 25 allowed). Consider refactoring.
Open

commands.start = function(grunt, docker, options, done, tag) {

  // Start 1 container with image tag
  var startContainer = function(tag, confImage, callback) {

Severity: Major
Found in lib/container.js - About 2 hrs to fix

    Function action has 58 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      commands[action] = function(grunt, docker, options, done, tag) {
    
        // process 1 container with image tag
        var process = function(tag, confImage, callback) {
    
    
    Severity: Major
    Found in lib/container.js - About 2 hrs to fix

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

        var startContainer = function(tag, confImage, callback) {
      
          grunt.log.subhead('Starting image [' + tag + ']');
      
          async.waterfall([
      Severity: Major
      Found in lib/container.js - About 2 hrs to fix

        Function process has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            var process = function(tag, confImage, callback) {
        
              grunt.log.subhead(actioning[action] + ' image [' + tag + ']');
        
              async.waterfall([
        Severity: Minor
        Found in lib/container.js - About 1 hr to fix

          Consider simplifying this complex logical expression.
          Open

                    if (container) {
                      var dockcontainer = docker.getContainer(container.Id);
                      if (utils.getContainerStatus(container) === "RUNNING") {
                        grunt.log
                            .writeln("Found a matched running container, killed it.");
          Severity: Major
          Found in lib/container.js - About 40 mins to fix

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

            commands.start = function(grunt, docker, options, done, tag) {
            Severity: Minor
            Found in lib/container.js - About 35 mins to fix

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

                commands[action] = function(grunt, docker, options, done, tag) {
              Severity: Minor
              Found in lib/container.js - About 35 mins to fix

                There are no issues that match your filters.

                Category
                Status