|
| static void | init_errors_cnt () |
| static void | inc_errors_cnt () |
| static int | get_errors_cnt () |
| static void | free_list_func (func_info *data) |
| | Free a func_info structure.
|
| static void | add_predef_varname (GSList **defined_var) |
| | Add keywords to the varnames list.
|
| static gint | list_cmp1 (gconstpointer lelem, gconstpointer data) |
| | This function is called by g_slist_find_custom.
|
| static gint | reverse_search (GSList **def_func_tree, GSList *finfo) |
| | Check if an undefined called function is needed or not. This is the case in which the function is called from a nested and defined function but never called.
|
| static gint | list_cmp (gconstpointer lelem, gconstpointer data) |
| | This function is called by g_slist_find_custom.
|
| static void | check_called_files (gpointer key, gpointer value, GSList **unusedfiles) |
| | This function is called by g_hash_table_foreach to check if an include file was used or not. If the file is not used, it is added to a list.
|
| static void | print_uncall_files (gpointer filename, gpointer lexic) |
| | It shows a msg for unused included files.
|
| static tree_cell * | nasl_lint_def (lex_ctxt *lexic, tree_cell *st, int lint_mode, GHashTable **include_files, GHashTable **func_fnames_tab, gchar *err_fname, GSList **called_funcs, GSList **def_func_tree) |
| | Loads all defined functions. Also, It constructs a tree of called functions to help recognize a not defined function which is never called (nested functions).
|
| static char * | get_argument_by_name (tree_cell *st, char *name) |
| | Checks if a given Arguments is within a given Argument List.
|
| static tree_cell * | validate_script_xref (lex_ctxt *lexic, tree_cell *st) |
| | Validates parameters of a script_xref function call.
|
| static tree_cell * | validate_function (lex_ctxt *lexic, tree_cell *st) |
| | Validate functions.
|
| static int | is_deffunc_used (const char *funcname, const char *filename, GSList *def_func_tree) |
| | Returns 1 if the function is at least used once by another caller than filename otherwise 0.
|
| void | nasl_lint_feature_flags (int flag) |
| static tree_cell * | nasl_lint_call (lex_ctxt *lexic, tree_cell *st, GHashTable **include_files, GHashTable **func_fnames_tab, gchar *err_fname, GSList **called_funcs, GSList **def_func_tree) |
| | Check if a called function was defined.
|
| static tree_cell * | nasl_lint_defvar (lex_ctxt *lexic, tree_cell *st, GHashTable **include_files, GHashTable **func_fnames_tab, gchar *err_fname, GSList **defined_var, GSList **called_funcs) |
| | Consider all cases in which a variable is set, and add it to a list. If a variable is read, it checks if it was previously added to the list.
|
| static tree_cell * | make_call_func_list (lex_ctxt *lexic, tree_cell *st, GSList **called_funcs) |
| | Make a list of all called functions.
|
| static tree_cell * | check_description_block_xref (lex_ctxt *lexic, tree_cell *st) |
| | Sanity check of the script_xref parameters in the description block.
|
| static tree_cell * | check_description_block (lex_ctxt *lexic, tree_cell *st) |
| | Sanity check of the description block.
|
| static tree_cell * | find_description_block (lex_ctxt *lexic, tree_cell *st) |
| | Sanity check of the description block.
|
| tree_cell * | nasl_lint (lex_ctxt *lexic, tree_cell *st) |
| | Search for errors in a nasl script.
|
| tree_cell * nasl_lint_defvar |
( |
lex_ctxt * | lexic, |
|
|
tree_cell * | st, |
|
|
GHashTable ** | include_files, |
|
|
GHashTable ** | func_fnames_tab, |
|
|
gchar * | err_fname, |
|
|
GSList ** | defined_var, |
|
|
GSList ** | called_funcs ) |
|
static |
Consider all cases in which a variable is set, and add it to a list. If a variable is read, it checks if it was previously added to the list.
This checks if a defined function is called. If it is never called it does not go deeper.
It is a local variable and it is added in special list, which will be cleaned at the end of the function.
Leaving the function definition, the local variables list is cleaned.