{"id":28121201,"url":"https://github.com/i582/phpstats","last_synced_at":"2025-05-14T07:44:56.256Z","repository":{"id":55929121,"uuid":"304649392","full_name":"i582/phpstats","owner":"i582","description":"CLI Statistics and dependency graphs for PHP","archived":false,"fork":false,"pushed_at":"2020-12-06T16:10:37.000Z","size":3166,"stargazers_count":68,"open_issues_count":4,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-06-19T06:00:23.839Z","etag":null,"topics":["clean-architecture","clean-code","collecting-statistics","complexity","dependency-graphs","go","golang","graphs","hacktoberfest","metrics","php","phpstats","statistics"],"latest_commit_sha":null,"homepage":"https://i582.github.io/phpstats-docs/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/i582.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-16T14:22:31.000Z","updated_at":"2024-04-04T02:06:44.000Z","dependencies_parsed_at":"2022-08-15T09:40:37.407Z","dependency_job_id":null,"html_url":"https://github.com/i582/phpstats","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i582%2Fphpstats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i582%2Fphpstats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i582%2Fphpstats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i582%2Fphpstats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/i582","download_url":"https://codeload.github.com/i582/phpstats/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254097205,"owners_count":22014178,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clean-architecture","clean-code","collecting-statistics","complexity","dependency-graphs","go","golang","graphs","hacktoberfest","metrics","php","phpstats","statistics"],"created_at":"2025-05-14T07:42:25.372Z","updated_at":"2025-05-14T07:44:56.221Z","avatar_url":"https://github.com/i582.png","language":"Go","readme":"![](doc/logo.png)\n\n![Build Status](https://github.com/i582/phpstats/workflows/Go/badge.svg) [![Go Report Card](https://goreportcard.com/badge/github.com/i582/phpstats)](https://goreportcard.com/report/github.com/i582/phpstats) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/i582/phpstats/master/LICENSE) ![](https://img.shields.io/badge/-%3C%3E%20with%20%E2%9D%A4-red)\n\n# phpstats\n\n**PhpStats** is a tool that *collects statistics* for the code of your project and, based on these statistics, *calculates various qualitative metrics* of the code, *builds the necessary graphs*, and also *finds the relationships between symbols* in the system. \n\nIt tries to be fast, at the moment—about **150k lines of code per second** on a MacBook Pro 2019 with Core i5.\n\nThe tool is built on top of [NoVerify](https://github.com/VKCOM/noverify) and written in [Go](https://golang.org/).\n\n**Documentation** for the project [here](https://i582.github.io/phpstats-docs/).\n\n## Table of Contents\n\n* [What is supported?](#what-is-supported)\n  * [Metrics](#code-metrics)\n  * [Graphs](#dependency-graphs)\n  * [Relations](#relations-between-symbols)\n  * [Reachability](#reachability-of-functions)\n  * [Brief project information](#brief-information-about-the-project)\n* [About the project](#about-the-project)\n* [Contacts](#contacts)\n* [Contributing](#contributing)\n* [License](#license)\n\n![](doc/screen.svg)\n\n## What is supported?\n\n**PhpStats** currently represents five areas:\n\n1. Collecting code **metrics**;\n2. Building **dependency graphs**;\n3. Analysis of **relationships between symbols**;\n4. Gathering **brief information** about the project;\n5. Analysis of the **reachability** of a function.\n\nIt also allows you to **view lists** of *classes, interfaces, functions, methods, files and namespaces* in a **tabular form** with the **ability to sort by metrics**.\n\n*Let's look at each point separately.*\n\n### Code metrics\n\n**PhpStats** currently calculates the following metrics:\n\n1. Afferent couplings:\n2. Efferent couplings:\n3. Instability:\n4. Abstractness;\n5. Lack of Cohesion in Methods;\n6. Lack of Cohesion in Methods 4 (*or the number of connected components of the class*);\n7. Cyclomatic Complexity;\n8. Count of magic numbers in functions and methods;\n9. Count fully typed methods.\n\nSee the documentation [part](https://i582.github.io/phpstats-docs/docs/capabilities/metrics/) for details.\n\n### Dependency graphs\n\n**PhpStats** is currently building the following dependency graphs:\n\n1. Class (or interface) dependencies;\n2. Class (interface) extend or implementation dependencies;\n3. Function or method dependencies;\n4. Links within a class (*or graph for the LCOM 4 metric*);\n5. Links between files (*included in global and in functions*);\n6. Namespace dependencies graph;\n7. Namespace structure graph;\n8. Function reachability graph.\n\nSee the documentation [part](https://i582.github.io/phpstats-docs/docs/capabilities/graphs/) for details.\n\n### Relations between symbols\n\n**PhpStats** is currently analyzing the following relations:\n\n1. **For class-class relations:**\n   1. Whether one class is **extends** another and vice versa;\n   2. Whether the class **implements** the interface or vice versa;\n   3. What methods, fields and constants are **used by one class used by another** and in which methods this happens.\n\n2. **For class-function relations:**\n   1. Function **belong** to class;\n   2. The class is **used inside** the function;\n   3. **Used class** members in functions;\n   4. The function is **used in the class** (*+ all methods where this function is used*).\n\n3. **For function-function relations:**\n   1. Functions **belong to the same class**;\n   2. Does the **first function use the second** and vice versa;\n   3. Whether the **first function is reachable from the second through calls** and vice versa (*+ call stacks to reach the function*).\n\nSee the documentation [part](https://i582.github.io/phpstats-docs/docs/capabilities/relations/) for details.\n\n### Reachability of functions\n\nSee the documentation [part](https://i582.github.io/phpstats-docs/docs/capabilities/function_reachability/) for details.\n\n### Brief information about the project\n\nSee the documentation [part](https://i582.github.io/phpstats-docs/docs/capabilities/brief-information/) for details.\n\n## About the project\n\n**PhpStats** is © 2020-2020 by Petr Makhnev.\n\n### Contacts\n\nHave any questions—welcome in telegram: [@petr_makhnev](https://t.me/petr_makhnev).\n\n### Contributing\n\nFeel free to contribute to this project. I am always glad to new people.\n\n### License\n\nPhpStats is distributed by an [MIT license](https://github.com/i582/phpstats/tree/master/LICENSE).","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi582%2Fphpstats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fi582%2Fphpstats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi582%2Fphpstats/lists"}