Test::LocalFunctions::PPI - Detects unused local functions by PPI
# check modules that are listed in MANIFEST use Test::LocalFunctions::PPI; use Test::More; all_local_functions_ok(); done_testing; # you can also specify individual file use Test::LocalFunctions::PPI; use Test::More; local_functions_ok('/path/to/your/module_or_script'); done_testing;
Test::LocalFunctions::PPI finds unused local functions to clean up the source code. (Local function means the function which name starts from underscore.)
This module uses PPI as lexical analyzer.
all_local_functions_ok
This is a test function which finds unused variables from modules that are listed in MANIFEST file.
local_functions_ok
This is a test function which finds unused variables from specified source code. This function requires an argument which is the path to source file.
PPI (version 1.215 or later)
Sub::Identify (version 0.04 or later)
Test::Builder::Module (version 0.98 or later)
Test::Builder::Tester (version 1.22 or later)
Test::LocalFunctions
Test::LocalFunctions::Fast
To install Test::LocalFunctions, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::LocalFunctions
CPAN shell
perl -MCPAN -e shell install Test::LocalFunctions
For more information on module installation, please visit the detailed CPAN module installation guide.