<commit_before><?xml version="1.0" encoding="UTF-8"?>
<!-- Continuous integration build.xml -->
<project name="php-orchestra" default="build" basedir="../..">

    <!-- Properties -->
    <property name="appli.src.project.path" value="src/symfony2" />

    <!-- Default target: build -->
    <target name="build" depends="prepare,lint,phploc,pdepend,phpmd-ci,phpcs-ci,phpcpd,phpunit,phpcb,phpdoc" />

    <!-- Cleanup task -->
    <target name="clean" description="Cleanup build artifacts">
        <delete dir="${basedir}/build/api" />
        <delete dir="${basedir}/build/code-browser" />
        <delete dir="${basedir}/build/coverage" />
        <delete dir="${basedir}/build/logs" />
        <delete dir="${basedir}/build/pdepend" />
    </target>

    <!-- Create build results directories -->
    <target name="prepare" depends="clean" description="Prepare for build">
        <mkdir dir="${basedir}/build/api" />
        <mkdir dir="${basedir}/build/code-browser" />
        <mkdir dir="${basedir}/build/coverage" />
        <mkdir dir="${basedir}/build/logs" />
        <mkdir dir="${basedir}/build/pdepend" />
    </target>

    <!-- Check PHP files syntax -->
    <target name="lint">
        <exec executable="bash" failonerror="true">
            <arg value="-c" />
            <arg value="find -L ${basedir}/${appli.src.project.path}/src ${basedir}/${appli.src.project.path}/vendor/php-orchestra -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l" />
        </exec>
    </target>

    <!-- Project size stats -->
    <target name="phploc" description="Measure project size using PHPLOC">
        <exec executable="phploc">
            <arg value="--log-csv" />
            <arg value="${basedir}/build/logs/phploc.csv" />
            <arg path="${basedir}/${appli.src.project.path}/vendor/php-orchestra" />
        </exec>
    </target>

    <!-- PHP Depend -->
    <target name="pdepend" description="Calculate software metrics using PHP_Depend">
        <exec executable="pdepend">
            <arg value="--jdepend-xml=${basedir}/build/logs/jdepend.xml" />
            <arg value="--jdepend-chart=${basedir}/build/pdepend/dependencies.svg" />
            <arg value="--overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg" />
            <arg path="${basedir}/${appli.src.project.path}/vendor/php-orchestra" />
        </exec>
    </target>

    <!-- PHP Mess Detector -->
    <target name="phpmd" description="Perform project mess detection using PHPMD" unless="appli.disable.phpmd">
        <exec executable="phpmd">
            <arg path="${basedir}/${appli.src.project.path}/vendor/php-orchestra,${basedir}/${appli.src.project.path}/src" />
            <arg value="text" />
            <arg value="${basedir}/build/jenkins/phpmd.xml" />
            <arg value="--exclude" />
            <arg value="Base" />
        </exec>
    </target>

    <!-- PHP Mess Detector for CI (generate report file) -->
    <target name="phpmd-ci" description="Perform project mess detection using PHPMD" unless="appli.disable.phpmd">
        <exec executable="phpmd">
            <arg path="${basedir}/${appli.src.project.path}/vendor/php-orchestra,${basedir}/${appli.src.project.path}/src" />
            <arg value="xml" />
            <arg value="${basedir}/build/jenkins/phpmd.xml" />
            <arg value="--reportfile" />
            <arg value="${basedir}/build/logs/pmd.xml" />
            <arg value="--exclude" />
            <arg value="Base" />
        </exec>
    </target>

    <!-- Code Sniffer -->
    <target name="phpcs" description="Find coding standard violations using PHP_CodeSniffer" unless="appli.disable.phpcs">
        <exec executable="phpcs">
            <arg value="--standard=PSR2" />
            <arg value="--extensions=php" />
            <arg path="${basedir}/${appli.src.project.path}/vendor/php-orchestra" />
            <arg path="${basedir}/${appli.src.project.path}/src" />
        </exec>
    </target>

    <!-- Code Sniffer for CI (generate report file) -->
    <target name="phpcs-ci" description="Find coding standard violations using PHP_CodeSniffer" unless="appli.disable.phpcs">
        <exec executable="phpcs">
            <arg value="--report=checkstyle" />
            <arg value="--report-file=${basedir}/build/logs/checkstyle.xml" />
            <arg value="--standard=PSR2" />
            <arg value="--extensions=php" />
            <arg path="${basedir}/${appli.src.project.path}/vendor/php-orchestra" />
            <arg path="${basedir}/${appli.src.project.path}/src" />
        </exec>
    </target>

    <!-- PHP Copy Paste Detector -->
    <target name="phpcpd" description="Find duplicate code using PHPCPD" unless="appli.disable.phpcpd">
        <exec executable="phpcpd">
            <arg value="--log-pmd" />
            <arg value="${basedir}/build/logs/pmd-cpd.xml" />
            <arg value="--exclude" />
            <arg value="Base" /><commit_msg>Using embedded PHP CPD for Jenkins<commit_after><?xml version="1.0" encoding="UTF-8"?>
<!-- Continuous integration build.xml -->
<project name="php-orchestra" default="build" basedir="../..">

    <!-- Properties -->
    <property name="appli.src.project.path" value="src/symfony2" />

    <!-- Default target: build -->
    <target name="build" depends="prepare,lint,phploc,pdepend,phpmd-ci,phpcs-ci,phpcpd,phpunit,phpcb,phpdoc" />

    <!-- Cleanup task -->
    <target name="clean" description="Cleanup build artifacts">
        <delete dir="${basedir}/build/api" />
        <delete dir="${basedir}/build/code-browser" />
        <delete dir="${basedir}/build/coverage" />
        <delete dir="${basedir}/build/logs" />
        <delete dir="${basedir}/build/pdepend" />
    </target>

    <!-- Create build results directories -->
    <target name="prepare" depends="clean" description="Prepare for build">
        <mkdir dir="${basedir}/build/api" />
        <mkdir dir="${basedir}/build/code-browser" />
        <mkdir dir="${basedir}/build/coverage" />
        <mkdir dir="${basedir}/build/logs" />
        <mkdir dir="${basedir}/build/pdepend" />
    </target>

    <!-- Check PHP files syntax -->
    <target name="lint">
        <exec executable="bash" failonerror="true">
            <arg value="-c" />
            <arg value="find -L ${basedir}/${appli.src.project.path}/src ${basedir}/${appli.src.project.path}/vendor/php-orchestra -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l" />
        </exec>
    </target>

    <!-- Project size stats -->
    <target name="phploc" description="Measure project size using PHPLOC">
        <exec executable="phploc">
            <arg value="--log-csv" />
            <arg value="${basedir}/build/logs/phploc.csv" />
            <arg path="${basedir}/${appli.src.project.path}/vendor/php-orchestra" />
        </exec>
    </target>

    <!-- PHP Depend -->
    <target name="pdepend" description="Calculate software metrics using PHP_Depend">
        <exec executable="pdepend">
            <arg value="--jdepend-xml=${basedir}/build/logs/jdepend.xml" />
            <arg value="--jdepend-chart=${basedir}/build/pdepend/dependencies.svg" />
            <arg value="--overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg" />
            <arg path="${basedir}/${appli.src.project.path}/vendor/php-orchestra" />
        </exec>
    </target>

    <!-- PHP Mess Detector -->
    <target name="phpmd" description="Perform project mess detection using PHPMD" unless="appli.disable.phpmd">
        <exec executable="phpmd">
            <arg path="${basedir}/${appli.src.project.path}/vendor/php-orchestra,${basedir}/${appli.src.project.path}/src" />
            <arg value="text" />
            <arg value="${basedir}/build/jenkins/phpmd.xml" />
            <arg value="--exclude" />
            <arg value="Base" />
        </exec>
    </target>

    <!-- PHP Mess Detector for CI (generate report file) -->
    <target name="phpmd-ci" description="Perform project mess detection using PHPMD" unless="appli.disable.phpmd">
        <exec executable="phpmd">
            <arg path="${basedir}/${appli.src.project.path}/vendor/php-orchestra,${basedir}/${appli.src.project.path}/src" />
            <arg value="xml" />
            <arg value="${basedir}/build/jenkins/phpmd.xml" />
            <arg value="--reportfile" />
            <arg value="${basedir}/build/logs/pmd.xml" />
            <arg value="--exclude" />
            <arg value="Base" />
        </exec>
    </target>

    <!-- Code Sniffer -->
    <target name="phpcs" description="Find coding standard violations using PHP_CodeSniffer" unless="appli.disable.phpcs">
        <exec executable="phpcs">
            <arg value="--standard=PSR2" />
            <arg value="--extensions=php" />
            <arg path="${basedir}/${appli.src.project.path}/vendor/php-orchestra" />
            <arg path="${basedir}/${appli.src.project.path}/src" />
        </exec>
    </target>

    <!-- Code Sniffer for CI (generate report file) -->
    <target name="phpcs-ci" description="Find coding standard violations using PHP_CodeSniffer" unless="appli.disable.phpcs">
        <exec executable="phpcs">
            <arg value="--report=checkstyle" />
            <arg value="--report-file=${basedir}/build/logs/checkstyle.xml" />
            <arg value="--standard=PSR2" />
            <arg value="--extensions=php" />
            <arg path="${basedir}/${appli.src.project.path}/vendor/php-orchestra" />
            <arg path="${basedir}/${appli.src.project.path}/src" />
        </exec>
    </target>

    <!-- PHP Copy Paste Detector -->
    <target name="phpcpd" description="Find duplicate code using PHPCPD" unless="appli.disable.phpcpd">
        <exec executable="${basedir}/${appli.src.project.path}/bin/phpcpd">
            <arg value="--log-pmd" />
            <arg value="${basedir}/build/logs/pmd-cpd.xml" />
            <arg value="--exclude" />
            <arg value="Base" />
{'fraction_non_alphanumeric': 0.19319097502014504, 'fraction_numerical': 0.00201450443190975, 'mean_word_length': 2.4692522711390636, 'pattern_counts': {'":': 0, '<': 195, '<?xml version=': 2, '>': 195, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 20}, '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': '201697', 'n_tokens_mistral': 3076, 'n_tokens_neox': 2984, 'n_words': 539}