All Projects → mamuz → Phpdependencyanalysis

mamuz / Phpdependencyanalysis

Licence: mit
Static code analysis to find violations in a dependency graph

Projects that are alternatives of or similar to Phpdependencyanalysis

App Githooks
Plugin-based system to run specific actions and checks when git hooks are triggered.
Stars: ✭ 5 (-99.01%)
Mutual labels:  code-quality, code-analysis
Pscodehealth
PowerShell module gathering PowerShell code quality and maintainability metrics
Stars: ✭ 104 (-79.41%)
Mutual labels:  code-quality, code-analysis
Pdepend
PHP_Depend is an adaptation of the established Java development tool JDepend. This tool shows you the quality of your design in terms of extensibility, reusability and maintainability.
Stars: ✭ 727 (+43.96%)
Mutual labels:  code-quality, code-analysis
Sonar Kotlin
SonarQube plugin for Kotlin
Stars: ✭ 412 (-18.42%)
Mutual labels:  code-quality, code-analysis
code-assert
Assert that the java code of a project satisfies certain checks.
Stars: ✭ 94 (-81.39%)
Mutual labels:  code-analysis, code-quality
Detekt Intellij Plugin
detekt plugin for IntelliJ
Stars: ✭ 150 (-70.3%)
Mutual labels:  code-quality, code-analysis
Pmd
An extensible multilanguage static code analyzer.
Stars: ✭ 3,667 (+626.14%)
Mutual labels:  code-quality, 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 (-92.87%)
Mutual labels:  code-analysis, code-quality
Pkgnet
R package for analyzing other R packages via graph representations of their dependencies
Stars: ✭ 107 (-78.81%)
Mutual labels:  dependency-graph, code-quality
Htmlhint
⚙️ The static code analysis tool you need for your HTML
Stars: ✭ 2,723 (+439.21%)
Mutual labels:  code-quality, code-analysis
jdepend
A Java package dependency analyzer that generates design quality metrics.
Stars: ✭ 13 (-97.43%)
Mutual labels:  code-analysis, code-quality
Wotan
Pluggable TypeScript and JavaScript linter
Stars: ✭ 271 (-46.34%)
Mutual labels:  code-quality, code-analysis
Detekt
Static code analysis for Kotlin
Stars: ✭ 4,169 (+725.54%)
Mutual labels:  code-quality
Sidekiq Superworker
Directed acyclic graphs of Sidekiq jobs
Stars: ✭ 419 (-17.03%)
Mutual labels:  dependency-graph
Git Cop
DEPRECATED: Use Git Lint (https://www.alchemists.io/projects/git-lint) instead.
Stars: ✭ 352 (-30.3%)
Mutual labels:  code-quality
Ctags
A maintained ctags implementation
Stars: ✭ 4,768 (+844.16%)
Mutual labels:  code-analysis
Grumphp
Submitting bugs and feature requests
Stars: ✭ 3,679 (+628.51%)
Mutual labels:  code-quality
Statoscope
Analyzes webpack stats and shows detailed info about it on the screen.
Stars: ✭ 322 (-36.24%)
Mutual labels:  dependency-graph
Jsinspect
Detect copy-pasted and structurally similar code
Stars: ✭ 3,379 (+569.11%)
Mutual labels:  code-analysis
Sonar Dotnet
Code analyzer for C# and VB.NET projects https://redirect.sonarsource.com/plugins/vbnet.html
Stars: ✭ 466 (-7.72%)
Mutual labels:  code-quality

PhpDependencyAnalysis

Author Build Status Latest Stable Version Total Downloads License

PhpDependencyAnalysis is an extendable static code analysis for object-oriented PHP-Projects to generate dependency graphs from abstract datatypes (Classes, Interfaces and Traits) based on namespaces. Dependencies can be aggregated to build graphs for several levels, like Package-Level or Layer-Level. Each dependency can be verified to a defined architecture.

Read the Introduction-Chapter for further informations.

Example

See more examples.

Installation

As a Docker Image (recommend way)

docker pull mamuz/phpda

As a Composer Dependency

NOTE: For graph creation GraphViz is required on your machine, which is an open source graph visualization software and available for the most platforms.

$ composer require --dev mamuz/php-dependency-analysis

As a Phar

Since version 2.0.0 not supported anymore.

Features

  • High customizing level
  • Graph creation on customized levels respectively different scopes and layers
  • Supports Usage-Graph, Call-Graph and Inheritance-Graph
  • Dependencies can be aggregated such as to a package, a module or a layer
  • Detecting cycles and violations between layers in a tiered architecture
  • Verifiying dependency graph against a user-defined reference architecture
  • Collected namespaces of dependencies are modifiable to meet custom use cases
  • Printing graphs in several formats (HTML, SVG, DOT, JSON)
  • Extandable by adding user-defined plugins for collecting and displaying
  • Compatible to PHP7 Features, like Return Type Declarations and Anonymous Classes

Usage

Phpda can run out of the box by using a prepared configuration. As you can see configuration is defined by a YAML file.

To provide your own configuration create a yml file, e.g. located in ./phpda.yml:

mode: 'usage'
source: './src'
filePattern: '*.php'
ignore: 'tests'
formatter: 'PhpDA\Writer\Strategy\Svg'
target: './phpda.svg'
groupLength: 1
visitor:
  - PhpDA\Parser\Visitor\TagCollector
  - PhpDA\Parser\Visitor\SuperglobalCollector
visitorOptions:
  PhpDA\Parser\Visitor\Required\DeclaredNamespaceCollector: {minDepth: 2, sliceLength: 2}
  PhpDA\Parser\Visitor\Required\MetaNamespaceCollector: {minDepth: 2, sliceLength: 2}
  PhpDA\Parser\Visitor\Required\UsedNamespaceCollector: {minDepth: 2, sliceLength: 2}
  PhpDA\Parser\Visitor\TagCollector: {minDepth: 2, sliceLength: 2}

Perform an analysis with that configuration:

$ docker run --rm -v $PWD:/app mamuz/phpda

Read the Configuration-Chapter to get knowledge about all available options.

Wiki

  1. Introduction
  2. Requirements
  3. Configuration
  4. Examples
  5. Plugins

Code of Conduct

As contributors and maintainers of this project you have to respect the Code of Coduct

Changelog

See record of changes made to this project here

Contributing

Before opening up a pull-request please read the Contributing-Guideline

Alternatives

Check the resources in Satic Analysis Section at Awesome PHP

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].