Skip to content

crowbyte/php-analyzer

 
 

Repository files navigation

Build Status codecov Minimum PHP Version Latest Stable Version Total Downloads

PHP-Analyzer

php-analyzer is a tool designed to help you with different problems.

Mostly I found that I wanted to resolve them while doing my job. For details check the documented commands below.

Installation

Run

$ composer global require isfett/php-analyzer

or download the latest phar from this repository.

Usage

Each command has its own documentation; you can find those in the 'docs' subfolder.

Information

This tool uses a php parser written in php, ignoring different code-style or whitespaces.

Commands

  • Magic Number Detector This command helps to find Magic Numbers in your source code. You can also specify to check only case's inside switch's or default parameter values. You can find many examples in the linked command documentation.
  • Magic String Detector This command helps to find Magic Strings in your source code. You can find many examples in the linked command documentation.
  • Most Used Conditions This command helps to check which conditions are used the most in your project. Just want to check if's? Or ternaries? No problem! You can also use the command to split by logical operators, or split isset functions for each parameter, including post-processing your conditions, flip-checking, etc. You can find many examples in the linked command documentation.

Planned

  • Find Duplicate Code (ignoring codestyle, just checking statements)
  • Find Classes/Functions with the highest cyclomatic complexity
  • Halstead-Metrics
  • Most Used Constants (Order by name or value)
  • IDE-Integration (PHPStorm)

Contributing

Please see CONTRIBUTING.md for more information.

License

The MIT License (MIT). Please see LICENSE for more information.

About

🔍 PHP-Analyzer

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%