'use strict';
var _ = require('lodash');
var plato = require('plato');
var gulp = require('gulp');
var gulpJshint = require('gulp-jshint');
var gulpJasmine = require('gulp-jasmine');
var gulpIstanbul = require('gulp-istanbul');
var gulpJscs = require('gulp-jscs');
var gulpJscpd = require('gulp-jscpd');
var gulpUtil = require('gulp-util');
var pathConf = {
    src: './src/**/*.js',
    specs: './specs/**/*.js',
    gulpfile: 'gulpfile.js',
    reports: './reports',
    platoReport: './reports/plato',
    covarageReport: './reports/coverage'
};
var combinePath = combinePathFor(pathConf);

gulp.task('jshint', function () {
    var src = combinePath('src', 'specs', 'gulpfile');
    return gulp.src(src)
        .pipe(gulpJshint())
        .pipe(gulpJshint.reporter('jshint-stylish'));
});

gulp.task('jscs', function () {
    var src = combinePath('src', 'specs', 'gulpfile');
    return gulp.src(src)
        .pipe(gulpJscs())
        .on('error', handleError);
});
gulp.task('jscpd', function() {
    var src = combinePath('src', 'specs', 'gulpfile');
    return gulp.src(src)
        .pipe(gulpJscpd({
            'min-lines': 5,
            verbose    : true
        }));
});
gulp.task('lint', ['jshint', 'jscs', 'jscpd']);

gulp.task('test', function () {
    return gulp.src(pathConf.specs)
        .pipe(gulpJasmine());
});

gulp.task('tdd', function () {
    gulp.watch(combinePath('src', 'specs'), ['test']);
});

gulp.task('test-report', function (cb) {
    gulp.src(pathConf.src)
        .pipe(gulpIstanbul())
        .pipe(gulpIstanbul.hookRequire())
        .on('finish', function () {
            gulp.src(pathConf.specs)
                .pipe(gulpJasmine())
                .pipe(gulpIstanbul.writeReports({
                    dir: './reports/coverage',
                    reporters: ['lcov', 'json', 'text', 'text-summary']
                }))
                .on('end', cb);
        });
});
gulp.task('default', ['test', 'jshint']);

gulp.task('plato', function (cb) {
    var files = [pathConf.src, pathConf.specs, pathConf.gulpfile];
    var dest = pathConf.platoReport;
    var options = {
        title: 'Complexity of a DI'
    };
    plato.inspect(files, dest, options, function() {
        cb();
    });
});

gulp.task('report', ['plato', 'test-report']);
function combinePathFor(conf) {
    return function (/* args*/) {
        return _(conf)
            .pick(arguments)
            .values()
            .value();
    };
}

function handleError(err) {
    gulpUtil.log(gulpUtil.colors.red('JSCS Error\n'), err.message);
    this.emit('end');
}

@@ -505,17 +505,17 @@
 %0A    cov
-a
+e
 rageRepo
@@ -961,24 +961,25 @@
 Error);%0A%7D);%0A
+%0A
 gulp.task('j
@@ -1175,24 +1175,25 @@
    %7D));%0A%7D);%0A
+%0A
 gulp.task('l
@@ -1748,35 +1748,33 @@
    dir: 
-'./reports/
+pathConf.
 coverage
 ',%0A     
@@ -1765,17 +1765,22 @@
 coverage
-'
+Report
 ,%0A      
@@ -1913,16 +1913,17 @@
 %7D);%0A%7D);%0A
+%0A
 gulp.tas
@@ -2231,32 +2231,32 @@
 );%0A    %7D);%0A%7D);%0A%0A
-
 gulp.task('repor
@@ -2286,16 +2286,17 @@
 ort'%5D);%0A
+%0A
 function

Correct typo mistake and correct some formatiing