<commit_before><?xml version="1.0" encoding="UTF-8"?>

<project name="ExamDB" basedir="." default="build">

    <php expression="include('vendor/autoload.php')"/>

    <property name="sourcedir" value="${project.basedir}/src" />
    <property name="builddir" value="${project.basedir}/build" />
    <property name="vendordir" value="${project.basedir}/vendor" />

    <target name="build"
        depends="prepare,lint,phploc,pdepend,phpmd,phpcs,phpcpd,phpdoc,test,phpcb"/>

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

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

    <target name="prepare" depends="clean"
        description="Prepare for build">
        <mkdir dir="${builddir}/api"/>
        <mkdir dir="${builddir}/code-browser"/>
        <mkdir dir="${builddir}/coverage"/>
        <mkdir dir="${builddir}/logs"/>
        <mkdir dir="${builddir}/pdepend"/>
        <!-- set the permission on cache and logs-->
        <exec command="chmod -R 777 ${sourcedir}/cache"/>
        <exec command="chmod -R 777 ${sourcedir}/logs"/>
    </target>

    <target name="lint">
        <phplint haltonfailure="true" cachefile="${builddir}/lint.cache">
            <fileset dir="${sourcedir}">
                <include name="**/*.php" />
            </fileset>
        </phplint>
    </target>

    <target name="phploc" description="Measure project size using PHPLOC">
        <exec executable="phploc">
            <arg value="--log-csv" />
            <arg value="${builddir}/logs/phploc.csv" />
            <arg path="${sourcedir}" />
        </exec>
    </target>

    <target name="pdepend"
        description="Calculate software metrics using PHP_Depend">
        <phpdepend>
            <fileset dir="${sourcedir}">
                <include name="**/*.php" />
            </fileset>
            <logger type="jdepend-xml" outfile="${builddir}/logs/jdepend.xml" />
            <logger type="jdepend-chart" outfile="${builddir}/pdepend/dependencies.svg" />
            <logger type="overview-pyramid" outfile="${builddir}/pdepend/overview-pyramid.svg" />
        </phpdepend>
    </target>

    <target name="phpmd"
        description="Perform project mess detection using PHPMD and print human readable output. Intended for usage on the command line before committing.">
        <phpmd rulesets="codesize,unusedcode">
            <fileset dir="${sourcedir}">
                <include name="**/*.php" /><commit_msg>Use php for lint<commit_after><?xml version="1.0" encoding="UTF-8"?>

<project name="ExamDB" basedir="." default="build">

    <php expression="include('vendor/autoload.php')"/>

    <property name="sourcedir" value="${project.basedir}/src" />
    <property name="builddir" value="${project.basedir}/build" />
    <property name="vendordir" value="${project.basedir}/vendor" />

    <target name="build"
        depends="prepare,lint,phploc,pdepend,phpmd,phpcs,phpcpd,phpdoc,test,phpcb"/>

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

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

    <target name="prepare" depends="clean"
        description="Prepare for build">
        <mkdir dir="${builddir}/api"/>
        <mkdir dir="${builddir}/code-browser"/>
        <mkdir dir="${builddir}/coverage"/>
        <mkdir dir="${builddir}/logs"/>
        <mkdir dir="${builddir}/pdepend"/>
        <!-- set the permission on cache and logs-->
        <exec command="chmod -R 777 ${sourcedir}/cache"/>
        <exec command="chmod -R 777 ${sourcedir}/logs"/>
    </target>

    <target name="lint">
        <apply executable="php" checkreturn="1">
            <arg value="-l" />

            <fileset dir="${sourcedir}">
                <include name="**/*.php" />
            </fileset>
        </apply>
    </target>

    <target name="phploc" description="Measure project size using PHPLOC">
        <exec executable="phploc">
            <arg value="--log-csv" />
            <arg value="${builddir}/logs/phploc.csv" />
            <arg path="${sourcedir}" />
        </exec>
    </target>

    <target name="pdepend"
        description="Calculate software metrics using PHP_Depend">
        <phpdepend>
            <fileset dir="${sourcedir}">
                <include name="**/*.php" />
            </fileset>
            <logger type="jdepend-xml" outfile="${builddir}/logs/jdepend.xml" />
            <logger type="jdepend-chart" outfile="${builddir}/pdepend/dependencies.svg" />
            <logger type="overview-pyramid" outfile="${builddir}/pdepend/overview-pyramid.svg" />
        </phpdepend>
    </target>

    <target name="phpmd"
        description="Perform project mess detection using PHPMD and print human readable output. Intended for usage on the command line before committing.">
        <phpmd rulesets="codesize,unusedcode">
            <fileset dir="${sourcedir}">
                <include name="**/*.php" />
{'fraction_non_alphanumeric': 0.17983254459410267, 'fraction_numerical': 0.003458318165271205, 'mean_word_length': 2.733016304347826, 'pattern_counts': {'":': 0, '<': 110, '<?xml version=': 2, '>': 110, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, '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': '4275549', 'n_tokens_mistral': 1670, 'n_tokens_neox': 1603, 'n_words': 315}