All Projects → wapmorgan → PhpCodeAnalyzer

wapmorgan / PhpCodeAnalyzer

Licence: BSD-3-Clause license
PhpCodeAnalyzer scans codebase and analyzes which non-built-in php extensions used

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to PhpCodeAnalyzer

Eslint Plugin Sonarjs
SonarJS rules for ESLint
Stars: ✭ 458 (+403.3%)
Mutual labels:  static-analysis, code-analysis
Radon
Various code metrics for Python code
Stars: ✭ 1,193 (+1210.99%)
Mutual labels:  static-analysis, code-analysis
Php Language Server
PHP Implementation of the VS Code Language Server Protocol 🆚↔🖥
Stars: ✭ 1,019 (+1019.78%)
Mutual labels:  static-analysis, code-analysis
Wotan
Pluggable TypeScript and JavaScript linter
Stars: ✭ 271 (+197.8%)
Mutual labels:  static-analysis, code-analysis
Bodyclose
Analyzer: checks whether HTTP response body is closed and a re-use of TCP connection is not blocked.
Stars: ✭ 181 (+98.9%)
Mutual labels:  static-analysis, code-analysis
Credo
A static code analysis tool for the Elixir language with a focus on code consistency and teaching.
Stars: ✭ 4,144 (+4453.85%)
Mutual labels:  static-analysis, code-analysis
Spoon
Spoon is a metaprogramming library to analyze and transform Java source code (up to Java 15). 🥄 is made with ❤️, 🍻 and ✨. It parses source files to build a well-designed AST with powerful analysis and transformation API.
Stars: ✭ 1,078 (+1084.62%)
Mutual labels:  static-analysis, code-analysis
Pmd
An extensible multilanguage static code analyzer.
Stars: ✭ 3,667 (+3929.67%)
Mutual labels:  static-analysis, code-analysis
Rubysonar
an advanced semantic indexer for Ruby
Stars: ✭ 175 (+92.31%)
Mutual labels:  static-analysis, code-analysis
Nodejsscan
nodejsscan is a static security code scanner for Node.js applications.
Stars: ✭ 1,874 (+1959.34%)
Mutual labels:  static-analysis, code-analysis
static-code-analysis-plugin
A plugin to simplify Static Code Analysis on Gradle. Not restricted to, but specially useful, in Android projects, by making sure all analysis can access the SDK classes.
Stars: ✭ 36 (-60.44%)
Mutual labels:  static-analysis, code-analysis
Forbidden Apis
Policeman's Forbidden API Checker
Stars: ✭ 216 (+137.36%)
Mutual labels:  static-analysis, code-analysis
Pysonar2
PySonar2: an advanced semantic indexer for Python
Stars: ✭ 1,074 (+1080.22%)
Mutual labels:  static-analysis, code-analysis
Find Sec Bugs
The SpotBugs plugin for security audits of Java web applications and Android applications. (Also work with Kotlin, Groovy and Scala projects)
Stars: ✭ 1,748 (+1820.88%)
Mutual labels:  static-analysis, code-analysis
Spotbugs
SpotBugs is FindBugs' successor. A tool for static analysis to look for bugs in Java code.
Stars: ✭ 2,569 (+2723.08%)
Mutual labels:  static-analysis, code-analysis
swap-detector
A library for detecting swapped arguments in function calls, and a Clang Static Analyzer plugin used to demonstrate the library.
Stars: ✭ 19 (-79.12%)
Mutual labels:  static-analysis, code-analysis
mllint
`mllint` is a command-line utility to evaluate the technical quality of Python Machine Learning (ML) projects by means of static analysis of the project's repository.
Stars: ✭ 67 (-26.37%)
Mutual labels:  static-analysis
deps-infer
Infer mvn deps from sources
Stars: ✭ 36 (-60.44%)
Mutual labels:  static-analysis
awesome-malware-analysis
Defund the Police.
Stars: ✭ 9,181 (+9989.01%)
Mutual labels:  static-analysis
phpstan-nette
Nette Framework class reflection extension for PHPStan & framework-specific rules
Stars: ✭ 87 (-4.4%)
Mutual labels:  static-analysis

PhpCodeAnalyzer

PhpCodeAnalyzer finds usage of different non-built-in extensions in your php code. This tool helps you understand how transportable your code between php installations is.

Latest Stable Version Total Downloads License

TOC

Example of usage

To scan your files or folder launch phpca and pass file or directory names.

> phpca ..\HttpServer
Scanning ..\HttpServer ...
[spl] Function "spl_autoload_register" used in file ..\HttpServer/vendor/composer/ClassLoader.php[258]
[spl] Function "spl_autoload_unregister" used in file ..\HttpServer/vendor/composer/ClassLoader.php[266]
[spl] Function "spl_autoload_register" used in file ..\HttpServer/vendor/composer/autoload_real.php[22]
[spl] Function "spl_autoload_unregister" used in file ..\HttpServer/vendor/composer/autoload_real.php[24]

Used non-built-in extensions in your code:
- [spl] Standard PHP Library (SPL). This extension is bundled with php since PHP 5.0.0. Extension is available in pecl: spl.

You can skip progress with --no-progress option:

> phpca --no-progress ..\yii-1.1.16.bca042\framework\caching
Scanning ..\yii-1.1.16.bca042\framework\caching ...

Used non-built-in extensions in your code:
- [apc] Alternative PHP Cache. Extension is available in pecl: apc.
- [wincache] Windows Cache for PHP. Extension is available in pecl: wincache.

Also, you can keep only progress with --no-report option:

> phpca --no-report ..\yii-1.1.16.bca042\framework\caching
Scanning ..\yii-1.1.16.bca042\framework\caching ...
[apc] Function "apc_fetch" used in file ..\yii-1.1.16.bca042\framework\caching/CApcCache.php[46]
[apc] Function "apc_fetch" used in file ..\yii-1.1.16.bca042\framework\caching/CApcCache.php[56]
[apc] Function "apc_store" used in file ..\yii-1.1.16.bca042\framework\caching/CApcCache.php[70]
[apc] Function "apc_add" used in file ..\yii-1.1.16.bca042\framework\caching/CApcCache.php[84]
[apc] Function "apc_delete" used in file ..\yii-1.1.16.bca042\framework\caching/CApcCache.php[95]
[apc] Function "apc_clear_cache" used in file ..\yii-1.1.16.bca042\framework\caching/CApcCache.php[107]
[apc] Function "apc_clear_cache" used in file ..\yii-1.1.16.bca042\framework\caching/CApcCache.php[109]
[wincache] Function "wincache_ucache_get" used in file ..\yii-1.1.16.bca042\framework\caching/CWinCache.php[46]
[wincache] Function "wincache_ucache_get" used in file ..\yii-1.1.16.bca042\framework\caching/CWinCache.php[56]
[wincache] Function "wincache_ucache_set" used in file ..\yii-1.1.16.bca042\framework\caching/CWinCache.php[70]
[wincache] Function "wincache_ucache_add" used in file ..\yii-1.1.16.bca042\framework\caching/CWinCache.php[84]
[wincache] Function "wincache_ucache_delete" used in file ..\yii-1.1.16.bca042\framework\caching/CWinCache.php[95]
[wincache] Function "wincache_ucache_clear" used in file ..\yii-1.1.16.bca042\framework\caching/CWinCache.php[106]

If you want to see only usage of one specific extension, use --extension= option:

> phpca --extension=apc ..\yii-1.1.16.bca042\framework\caching
Scanning ..\yii-1.1.16.bca042\framework\caching ...
[apc] Function "apc_fetch" used in file ..\yii-1.1.16.bca042\framework\caching/CApcCache.php[46]
[apc] Function "apc_fetch" used in file ..\yii-1.1.16.bca042\framework\caching/CApcCache.php[56]
[apc] Function "apc_store" used in file ..\yii-1.1.16.bca042\framework\caching/CApcCache.php[70]
[apc] Function "apc_add" used in file ..\yii-1.1.16.bca042\framework\caching/CApcCache.php[84]
[apc] Function "apc_delete" used in file ..\yii-1.1.16.bca042\framework\caching/CApcCache.php[95]
[apc] Function "apc_clear_cache" used in file ..\yii-1.1.16.bca042\framework\caching/CApcCache.php[107]
[apc] Function "apc_clear_cache" used in file ..\yii-1.1.16.bca042\framework\caching/CApcCache.php[109]

Summary report in this case will not be added at the end.

Help

Full list of available options:

> phpca -h
PhpCodeAnalyzer
Usage:
    phpca [-v] [-q] [--output=<path>] [--no-report] [--no-progress] [--since-version=<version>] FILES...
    phpca [-v] [-q] [--output=<path>] --extension=<ext> FILES...
    phpca -h

Options:
  -h --help                 Show this text
  -v --verbose              Show more debug text
  -q --quiet                Don't print any messages
  --output=<path>           Path where to generate XML report
  --extension=<ext>         Look for usage a specific extension
  --no-report               Turn off summary report
  --no-progress             Turn off progress
  --since-version=<version> Only include extensions not included since version

Installation

Phar

  1. Just download a phar from releases page and make executable
chmod +x phpca.phar
  1. a. Local installation: use it from current folder:

    ./phpca.phar -h

    b. Global installation: move it in to one of folders listed in your $PATH and run from any folder:

    sudo mv phpca.phar /usr/local/bin/phpca
    phpca -h

Composer

Another way to install phpca is via composer.

  1. Install composer:
curl -sS https://getcomposer.org/installer | php
  1. Install phpcf in global composer dir:
./composer.phar global require wapmorgan/php-code-analyzer dev-master
  1. Run from any folder:
phpca -h
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].