The "pkgchecker" package is a helper-tool for gretl package developers. "pkgchecker" supports the retrieval of various information from gfn gretl function package files such as: - unused (dead) private functions - number of functions - length of functions - names of input parameters - first-level function dependencies - number of calls of a function by other functions Open TODOs: - detect unused variables/ parameters - detect when assignments to existing variables are not used Please ask questions and report bugs on the gretl mailing list if possible. Alternatively, create an issue ticket on the github repo (see below). Source code and test script(s) can be found here: https://github.com/atecon/pkgchecker The package comprises three public functions. get_pkgdata(filename) --------------------- filename: string, Full path to a gfn file This function consumes a gfn file, compiles various metadata for each function. return: bundle; Each key refers to a function of the package. The value is another bundle comprising the following key-value pairs: code: string holding the code is_private: bool, zero if public function, otherwise one parameter_names: string array holding names of input parameters The bundle structure is as follows: Codes (bundle) |-function_name1 |-code (string) |-is_private (bool) |-parameter_names (string array) |- [Name1, Name2,..., NameN] |-function_name2 |-code (string) |-is_private (bool) |-parameter_names (string array) |- [Name1, Name2,..., NameN] print_pkgsummary(self) ---------------------- self: bundle, Bundle returned by get_pkgdata(). This function prints a summary of the 'self' bundle such as the function name, the number of input parameters and the lines of code. return: nothing function_statistics(self) ------------------------- self: bundle, Bundle returned by get_pkgdata(). This function computes various information, and compiles a bundle including: 'graph': Matrix indicating the first-level dependencies between functions: Value of 1 indicates a relationship, otherwise zero; row-dimension: function called by some other functions; column-dimension: functions actually calling the function. n_function_calls: Vector holding the number of function calls for each of the 'n' total functions dead_functions: string array, Names of private functions not called by other functions return: bundle Change-log: --------- v0.2 (07-2021): - Adapt syntax in sample script to new behavior of the "pkg query" command in case an empty bundle is returned. - Analyse addon "regls" in sample script. v0.1 (01-2021): - initial release