Skip to content

[READ ONLY - subtree split] The simple CLI tool that helps you to analyze code quality.

Notifications You must be signed in to change notification settings

webiik/cli-analyse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 

Repository files navigation

Analyse

This CLI tool analyses code using preconfigured PHPCS, PHPMD, PHPSTAN, PHPmetrics and SonarCloud. It can help you to write better code and find possible errors.

It's very likely that this tool will find "bugs" in your code. Always investigate these "bugs" and consider a fix. Avoid over-optimization of code, always keep in mind readability and testability.

Installation

composer require --dev webiik/cli-analyse

Usage

analyse

analyse source-dir output-dir

analyse runs code analyses over the source directory and outputs analyses results to the output directory.

bash analyse /private/app/ /private/tmp/analysis/app/

Settings

In brief, command analyse tests code for the PSR-2 standards and PHP strict types. It uses the following settings:

phpmd [source_dir] html cleancode,codesize,design,naming,unusedcode --reportfile [output_dir]/phpmd/index.html
phpcs --standard=PSR2 --report-full=[output_dir]/phpcs/report-full.txt --report-code=[output_dir]/phpcs/report-code.txt [source_dir]
phpstan analyse [source_dir] -l 7 --no-ansi --no-progress | awk '{$1=$1;print}' > [output_dir]/phpstan/result.txt
phpmetrics --report-html=[output_dir]/phpmetrics [source_dir]
sonar-scanner \
-Dsonar.projectKey=[sonar project key] \
-Dsonar.organization=[sonar organization] \
-Dsonar.projectBaseDir=[source_dir] \
-Dsonar.sources=. \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.login=[sonar login]

Resources

About

[READ ONLY - subtree split] The simple CLI tool that helps you to analyze code quality.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages