phpdox icon indicating copy to clipboard operation
phpdox copied to clipboard

Enriches phpcs|checkstyle, phpunit, pmd are not working for me ..

Open neradp opened this issue 7 years ago • 13 comments
trafficstars

Im using php 7.2.9, xdebug 2.6.1, phpdox 1.11.2, phpunit 7.3.5, phpcs 3.3.1, phpmd 2.6.0 Runnig phpdox give me no errors... There is no output from those enriches.

Look at https://github.com/neradp/SNPClient, config file is phpdox.xml, in build directory are generated xml files, in doc directory is generated html.

neradp avatar Sep 24 '18 10:09 neradp

The most likely reason for nothing showing up is a mismatch on the file paths within the respective report files.

I just gave it a quick check and saw you use phpcs 3's option to set the basepath for the phpcs.xml report. Since phpDox expects a full path, the entry is most likely not found - which is not reported as of course not all files will have an entry so not finding an entry is a valid case. Try removing that option and run phpcs and phpdox again.

The phpmd file is - except for two errors on parsing - empty for me. phpDox doesn't handle these general errors atm.

I'll check on the PHPUnit tomorrow but expect a similar reason even though it wasn't as obvious to me right away.

theseer avatar Sep 24 '18 21:09 theseer

Commad phpcs --report=xml is showing report on the screen. Command phpcs --report=xml --report-file=build/phpcs.xml save the report on the given path.

Configuration for phpdox

<generator output="${basedir}/docs/api">
            <enrich base="${basedir}/build">
                <source type="phpcs">
                    <file name="phpcs.xml" />
                </source>

is showing where the report file is located: $(basedir)/build/phpcs.xml

This is same and working for phploc enricher !!

Where enricher look for report file and what is recommended file name for report ? In the root of project i Have phpcs.xml, which is configuration file ..This is problem ?

I do not understood your explanation about phpcs report file 👎

neradp avatar Sep 25 '18 05:09 neradp

ok i found it. I have hanged configuration file phpcs.xml by commenting line: <arg name="basepath" value="."/> Now generated report contains full path to source files. No change in generated doc by phpdox.

neradp avatar Sep 25 '18 08:09 neradp

After rerunning phpdox with a phpcs output containing full paths, it works for me:

image

theseer avatar Sep 25 '18 08:09 theseer

Maybe the same bug as #323.. Im on windows 10. Maybe this also afects phpunit enricher.

neradp avatar Sep 25 '18 09:09 neradp

With the solution from #323 i have got phpcs enricher to working state.. I patched pmd enricher too but without success... I builded phpmd from sources to get it work with php72.. so xml maybe corrected now.. No ideas how to update phpunit enricher :( Sorry for my bad english ..

neradp avatar Sep 25 '18 16:09 neradp

oouh no... some errors are not generated on pages...

neradp avatar Sep 25 '18 16:09 neradp

I'll debug this further next week. Thanks for the efforts already.

theseer avatar Sep 25 '18 20:09 theseer

@neradp Can you verify if the problem persists with the current master?

theseer avatar Feb 02 '19 01:02 theseer

Yes it is persists for me :( <?xml version="1.0" encoding="UTF-8"?> <phpcs version="3.4.0"> xml version="1.0" encoding="UTF-8"?> <file name="C:\Users\peter\Projects\SNPClient\src\bTd\SNP\Client\Client.php" errors="10" warnings="0" fixable="1"> <error line="26" column="5" source="Generic.Commenting.DocComment.MissingShort" severity="5" fixable="0">Missing short description in doc comment</error> <error line="27" column="8" source="Squiz.Commenting.VariableComment.IncorrectVarType" severity="5" fixable="1">Expected &quot;integer&quot; but found &quot;int&quot; for @var tag in member variable comment</error> <error line="30" column="5" source="Generic.Commenting.DocComment.MissingShort" severity="5" fixable="0">Missing short description in doc comment</error> <error line="34" column="5" source="Generic.Commenting.DocComment.MissingShort" severity="5" fixable="0">Missing short description in doc comment</error> <error line="38" column="5" source="Generic.Commenting.DocComment.MissingShort" severity="5" fixable="0">Missing short description in doc comment</error> <error line="42" column="5" source="Generic.Commenting.DocComment.MissingShort" severity="5" fixable="0">Missing short description in doc comment</error> <error line="130" column="8" source="PEAR.Commenting.FunctionComment.MissingParamComment" severity="5" fixable="0">Missing parameter comment</error> <error line="152" column="8" source="PEAR.Commenting.FunctionComment.MissingParamComment" severity="5" fixable="0">Missing parameter comment</error> <error line="172" column="8" source="PEAR.Commenting.FunctionComment.MissingParamComment" severity="1" fixable="0">Missing parameter comment</error> <error line="190" column="8" source="PEAR.Commenting.FunctionComment.MissingParamComment" severity="5" fixable="0">Missing parameter comment</error> </file> xml version="1.0" encoding="UTF-8"?> <file name="C:\Users\peter\Projects\SNPClient\src\bTd\SNP\Protocol\Message\Request\RegisterRequest.php" errors="5" warnings="0" fixable="0"> <error line="28" column="8" source="PEAR.Commenting.FunctionComment.MissingParamComment" severity="5" fixable="0">Missing parameter comment</error> <error line="29" column="8" source="PEAR.Commenting.FunctionComment.MissingParamComment" severity="5" fixable="0">Missing parameter comment</error> <error line="30" column="8" source="PEAR.Commenting.FunctionComment.MissingParamComment" severity="5" fixable="0">Missing parameter comment</error> <error line="31" column="8" source="PEAR.Commenting.FunctionComment.MissingParamComment" severity="5" fixable="0">Missing parameter comment</error> <error line="45" column="5" source="Generic.Commenting.DocComment.MissingShort" severity="5" fixable="0">Missing short description in doc comment</error> </file> xml version="1.0" encoding="UTF-8"?> <file name="C:\Users\peter\Projects\SNPClient\src\bTd\SNP\Protocol\Message\Request.php" errors="3" warnings="0" fixable="0"> <error line="27" column="5" source="Generic.Commenting.DocComment.MissingShort" severity="5" fixable="0">Missing short description in doc comment</error> <error line="33" column="5" source="Generic.Commenting.DocComment.MissingShort" severity="5" fixable="0">Missing short description in doc comment</error> <error line="78" column="8" source="PEAR.Commenting.FunctionComment.MissingParamComment" severity="5" fixable="0">Missing parameter comment</error> </file> xml version="1.0" encoding="UTF-8"?> <file name="C:\Users\peter\Projects\SNPClient\src\bTd\SNP\Protocol\Message\Response\ErrorResponseException.php" errors="6" warnings="0" fixable="0"> <error line="22" column="5" source="Generic.Commenting.DocComment.MissingShort" severity="5" fixable="0">Missing short description in doc comment</error> <error line="31" column="8" source="PEAR.Commenting.FunctionComment.MissingParamComment" severity="5" fixable="0">Missing parameter comment</error> <error line="32" column="8" source="PEAR.Commenting.FunctionComment.MissingParamComment" severity="5" fixable="0">Missing parameter comment</error> <error line="33" column="8" source="PEAR.Commenting.FunctionComment.MissingParamComment" severity="5" fixable="0">Missing parameter comment</error> <error line="34" column="8" source="PEAR.Commenting.FunctionComment.MissingParamComment" severity="5" fixable="0">Missing parameter comment</error> <error line="44" column="5" source="Generic.Commenting.DocComment.MissingShort" severity="5" fixable="0">Missing short description in doc comment</error> </file> xml version="1.0" encoding="UTF-8"?> <file name="C:\Users\peter\Projects\SNPClient\src\bTd\SNP\Protocol\Message\Response.php" errors="2" warnings="0" fixable="0"> <error line="52" column="5" source="Generic.Commenting.DocComment.MissingShort" severity="5" fixable="0">Missing short description in doc comment</error> <error line="68" column="5" source="Generic.Commenting.DocComment.MissingShort" severity="5" fixable="0">Missing short description in doc comment</error> </file> xml version="1.0" encoding="UTF-8"?> <file name="C:\Users\peter\Projects\SNPClient\src\bTd\SNP\Protocol\Message.php" errors="4" warnings="0" fixable="0"> <error line="22" column="5" source="Generic.Commenting.DocComment.MissingShort" severity="5" fixable="0">Missing short description in doc comment</error> <error line="26" column="5" source="Generic.Commenting.DocComment.MissingShort" severity="5" fixable="0">Missing short description in doc comment</error> <error line="30" column="5" source="Generic.Commenting.DocComment.MissingShort" severity="5" fixable="0">Missing short description in doc comment</error> <error line="51" column="8" source="PEAR.Commenting.FunctionComment.MissingParamComment" severity="5" fixable="0">Missing parameter comment</error> </file> xml version="1.0" encoding="UTF-8"?> <file name="C:\Users\peter\Projects\SNPClient\src\bTd\SNP\Protocol\Protocol.php" errors="9" warnings="0" fixable="0"> <error line="20" column="5" source="Generic.Commenting.DocComment.MissingShort" severity="5" fixable="0">Missing short description in doc comment</error> <error line="25" column="5" source="Generic.Commenting.DocComment.MissingShort" severity="5" fixable="0">Missing short description in doc comment</error> <error line="30" column="5" source="Generic.Commenting.DocComment.MissingShort" severity="5" fixable="0">Missing short description in doc comment</error> <error line="35" column="5" source="Generic.Commenting.DocComment.MissingShort" severity="5" fixable="0">Missing short description in doc comment</error> <error line="40" column="5" source="Generic.Commenting.DocComment.MissingShort" severity="5" fixable="0">Missing short description in doc comment</error> <error line="45" column="5" source="Generic.Commenting.DocComment.MissingShort" severity="5" fixable="0">Missing short description in doc comment</error> <error line="50" column="5" source="Generic.Commenting.DocComment.MissingShort" severity="5" fixable="0">Missing short description in doc comment</error> <error line="55" column="5" source="Generic.Commenting.DocComment.MissingShort" severity="5" fixable="0">Missing short description in doc comment</error> <error line="60" column="5" source="Generic.Commenting.DocComment.MissingShort" severity="5" fixable="0">Missing short description in doc comment</error> </file> </phpcs>

No output from phpcs or checkstyle enriches ..

`[10.02.2019 - 12:11:46] Using config file './phpdox.xml' [10.02.2019 - 12:11:46] Registered collector backend 'parser' [10.02.2019 - 12:11:46] Registered enricher 'build' [10.02.2019 - 12:11:46] Registered enricher 'git' [10.02.2019 - 12:11:46] Registered enricher 'checkstyle' [10.02.2019 - 12:11:46] Registered enricher 'phpcs' [10.02.2019 - 12:11:46] Registered enricher 'pmd' [10.02.2019 - 12:11:46] Registered enricher 'phpunit' [10.02.2019 - 12:11:46] Registered enricher 'phploc' [10.02.2019 - 12:11:46] Registered output engine 'xml' [10.02.2019 - 12:11:46] Registered output engine 'html' [10.02.2019 - 12:11:46] Starting to process project 'SNPClient' [10.02.2019 - 12:11:46] Configuration change detected - cleaning cache [10.02.2019 - 12:11:46] Starting collector [10.02.2019 - 12:11:46] Scanning directory 'C:/Users/peter/Projects/SNPClient/src' for files to process

......... [9]

[10.02.2019 - 12:11:46] Saving results to directory 'C:/Users/peter/Projects/SNPClient/build/api/xml' [10.02.2019 - 12:11:46] Resolving inheritance

......... [9]

[10.02.2019 - 12:11:46] Collector process completed

[10.02.2019 - 12:11:46] Starting generator [10.02.2019 - 12:11:46] Loading enrichers [10.02.2019 - 12:11:46] Enricher PHPCS XML initialized successfully [10.02.2019 - 12:11:46] Enricher Build Information initialized successfully [10.02.2019 - 12:11:46] Starting event loop.

.................................................. [50] .................................................. [100] .................................................. [150] ..... [155]

[10.02.2019 - 12:11:47] Generator process completed [10.02.2019 - 12:11:47] Processing project 'SNPClient' completed.

Time: 867 ms, Memory: 10.00MB

Script phpdox handling the doc event returned with error code 255`

neradp avatar Feb 10 '19 11:02 neradp

Hello,

php 7.3 phpDox 0.12 (phar) phpUnit 8.2.1

I'm facing a similar issue some enricher are working (phpLOC & phpMD) but phpUnit & phpCS are not working. I tried to declare the complete path but the coverage information remains 'EMPTY' in phpDox. According to phpUnit coverage in 100% on my project

phpDox XML <?xml version="1.0" encoding="utf-8" ?> <phpdox xmlns="http://xml.phpdox.net/config" silent="false"> <project name="StuffGest" source="${basedir}/app" workdir="${basedir}/documentation/doc/phpDox/xml"> <collector backend="parser" > </collector> <generator output="${basedir}/documentation/doc/phpDox"> <enrich base="${basedir}/documentation/config/enrich"> <source type="pmd"> <file name="phpMD.xml" /> </source> <source type="phploc"> <file name="phpLoc.xml" /> </source> <source type="phpcs"> <file name="phpCS.xml" /> </source> <source type="phpunit"> <coverage path="coverage/xml" /> </source> </enrich> <build engine="html" enabled="true" output="html"> <file extension="html" /> </build> <build engine="xml" enabled="true" output="xml" /> </generator> </project> </phpdox>

PhpUnit XML <?xml version="1.0" encoding="UTF-8"?> <phpunit backupGlobals="false" backupStaticAttributes="false" bootstrap="vendor/autoload.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false"> <testsuites> <testsuite name="Feature"> <!--<directory suffix="Test.php">./tests/Feature</directory>--> <file>tests/Feature/LoginTest.php</file> <file>tests/Feature/LoginMobileTest.php</file> </testsuite> <testsuite name="Unit"> <!--<directory suffix="Test.php">./tests/Unit</directory>--> <file>tests/Unit/BaseModelTest.php</file> <file>tests/Unit/HelpersTest.php</file> <file>tests/Unit/RoleTest.php</file> </testsuite> </testsuites> <filter> <whitelist processUncoveredFilesFromWhitelist="true"> <directory suffix=".php">/var/www/html/StuffGest.v5/app</directory> </whitelist> </filter> <php> <env name="APP_ENV" value="testing"/> <env name="CACHE_DRIVER" value="array"/> <env name="SESSION_DRIVER" value="array"/> <env name="QUEUE_DRIVER" value="sync"/> <env name="DB_CONNECTION" value="sqlite_testing"/> </php> <logging> <log type="coverage-html" target="documentation/tests/coverage/html" lowUpperBound="35" highLowerBound="70"/> <log type="coverage-xml" target="documentation/config/enrich/coverage/xml" /> </logging> </phpunit>

Have you got an idea?

Thank you

Regadrs

HurtMarley avatar Jul 01 '19 13:07 HurtMarley

I had the same issue with phpDox 0.12 (via composer).

This version has not the change of the PHPUnit namespace in the template files: still "http". I used "dev-master" version and everything showed up.

@theseer Will you release a version including the changes in the template files? Thanks !

BenPls avatar Jan 13 '20 10:01 BenPls

Yes, I will. There are a few PRs still pending that I'd like to have included but need to review and merge first.

theseer avatar Jan 13 '20 10:01 theseer