<commit_before>var fs = require('fs');

module.exports = function(grunt) {

    /**
     * The directory used to produce outputs.
     * 
     * @property {String}
     */
    var TARGET_DIRECTORY = 'target';

    grunt.initConfig(
        {
            
            /**
             * Reads the 'package.json' file and puts it content into a 'pkg' Javascript object.
             */
            pkg : grunt.file.readJSON('package.json'),
            
            /**
             * Clean task.
             */
            clean : ['target'],
            
            /**
             * Copy task.
             */
            copy : {
                
                /**
                 * Copy test resource files to the target.
                 */
                'test-resources' : {
                    files : [
                        {
                            cwd: 'src/test/resources',
                            expand: true,
                            src: '**',
                            dest: 'target/test-resources/'
                        }
                    ]
                }
                
            }, /* Copy task */
            
            /**
             * PHP CodeSniffer Task
             */
            phpcs : {
                
                library: {
                    dir: [
                        'src/main/php/Gomoob', 
                        'src/test/php/Gomoob'
                    ]
                },

                options : {
                    bin:  'vendor/bin/phpcs',
                    report: (function() {
                        
                        var report = false;
                        
                        if(grunt.option('checkstyle') === true) {
                            
                            report = 'checkstyle';
                        }
                        
                        return report;
                        
                    })(),
                    reportFile: (function() { 

                        var reportFile = false;
                        
                        if(grunt.option('checkstyle') === true) {

                            reportFile = 'target/reports/phpcs/phpcs.xml'; 
                        }
                        
                        return reportFile;
                        
                    })(),
                    standard: 'PSR2',
                    verbose: false
                }

            },
            
            /**
             * PHPDocumentor Task.
             */
            phpdocumentor : {
                
                options : {
                    directory : 'src/main/php',
                    target : 'target/reports/phpdocumentor'
                }, 
                
                /**
                 * Target used to generate the PHP documentation of the project.
                 */
                generate : {}
                
            }, /* PHPDocumentor Task */
            
            /**
             * PHPUnit Task.
             */
            phpunit : {
                
                classes: {
                    dir: 'src/test/php'
                }, 
                
                options: {
                    configuration : 'phpunit.xml',
                    //group : 'PushwooshTest'
                        
                }
                
            }, /* PHPUnit Task */

            /**
             * Shell Task
             */
            shell : {
                
                pdepend : {
                    command : (function() {
                        
                        var command = 'pdepend';
                        command += ' --jdepend-chart=target/reports/pdepend/jdepend-chart.svg';
                        command += ' --jdepend-xml=target/reports/pdepend/jdepend.xml';
                        command += ' --overview-pyramid=target/reports/pdepend/overview-pyramid.svg';
                        command += ' --summary-xml=target/reports/pdepend/summary.xml';
                        command += ' src/main/php';
                        
                        return command;

                    })()
                },
                
                phpcpd : {
                    command : (function() {<commit_msg>Fix PDepend execution in TravisCI.<commit_after>var fs = require('fs');

module.exports = function(grunt) {

    /**
     * The directory used to produce outputs.
     * 
     * @property {String}
     */
    var TARGET_DIRECTORY = 'target';

    grunt.initConfig(
        {
            
            /**
             * Reads the 'package.json' file and puts it content into a 'pkg' Javascript object.
             */
            pkg : grunt.file.readJSON('package.json'),
            
            /**
             * Clean task.
             */
            clean : ['target'],
            
            /**
             * Copy task.
             */
            copy : {
                
                /**
                 * Copy test resource files to the target.
                 */
                'test-resources' : {
                    files : [
                        {
                            cwd: 'src/test/resources',
                            expand: true,
                            src: '**',
                            dest: 'target/test-resources/'
                        }
                    ]
                }
                
            }, /* Copy task */
            
            /**
             * PHP CodeSniffer Task
             */
            phpcs : {
                
                library: {
                    dir: [
                        'src/main/php/Gomoob', 
                        'src/test/php/Gomoob'
                    ]
                },

                options : {
                    bin:  'vendor/bin/phpcs',
                    report: (function() {
                        
                        var report = false;
                        
                        if(grunt.option('checkstyle') === true) {
                            
                            report = 'checkstyle';
                        }
                        
                        return report;
                        
                    })(),
                    reportFile: (function() { 

                        var reportFile = false;
                        
                        if(grunt.option('checkstyle') === true) {

                            reportFile = 'target/reports/phpcs/phpcs.xml'; 
                        }
                        
                        return reportFile;
                        
                    })(),
                    standard: 'PSR2',
                    verbose: false
                }

            },
            
            /**
             * PHPDocumentor Task.
             */
            phpdocumentor : {
                
                options : {
                    directory : 'src/main/php',
                    target : 'target/reports/phpdocumentor'
                }, 
                
                /**
                 * Target used to generate the PHP documentation of the project.
                 */
                generate : {}
                
            }, /* PHPDocumentor Task */
            
            /**
             * PHPUnit Task.
             */
            phpunit : {
                
                classes: {
                    dir: 'src/test/php'
                }, 
                
                options: {
                    configuration : 'phpunit.xml',
                    //group : 'PushwooshTest'
                        
                }
                
            }, /* PHPUnit Task */

            /**
             * Shell Task
             */
            shell : {
                
                pdepend : {
                    command : (function() {
                        
                        var command = 'php vendor/pdepend/pdepend/src/bin/pdepend';
                        command += ' --jdepend-chart=target/reports/pdepend/jdepend-chart.svg';
                        command += ' --jdepend-xml=target/reports/pdepend/jdepend.xml';
                        command += ' --overview-pyramid=target/reports/pdepend/overview-pyramid.svg';
                        command += ' --summary-xml=target/reports/pdepend/summary.xml';
                        command += ' src/main/php';
                        
                        return command;

                    })()
                },
                
                phpcpd : {
                    command : (function() {
{'fraction_non_alphanumeric': 0.09195933456561922, 'fraction_numerical': 0.0002310536044362292, 'mean_word_length': 0.5803212851405622, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 12}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '287252', 'n_tokens_mistral': 1927, 'n_tokens_neox': 1741, 'n_words': 309}