<commit_before><?xml version="1.0" encoding="UTF-8"?>
<project name="${projectName}" basedir="." default="build:main">
    <!-- Properties -->
    <property name="dir.app" value="${project.basedir}/app" />
    <property name="dir.src" value="${project.basedir}/src" />
    <property name="dir.build" value="${project.basedir}/build" />
    <property name="dir.reports" value="${dir.build}/log" />
    <property name="dir.reports.pdepend" value="${dir.reports}/pdepend" />
    <property name="dir.reports.coverage" value="${dir.reports}/coverage" />

    <!-- Filesets -->
    <fileset id="sourcecode" dir="${dir.src}">
        <include name="**/*.php" />
    </fileset>

    <!-- Default target -->
    <target name="build:main"
            depends="build:clean, build:prepare, composer, build:check, build:test"
            description="Run all test and build everything" />

    <!-- Check target -->
    <target name="build:check"
            depends="check:cs, check:md, check:cpd, check:depend"
            description="Analyzes app code." />

    <!-- Test target -->
    <target name="build:test"
            depends="test:unit"
            description="Executes all tests.." />

    <!-- Project build clean -->
    <target name="build:clean" description="Clean up build directories.">
        <echo msg="Cleaning build directories ..." />
        <delete dir="${dir.build}" verbose="true" />
    </target>

    <!-- Project build prepare -->
    <target name="build:prepare" description="Create build directories.">
        <echo msg="Creating build directories ..." />
        <mkdir dir="${dir.build}" />
        <mkdir dir="${dir.reports}" />
        <mkdir dir="${dir.reports.coverage}" />
        <mkdir dir="${dir.reports.pdepend}" />
    </target>

    <!-- PSR2 code sniffer -->
    <target name="check:cs" description="Checks coding standard.">
        <echo msg="Checking coding standard ..." />
        <phpcodesniffer standard="PSR2"
                        showSniffs="true"
                        showWarnings="true">
            <fileset refid="sourcecode" />
            <formatter type="checkstyle" outfile="${dir.reports}/checkstyle.xml" />
        </phpcodesniffer>
    </target>

    <!-- copy/paste detector -->
    <target name="check:cpd" description="Checks similar code blocks.">
        <echo msg="Checking similar code blocks ..." />
        <phpcpd>
            <fileset refid="sourcecode" />
            <formatter type="pmd" outfile="${dir.reports}/pmd-cpd.xml" />
        </phpcpd>
    </target>

    <!-- Mess detector -->
    <target name="check:md" description="Generate code metrics.">
        <echo msg="Generating code metrics ..." />
        <phpmd rulesets="codesize,unusedcode">
            <fileset refid="sourcecode" />
            <formatter type="xml" outfile="${dir.reports}/pmd.xml" />
        </phpmd>
    </target>

    <!-- Code dependency -->
    <target name="check:depend" description="Checks coupling and dependency.">
        <echo msg="Checking coupling and dependency ..." />
        <phpdepend>
            <fileset refid="sourcecode" />
            <logger type="jdepend-xml" outfile="${dir.reports.pdepend}/jdepend.xml" />
            <logger type="jdepend-chart" outfile="${dir.reports.pdepend}/dependencies.svg" />
            <logger type="overview-pyramid" outfile="${dir.reports.pdepend}/overview-pyramid.svg" />
        </phpdepend>
    </target>

    <!-- Unit tests -->
    <target name="test:unit" description="Executes unit tests.">
        <echo msg="Running unit tests ..." />
        <exec command="phpunit --log-junit ${dir.reports}/phpunit.xml --coverage-clover ${dir.reports.coverage}/clover.xml --coverage-html ${dir.reports.coverage}/"/>
    </target>

    <!-- Composer install -->
    <target name="composer" description="Installing composer dependencies">
        <exec executable="composer">
            <arg value="install" />
            <arg value="--dev" />
            <arg value="--prefer-dist" />
            <arg value="--no-progress" />
        </exec>
    </target>

</project><commit_msg>Add crap4j.xml<commit_after><?xml version="1.0" encoding="UTF-8"?>
<project name="${projectName}" basedir="." default="build:main">
    <!-- Properties -->
    <property name="dir.app" value="${project.basedir}/app" />
    <property name="dir.src" value="${project.basedir}/src" />
    <property name="dir.build" value="${project.basedir}/build" />
    <property name="dir.reports" value="${dir.build}/log" />
    <property name="dir.reports.pdepend" value="${dir.reports}/pdepend" />
    <property name="dir.reports.coverage" value="${dir.reports}/coverage" />

    <!-- Filesets -->
    <fileset id="sourcecode" dir="${dir.src}">
        <include name="**/*.php" />
    </fileset>

    <!-- Default target -->
    <target name="build:main"
            depends="build:clean, build:prepare, composer, build:check, build:test"
            description="Run all test and build everything" />

    <!-- Check target -->
    <target name="build:check"
            depends="check:cs, check:md, check:cpd, check:depend"
            description="Analyzes app code." />

    <!-- Test target -->
    <target name="build:test"
            depends="test:unit"
            description="Executes all tests.." />

    <!-- Project build clean -->
    <target name="build:clean" description="Clean up build directories.">
        <echo msg="Cleaning build directories ..." />
        <delete dir="${dir.build}" verbose="true" />
    </target>

    <!-- Project build prepare -->
    <target name="build:prepare" description="Create build directories.">
        <echo msg="Creating build directories ..." />
        <mkdir dir="${dir.build}" />
        <mkdir dir="${dir.reports}" />
        <mkdir dir="${dir.reports.coverage}" />
        <mkdir dir="${dir.reports.pdepend}" />
    </target>

    <!-- PSR2 code sniffer -->
    <target name="check:cs" description="Checks coding standard.">
        <echo msg="Checking coding standard ..." />
        <phpcodesniffer standard="PSR2"
                        showSniffs="true"
                        showWarnings="true">
            <fileset refid="sourcecode" />
            <formatter type="checkstyle" outfile="${dir.reports}/checkstyle.xml" />
        </phpcodesniffer>
    </target>

    <!-- copy/paste detector -->
    <target name="check:cpd" description="Checks similar code blocks.">
        <echo msg="Checking similar code blocks ..." />
        <phpcpd>
            <fileset refid="sourcecode" />
            <formatter type="pmd" outfile="${dir.reports}/pmd-cpd.xml" />
        </phpcpd>
    </target>

    <!-- Mess detector -->
    <target name="check:md" description="Generate code metrics.">
        <echo msg="Generating code metrics ..." />
        <phpmd rulesets="codesize,unusedcode">
            <fileset refid="sourcecode" />
            <formatter type="xml" outfile="${dir.reports}/pmd.xml" />
        </phpmd>
    </target>

    <!-- Code dependency -->
    <target name="check:depend" description="Checks coupling and dependency.">
        <echo msg="Checking coupling and dependency ..." />
        <phpdepend>
            <fileset refid="sourcecode" />
            <logger type="jdepend-xml" outfile="${dir.reports.pdepend}/jdepend.xml" />
            <logger type="jdepend-chart" outfile="${dir.reports.pdepend}/dependencies.svg" />
            <logger type="overview-pyramid" outfile="${dir.reports.pdepend}/overview-pyramid.svg" />
        </phpdepend>
    </target>

    <!-- Unit tests -->
    <target name="test:unit" description="Executes unit tests.">
        <echo msg="Running unit tests ..." />
        <exec command="phpunit --log-junit ${dir.reports}/phpunit.xml --coverage-clover ${dir.reports.coverage}/clover.xml --coverage-html ${dir.reports.coverage}/ --coverage-crap4j ${dir.reports}/crap4j.xml"/>
    </target>

    <!-- Composer install -->
    <target name="composer" description="Installing composer dependencies">
        <exec executable="composer">
            <arg value="install" />
            <arg value="--dev" />
            <arg value="--prefer-dist" />
            <arg value="--no-progress" />
        </exec>
    </target>

</project>
{'fraction_non_alphanumeric': 0.18382978723404256, 'fraction_numerical': 0.0015805471124620061, 'mean_word_length': 2.472351203039257, 'pattern_counts': {'":': 0, '<': 165, '<?xml version=': 2, '>': 165, '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': '278752', 'n_tokens_mistral': 2397, 'n_tokens_neox': 2295, 'n_words': 474}