14 Repos
Tools and interfaces for analyzing the structure and metadata of PHP source code.
Distinct from PHP Standard Interface Implementations: No candidate covers general PHP structural analysis; candidates focus on generators, linters, or PSR standards.
Explore 14 awesome GitHub repositories matching programming languages & runtimes · PHP Code Analysis. Refine with filters or upvote what's useful.
PHP-CS-Fixer is a static analysis tool and code style linter designed to validate PHP code against predefined standards. It functions as a coding standard fixer that automatically detects and corrects style violations to ensure consistent formatting across a codebase. The project serves as a syntax modernizer, providing automated tools to update legacy PHP syntax to align with newer language versions. It also allows for the creation of custom style rules when built-in standards do not meet specific requirements. The tool covers broad capability areas including automated linting workflows and
Analyzes PHP source code without execution to identify and fix syntax and styling issues.
ReflectionCommon is a PHP reflection interface library and code analysis abstraction. It serves as a foundation for static analysis by providing a shared specification for representing classes, methods, and properties during programmatic code inspection. The project standardizes the reflection API to decouple analysis tools from specific PHP reflection implementations. This ensures that different analysis implementations can work interchangeably through a consistent layer of interfaces. The library covers the domain of PHP code analysis and static analysis tooling, establishing a common way
Provides a standardized way to analyze PHP source code structures to ensure consistent results across different tools.
php-code-coverage is a PHP library and analysis tool designed to track runtime execution and determine which parts of a codebase are exercised by automated tests. It monitors executed lines and branches during a test run to identify gaps in test coverage and evaluate the effectiveness of a test suite. The tool functions as an execution tracker and report generator that transforms raw PHP execution data into human-readable formats. It serializes collected metrics for storage and utilizes a processing system to calculate the total percentage of code covered. Its capability surface covers the e
Analyzes PHP runtime execution and calculates coverage metrics for source code analysis.
This project is a PHP docblock annotation parser and reflection metadata tool designed to extract structured metadata from doc-comments and convert them into class instances. It functions as a system for retrieving and managing custom metadata attached to classes, methods, and properties. The library includes a metadata caching system to store parsed results, which reduces the performance overhead associated with repeated reflection calls and string parsing. It also serves as a static analysis utility for validating source code structure and enforcing coding standards through automated docblo
Analyzes the structure and metadata of PHP source code to validate structural consistency.
Larastan ist ein statisches Analysetool für PHP und eine spezialisierte Erweiterung für PHPStan. Es dient als Code-Analysator, der Bugs und architektonische Probleme in Laravel-Anwendungen erkennt, ohne den Quellcode auszuführen. Das Projekt bietet framework-spezifische Regelsätze und spezialisierte Typinferenz, um die einzigartigen Muster und die Logik des Laravel-Ökosystems zu handhaben. Dies ermöglicht eine genauere Fehlererkennung und Typüberprüfung als generische Analysetools. Das Tool enthält Systeme zur Verwaltung von technischer Schuld in Legacy-Code durch Error-Baseline-Tracking und regex-basierte Fehlerunterdrückung. Diese Funktionen ermöglichen die Identifizierung neuer Regressionen bei gleichzeitiger Ignorierung bestehender Verstöße.
Performs structural analysis of PHP source code to identify bugs and quality improvements.
Larastan is a static analysis extension and type inference engine for PHP designed to detect bugs and type errors in Laravel applications. It extends PHPStan to resolve framework-specific patterns and magic methods, providing a rule-based scanning engine to audit code quality without executing the application. The tool specializes in Eloquent analysis, verifying that model properties, casts, and relationships align with database schemas and migrations. It tracks types across Eloquent collections, custom builders, and model factories to ensure type safety during database operations and iterati
Scans PHP source code to identify inefficient database queries, unused views, and architectural violations.
php-token-stream is a lexical analysis tool and tokenizer wrapper for PHP. It functions as a source code streamer that reads tokens one by one, preventing the need to load entire source files into memory. The project provides memory-efficient parsing by wrapping the native PHP tokenizer extension. This allows for the sequential processing of source code tokens to analyze structural components and syntax. The tool is designed for static code analysis and the development of compiler tooling. It supports linear token processing and sequential traversal to examine language constructs and project
Analyzes the structure and syntax of PHP source code token by token without loading entire files.
Phan ist ein statischer Analysator und Typ-Prüfer für PHP, der Fehler und Typ-Inkompatibilitäten identifiziert, ohne den Code auszuführen. Er dient als Qualitäts-Gate für Continuous-Integration-Pipelines und als Tool zur Überprüfung der Typsicherheit, wobei er insbesondere Union-Types, Generics und Array-Shapes prüft. Das Projekt zeichnet sich durch die Verwendung eines Hintergrund-Daemons und die Implementierung des Language Server Protocol aus, die Echtzeit-Diagnosen und Navigation innerhalb von Editoren ermöglichen. Es verfügt zudem über ein Baseline-basiertes Unterdrückungssystem, das es Entwicklern erlaubt, bestehende Fehler in einer Snapshot-Datei zu erfassen, um sich ausschließlich auf neue Regressionen zu konzentrieren. Die Analyse-Engine deckt ein breites Spektrum an Funktionen ab, einschließlich der Erkennung von Dead Code, der Validierung der Sprachkompatibilität über verschiedene PHP-Versionen hinweg sowie der Inferenz von Variablen- und Template-Typen. Sie unterstützt erweiterbare Analysen durch ein Plugin-System und bietet automatisierte Code-Korrekturen für eine Teilmenge der erkannten Probleme. Benutzer können den Prozess durch die Generierung einer Konfigurationsdatei mit wählbaren Strengegraden (Strictness Levels) bootstrappen, um ihre Codebasis schrittweise zu validieren.
Identifying unused variables, unreachable code blocks, and redundant conditions to clean up PHP codebases.
PhpInsights ist ein Tool zur statischen Analyse und ein Code-Qualitätsanalysator für PHP. Es bewertet Quellcode, um Fehler, Stilverstöße und technische Schulden zu identifizieren, ohne die Anwendung auszuführen. Das Tool fungiert als Dienstprogramm für Komplexitätsmetriken und berechnet die architektonische und zyklomatische Komplexität, um übermäßig komplizierte Logik zu lokalisieren. Es misst die allgemeine Softwaregesundheit und Wartbarkeit durch den Vergleich von Code mit Industriestandards. Das System verwaltet technische Schulden durch regelbasierte Validierung und metrikgesteuerte Bewertung. Es verwendet eine statische Analyse-Engine, um Quellcode zu parsen, und liefert die Ergebnisse über konsolenbasierte Berichterstattung und eine projektspezifische Konfigurationsdatei.
Analyzes PHP source code for style and complexity issues to identify technical debt without running the application.
Diese Bibliothek ist ein PHP-Quellcode-Tokenizer und ein Tool zur statischen Analyse, das rohen PHP-Code in diskrete Token und strukturierte XML-Repräsentationen umwandelt. Sie fungiert als Serialisierer, der Token-Streams in ein maschinenlesbares Format für die programmatische Analyse und Quellbaum-Manipulation transformiert. Das Projekt verwendet Stream-basierte XML-Serialisierung und Fragment-basiertes Puffer-Schreiben, um den Speicherbedarf bei der Verarbeitung großer Dateien gering zu halten. Es ermöglicht eine benutzerdefinierte XML-Namespace-Konfiguration, um die Schema-Kompatibilität sicherzustellen und Namenskollisionen während des Transformationsprozesses zu vermeiden. Das Toolkit deckt die lexikalische Analyse und die Konvertierung von Quellcode in strukturiertes XML ab, um Workflows zur statischen Codeanalyse zu unterstützen. Es verarbeitet Token-Streams in einem einzigen Durchgang, um flache Quelllisten in eine hierarchische XML-Struktur zu organisieren.
Converts PHP source code into structured XML to enable programmatic analysis and manipulation of the code tree.
Vulture ist ein statisches Analysetool und Linter, das entwickelt wurde, um ungenutzte Variablen, Funktionen und Klassen im Python-Quellcode zu finden. Es arbeitet als Dead-Code-Detektor und Finder für ungenutzten Code, der Quelldateien scannt, um nicht erreichbare Ausdrücke und Importe zu identifizieren, ohne den Code auszuführen. Das Tool verwendet ein konfidenzbasiertes heuristisches Bewertungssystem, um Erkennungen Wahrscheinlichkeitswerte zuzuweisen und so zwischen tatsächlich ungenutzten Symbolen und potenziellen False Positives zu unterscheiden. Es unterstützt zudem das Bereinigen von Dead-Code, indem erkannte ungenutzte Klassen und Funktionen nach Zeilenanzahl sortiert werden, um die Entfernung der größten Codeblöcke zu priorisieren. Die Analyseoberfläche umfasst Control-Flow-Reachability-Analyse, Symbol-Referenz-Tracking und die Möglichkeit, False Positives durch Namensmuster, Decorators oder Ignore-Kommentare zu unterdrücken. Vulture unterstützt zudem die Erstellung und Verwaltung von Whitelists über Mock-Module, um spezifische Elemente von nachfolgenden Scans auszuschließen. Projektweite Analyseregeln und Zielpfade können über Konfigurationsdateien verwaltet werden, einschließlich Unterstützung für das TOML-Format.
Identifies unused functions, classes, and variables in Python source code to reduce technical debt.
phpDocumentor is a PHP API documentation generator and source code analyzer that transforms PHP files and DocBlocks into structured HTML API references. It functions as a static site generator and an automatic documentation tool designed to synchronize technical documentation with code changes. The project distinguishes itself by acting as a UML diagram generator, producing class and architectural graphs via PlantUML based on source analysis. It also supports technical manual authoring, rendering hand-written guides in Markdown and ReStructuredText alongside the automatically generated API re
Parses PHP files to create structured metadata, abstract syntax trees, and visual relationship diagrams of the codebase.
Overcommit is a Git hook manager and pre-commit validation framework designed to automate the execution of scripts and checks during various Git events. It serves as a workflow automation tool that ensures code quality and project standards are met before changes are committed or pushed to a remote repository. The system distinguishes itself through a comprehensive YAML-based configuration that allows for detailed hook behavior control, including file execution filtering, conditional skipping, and the management of hook dependencies. It provides specialized roles such as a commit message vali
Analyzes modified PHP files for errors during the pre-commit phase to prevent broken code.
This library provides a structured framework for managing runtime failures and debugging within PHP applications. It functions by intercepting native language errors, warnings, and system signals, converting them into catchable, object-oriented exceptions to ensure consistent control flow throughout the application lifecycle. The project distinguishes itself by normalizing raw execution backtraces and providing a transformation layer that standardizes how system failures are reported. It includes specialized tools for monitoring the class loading process, ensuring that dependency resolution i
Detects deprecated methods and invalid code structures to ensure long-term stability and adherence to modern standards.