{"id":23036863,"url":"https://github.com/degraciamathieu/php-git-insights-analyzer","last_synced_at":"2025-10-14T20:10:58.058Z","repository":{"id":220783755,"uuid":"752273439","full_name":"DeGraciaMathieu/php-git-insights-analyzer","owner":"DeGraciaMathieu","description":"Analyze the Git history of your PHP files","archived":false,"fork":false,"pushed_at":"2024-02-09T06:33:41.000Z","size":18781,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-13T13:41:33.887Z","etag":null,"topics":["php","repository-mining","static-analyzer","technical-debt"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DeGraciaMathieu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-03T14:51:19.000Z","updated_at":"2024-03-17T10:47:24.000Z","dependencies_parsed_at":"2024-02-04T10:43:09.432Z","dependency_job_id":null,"html_url":"https://github.com/DeGraciaMathieu/php-git-insights-analyzer","commit_stats":null,"previous_names":["degraciamathieu/php-git-insights-analyzer"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeGraciaMathieu%2Fphp-git-insights-analyzer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeGraciaMathieu%2Fphp-git-insights-analyzer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeGraciaMathieu%2Fphp-git-insights-analyzer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeGraciaMathieu%2Fphp-git-insights-analyzer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DeGraciaMathieu","download_url":"https://codeload.github.com/DeGraciaMathieu/php-git-insights-analyzer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229851250,"owners_count":18134184,"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":["php","repository-mining","static-analyzer","technical-debt"],"created_at":"2024-12-15T17:27:57.016Z","updated_at":"2025-10-14T20:10:53.025Z","avatar_url":"https://github.com/DeGraciaMathieu.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/DeGraciaMathieu/php-smelly-code-detector/blob/master/arts/robot.png\" width=\"250\"\u003e\n\u003c/p\u003e\n\n# php-git-insights-analyzer\n\n## Phar\nThis tool is distributed as a [PHP Archive (PHAR)](https://www.php.net/phar):\n\n```\nwget https://github.com/DeGraciaMathieu/php-git-insights-analyzer/raw/master/builds/php-git-insights-analyzer\n```\n\n```\nphp php-git-insights-analyzer --version\n```\n\n## Usage\n\nFirst, you need to load the data required for the analysis :\n\n```\nphp php-git-insights-analyzer app:load\n```\n\nPackage uses git commands to retrieve files history, which is relatively time-consuming, so it was more efficient to create a database before carrying out the analyses.\n\n\u003e For information, database is stored in the analyse.json\n\nThen analyse the data using the following command :\n\n```\nphp php-git-insights-analyzer app:report\n```\n\n```\n$ php php-git-insights-analyzer app:report\n\n ❀ PHP Git Insights Analyzer ❀\n\n ┌─────────────────────────────────────────────┬───────┬───────┬───────┬─────┬──────┬─────┬──────┐\n │ name                                        │ lines │ comm. │ cont. │ acs │ acsr │ wpc │ wpcr │\n ├─────────────────────────────────────────────┼───────┼───────┼───────┼─────┼──────┼─────┼──────┤\n │ Actions/GameAndRandomClipsSample.php        │ 55    │ 2     │ 1     │ 27  │ 49   │ 55  │ 100  │\n │ Console/Kernel.php                          │ 27    │ 1     │ 1     │ 27  │ 100  │ 27  │ 100  │\n │ Dtos/Uuid.php                               │ 37    │ 3     │ 1     │ 12  │ 32   │ 37  │ 100  │\n │ Enums/AutoplayEnum.php                      │ 9     │ 1     │ 1     │ 9   │ 100  │ 9   │ 100  │\n │ Enums/ClipStateEnum.php                     │ 15    │ 2     │ 1     │ 7   │ 46   │ 15  │ 100  │\n │ Exceptions/AssertException.php              │ 10    │ 1     │ 1     │ 10  │ 100  │ 10  │ 100  │\n │ Exceptions/Handler.php                      │ 35    │ 4     │ 1     │ 8   │ 22   │ 35  │ 100  │\n │ Http/Controllers/Controller.php             │ 12    │ 1     │ 1     │ 12  │ 100  │ 12  │ 100  │\n │ Http/Controllers/HomeController.php         │ 37    │ 9     │ 2     │ 4   │ 10   │ 18  │ 48   │\n │ Http/Controllers/PaginateClipController.php │ 48    │ 8     │ 2     │ 6   │ 12   │ 24  │ 50   │\n └─────────────────────────────────────────────┴───────┴───────┴───────┴─────┴──────┴─────┴──────┘\n```\n\nUnderstanding analysis :\n\n| Abbreviation | Metric                         | Description                                                                    |\n| ------------ | ------------------------------ | ------------------------------------------------------------------------------ |\n| comm.        | Commits                        | Number of file commits.                                                        |\n| cont.        | Contributors                   | Number of distinct contributors.                                               |\n| acs          | Average Commit Size            | Average size of file commits.                                                  |\n| acsr         | Average Commit Size Ratio      | Proportion of average commit size compared to the total file size.             |\n| wpc          | Workload Per Contributor       | Average size of a contributor's commits.                                       |\n| wpcr         | Workload Per Contributor Ratio | Proportion of average contributor commit size compared to the total file size. |\n\n## Options\n\n| Options               | Description |\n|-----------------------|-------------|\n| --folder=             | Filter results by folder (e.g., --folder=Http/Controllers).|\n| --limit=              | Specify the maximum number of results to display (default is 10).|\n| --sorts=               | Sets the sorting order for results. The first value (lines, commits, contributors, acs, acsr, wpc, wpcr) corresponds to the affected field, and the second value (desc,asc; default desc) determines the sorting order.|\n| --thresholds=         | Sets a threshold for the specified metric to filter results. The first value (lines, commits, contributors, acs, acsr, wpc, wpcr) corresponds to the affected metric, and the second value (e.g., 60) represents the minimum value required to apply the threshold.|\n\n## Examples\n\nFiles with more than 300 lines and low contributor diversity :\n\n```\nphp php-git-insights-analyzer app:report --limit=10 --thresholds=wpcr,60 --thresholds=lines,300\n```\n\nFiles with more than 10 commits and low contributor diversity :\n\n```\nphp php-git-insights-analyzer app:report --limit=10 --thresholds=wpcr,60 --thresholds=commits,10\n```\n\nFile with more than 10 commits and a renewal ratio of 10% with each commit.\n\n```\nphp php-git-insights-analyzer app:report --limit=10 --thresholds=acsr,10 --thresholds=commits,10\n```\n\n\u003e [!TIP]  \n\u003e Other analysis [tools](https://github.com/DeGraciaMathieu) are available.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdegraciamathieu%2Fphp-git-insights-analyzer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdegraciamathieu%2Fphp-git-insights-analyzer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdegraciamathieu%2Fphp-git-insights-analyzer/lists"}