isfett/php-analyzer

Installs: 413

Dependents: 0

Suggesters: 0

Security: 0

Stars: 5

Watchers: 1

Forks: 3

Open Issues: 1

Type:application

1.2.6 2021-08-17 19:50 UTC

This package is auto-updated.

Last update: 2024-10-30 01:31:55 UTC


README

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-styles 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
  • Refactoring-Score (including number of git-commits within a file)
  • Most Used Constants (Order by name or value)
  • IDE-Integration (PHPStorm, IntelliJ)

Contributing

Please see CONTRIBUTING.md for more information.

License

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