Maintenance Notes
This picks and describes some tools to help analyze the state of the codebase and support its maintenance.
Analyze churn
The amount of churn, so the number of changes done to a file can be an indicator which files/parts might need refactoring.
To find churn metrics a tool such as Churn can be used:
sh
gem install churn
An example output as of v1.6.0-rc2
would be:
sh
cd src/PX4-Autopilot
churn --start_date "6 months ago"
**********************************************************************
* Revision Changes
**********************************************************************
Files
+------------------------------------------+
| file |
+------------------------------------------+
| src/modules/navigator/mission.cpp |
| src/modules/navigator/navigator_main.cpp |
| src/modules/navigator/rtl.cpp |
+------------------------------------------+
**********************************************************************
* Project Churn
**********************************************************************
Files
+---------------------------------------------------------------------------+---------------+
| file_path | times_changed |
+---------------------------------------------------------------------------+---------------+
| src/modules/mc_pos_control/mc_pos_control_main.cpp | 107 |
| src/modules/commander/commander.cpp | 67 |
| ROMFS/px4fmu_common/init.d/rcS | 52 |
| Makefile | 49 |
| src/drivers/px4fmu/fmu.cpp | 47 |
| ROMFS/px4fmu_common/init.d/rc.sensors | 40 |
| src/drivers/boards/aerofc-v1/board_config.h | 31 |
| src/modules/logger/logger.cpp | 29 |
| src/modules/navigator/navigator_main.cpp | 28 |