Gives you consolidated views of analysis results.
It give a view like :
Aggregate php analysis metrics
Offer user-friendly interface
Execute quick scan of your project
English or French interfaces
Links with code coverage report
Scoring based on quantity and quality metrics
Enable PhpUnit or Atoum unit tests
Security checker available
It executes
Php Mess Detector
Php Unit Tests
Atoum tests
Php Code Sniffer ( + reparation tool via phpcbf)
Copy-paste detector
Php Depend
Php Loc
And parses their report to give a nice view for rapid analysis of your project.
composer require jdlabails/php-project-analyzer-bundle --dev
add bundle to kernel
/* app/AppKernel.php */public function registerBundles() {// ...$bundles[] = new JDPhpProjectAnalyzerBundleJDPhpProjectAnalyzerBundle();// ...}
Add routing
# app/config/routing.ymlppa:resource: '@JDPhpProjectAnalyzerBundle/Resources/config/routing.yml'
Add security exception
access_control:# PPA- { path: "^(/[a-z]{2})?/ppa(/[a-z]*)?", roles: IS_AUTHENTICATED_ANONYMOUSLY }
Set your config
framework:translator: { fallback: %locale% }jd_php_project_analyzer:title: Php project analyzerdescription: It's a ouaaaouhh project !gitRepositoryURL: https://github.com/jdlabails/PhpProjectAnalyzerBundle# directory to analyzesrcPath : /home/jd/Dev/ppa/src/JD# quantitative metriccount : true# quality metric : copy-pastecpd : true# quality metric : code sniffercs :enable: truestandard: PSR2# security checkersecurity: true# quality metric : phpdependdepend : true# quality metric : phplocloc : true# quality metric : mess detectormd :enable: truerules:cleancode: truecodesize: truecontroversial: truedesign: truenaming: trueunusedcode: true# generate phpdocdocs : true# testingtest :enable: falselib : phpunit # phpunit || atoumphpunitTestSuite : ppa# atoumPath : /home/smith/www/projectX/vendor/bin/atoum# atoumTestDir : /absolute/path/to/your/test/dir# scorescore:enable: truecsWeight: 100 # between 0 and 100, weighting of code sniffertestWeight: 100 # between 0 and 100, weighting of testinglocWeight: 100 # between 0 and 100, weighting of code coverage
Set assets
php app/console assets:install
Set right for ppa directory in the web directory
sudo php app/console ppa:init
Add web/ppa in your .gitignore
Call http://127.0.0.1:8000/en/ppa with your nav.
Click on 'Start Scan'
cd Resources/_phar chmod +x update.sh ./update.sh
ppa:analyse:launch ==> launch analysis without web interface ppa:analyse:read ==> read analysis without web interface. The result is in json
Examples :
avoid phar files for dependencies symfony
refacto code
unit tests
download security checker at each scan
behat
Just make a pull request on master
bin/phpcs --standard=PSR2 --extensions=php Entities Manager Command Controller DependencyInjection Traits
bin/simple-phpunit -c phpunit.xml
Put in your composer.json
"minimum-stability": "dev", "prefer-stable": true, "repositories": [ { "type": "path", "url": "/path/to/your/project/dir/jdlabails-php-project-analyzer-bundle/"} ],