theseer / phpdox

Documentation generator for PHP Code using standard technology (SRC, DOCBLOCK, XML and XSLT)
http://phpdox.de
Other
600 stars 121 forks source link

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

Open neradp opened 5 years ago

neradp commented 5 years ago

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.

theseer commented 5 years ago

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.

neradp commented 5 years ago

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 commented 5 years ago

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.

theseer commented 5 years ago

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

image

neradp commented 5 years ago

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

neradp commented 5 years ago

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 commented 5 years ago

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

theseer commented 5 years ago

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

theseer commented 5 years ago

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

neradp commented 5 years ago

Yes it is persists for me :( `<?xml version="1.0" encoding="UTF-8"?>

xml version="1.0" encoding="UTF-8"?> Missing short description in doc comment Expected "integer" but found "int" for @var tag in member variable comment Missing short description in doc comment Missing short description in doc comment Missing short description in doc comment Missing short description in doc comment Missing parameter comment Missing parameter comment Missing parameter comment Missing parameter comment xml version="1.0" encoding="UTF-8"?> Missing parameter comment Missing parameter comment Missing parameter comment Missing parameter comment Missing short description in doc comment xml version="1.0" encoding="UTF-8"?> Missing short description in doc comment Missing short description in doc comment Missing parameter comment xml version="1.0" encoding="UTF-8"?> Missing short description in doc comment Missing parameter comment Missing parameter comment Missing parameter comment Missing parameter comment Missing short description in doc comment xml version="1.0" encoding="UTF-8"?> Missing short description in doc comment Missing short description in doc comment xml version="1.0" encoding="UTF-8"?> Missing short description in doc comment Missing short description in doc comment Missing short description in doc comment Missing parameter comment xml version="1.0" encoding="UTF-8"?> Missing short description in doc comment Missing short description in doc comment Missing short description in doc comment Missing short description in doc comment Missing short description in doc comment Missing short description in doc comment Missing short description in doc comment Missing short description in doc comment Missing short description in doc comment ` 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`
HurtMarley commented 5 years ago

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" ?>

` PhpUnit XML ` tests/Feature/LoginTest.php tests/Feature/LoginMobileTest.php tests/Unit/BaseModelTest.php tests/Unit/HelpersTest.php tests/Unit/RoleTest.php /var/www/html/StuffGest.v5/app ` Have you got an idea? Thank you Regadrs
BenPls commented 4 years ago

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 !

theseer commented 4 years ago

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