PHP Classes

PHP GIT Insights Analyzer: Present report of PHP projects in a Git repository

Recommend this page to a friend!
  Info   View files Documentation   View files View files (46)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-02-27 (18 days ago) RSS 2.0 feedNot enough user ratingsTotal: 18 This week: 1All time: 11,184 This week: 105Up
Version License PHP version Categories
php-git-insights-ana 1.0The PHP License7Project Management, PHP 7
Description 

Author

This package can present reports of PHP projects in a Git repository.

It uses the git command from the command line console to analyze the files and the changes made to those files to elaborate a report.

Currently, the report is outputted to the command line console and can show a list of files with the following:

- The number of lines

- Number of commits

- Number of contributors

- Average Commit Size

- Average Commit Size Ratio

- Workload Per Contributor

- Workload Per Contributor Ratio

Innovation Award
PHP Programming Innovation award nominee
February 2024
Nominee
Vote
Git is a top-rated version control program many experienced developers use to track the changes in their project files.

This package can generate reports about files in projects that use Git to keep track of file changes.

This way, developers can have an overview of the evolution of their project files.

Manuel Lemos
Picture of DeGraciaMathieu
  Performance   Level  
Innovation award
Innovation award
Nominee: 11x

Winner: 1x

 

Documentation

<p align="center"> <img src="https://github.com/DeGraciaMathieu/php-smelly-code-detector/blob/master/arts/robot.png" width="250"> </p>

php-git-insights-analyzer

Phar

This tool is distributed as a PHP Archive (PHAR):

wget https://github.com/DeGraciaMathieu/php-git-insights-analyzer/raw/master/builds/php-git-insights-analyzer

php php-git-insights-analyzer --version

Usage

First, you need to load the data required for the analysis :

php php-git-insights-analyzer app:load

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

> For information, database is stored in the analyse.json

Then analyse the data using the following command :

php php-git-insights-analyzer app:report

$ php php-git-insights-analyzer app:report

 ? PHP Git Insights Analyzer ?

 ?????????????????????????????????????????????????????????????????????????????????????????????????
 ? name                                        ? lines ? comm. ? cont. ? acs ? acsr ? wpc ? wpcr ?
 ?????????????????????????????????????????????????????????????????????????????????????????????????
 ? Actions/GameAndRandomClipsSample.php        ? 55    ? 2     ? 1     ? 27  ? 49   ? 55  ? 100  ?
 ? Console/Kernel.php                          ? 27    ? 1     ? 1     ? 27  ? 100  ? 27  ? 100  ?
 ? Dtos/Uuid.php                               ? 37    ? 3     ? 1     ? 12  ? 32   ? 37  ? 100  ?
 ? Enums/AutoplayEnum.php                      ? 9     ? 1     ? 1     ? 9   ? 100  ? 9   ? 100  ?
 ? Enums/ClipStateEnum.php                     ? 15    ? 2     ? 1     ? 7   ? 46   ? 15  ? 100  ?
 ? Exceptions/AssertException.php              ? 10    ? 1     ? 1     ? 10  ? 100  ? 10  ? 100  ?
 ? Exceptions/Handler.php                      ? 35    ? 4     ? 1     ? 8   ? 22   ? 35  ? 100  ?
 ? Http/Controllers/Controller.php             ? 12    ? 1     ? 1     ? 12  ? 100  ? 12  ? 100  ?
 ? Http/Controllers/HomeController.php         ? 37    ? 9     ? 2     ? 4   ? 10   ? 18  ? 48   ?
 ? Http/Controllers/PaginateClipController.php ? 48    ? 8     ? 2     ? 6   ? 12   ? 24  ? 50   ?
 ?????????????????????????????????????????????????????????????????????????????????????????????????

Understanding analysis :

| Abbreviation | Metric | Description | | ------------ | ------------------------------ | ------------------------------------------------------------------------------ | | comm. | Commits | Number of file commits. | | cont. | Contributors | Number of distinct contributors. | | acs | Average Commit Size | Average size of file commits. | | acsr | Average Commit Size Ratio | Proportion of average commit size compared to the total file size. | | wpc | Workload Per Contributor | Average size of a contributor's commits. | | wpcr | Workload Per Contributor Ratio | Proportion of average contributor commit size compared to the total file size. |

Options

| Options | Description | |-----------------------|-------------| | --folder= | Filter results by folder (e.g., --folder=Http/Controllers).| | --limit= | Specify the maximum number of results to display (default is 10).| | --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.| | --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.|

Examples

Files with more than 300 lines and low contributor diversity :

php php-git-insights-analyzer app:report --limit=10 --thresholds=wpcr,60 --thresholds=lines,300

Files with more than 10 commits and low contributor diversity :

php php-git-insights-analyzer app:report --limit=10 --thresholds=wpcr,60 --thresholds=commits,10

File with more than 10 commits and a renewal ratio of 10% with each commit.

php php-git-insights-analyzer app:report --limit=10 --thresholds=acsr,10 --thresholds=commits,10

> [!TIP] > Other analysis tools are available.


  Files folder image Files  
File Role Description
Files folder imageapp (5 directories)
Files folder imagebootstrap (1 file)
Files folder imageconfig (3 files)
Files folder imagetests (3 files, 2 directories)
Accessible without login Plain text file .editorconfig Data Auxiliary data
Accessible without login Plain text file box.json Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file composer.lock Data Auxiliary data
Plain text file php-git-insights-analyzer Class Class source
Accessible without login Plain text file phpunit.xml.dist Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

 Version Control Unique User Downloads Download Rankings  
 100%
Total:18
This week:1
All time:11,184
This week:105Up