statick_tool.plugins.tool package

Module contents

Default tool plugins for statick.

Submodules

statick_tool.plugins.tool.bandit_tool_plugin module

Apply bandit tool and gather results.

class statick_tool.plugins.tool.bandit_tool_plugin.BanditToolPlugin[source]

Bases: statick_tool.tool_plugin.ToolPlugin

Apply bandit tool and gather results.

gather_args(args: argparse.Namespace) → None[source]

Gather arguments.

get_file_types() → List[str][source]

Return a list of file types the plugin can scan.

get_name() → str[source]

Get name of tool.

parse_output(total_output: List[str], package: Optional[statick_tool.package.Package] = None) → List[statick_tool.issue.Issue][source]

Parse tool output and report issues.

process_files(package: statick_tool.package.Package, level: str, files: List[str], user_flags: List[str]) → Optional[List[str]][source]

Run tool and gather output.

statick_tool.plugins.tool.black_tool_plugin module

Apply black tool and gather results.

class statick_tool.plugins.tool.black_tool_plugin.BlackToolPlugin[source]

Bases: statick_tool.tool_plugin.ToolPlugin

Apply black tool and gather results.

get_file_types() → List[str][source]

Return a list of file types the plugin can scan.

get_name() → str[source]

Get name of tool.

parse_output(total_output: List[str], package: Optional[statick_tool.package.Package] = None) → List[statick_tool.issue.Issue][source]

Parse tool output and report issues.

process_files(package: statick_tool.package.Package, level: str, files: List[str], user_flags: List[str]) → Optional[List[str]][source]

Run tool and gather output.

statick_tool.plugins.tool.catkin_lint_tool_plugin module

Apply catkin_lint tool and gather results.

class statick_tool.plugins.tool.catkin_lint_tool_plugin.CatkinLintToolPlugin[source]

Bases: statick_tool.tool_plugin.ToolPlugin

Apply catkin_lint tool and gather results.

classmethod check_for_exceptions_has_file(match: Match[str], package: statick_tool.package.Package) → bool[source]

Manual exceptions.

get_file_types() → List[str][source]

Return a list of file types the plugin can scan.

classmethod get_level(issue_type: str) → str[source]

Get level for given issue type.

get_name() → str[source]

Get name of tool.

parse_output(total_output: List[str], package: Optional[statick_tool.package.Package] = None) → List[statick_tool.issue.Issue][source]

Parse tool output and report issues.

process_files(package: statick_tool.package.Package, level: str, files: List[str], user_flags: List[str]) → Optional[List[str]][source]

Run tool and gather output.

statick_tool.plugins.tool.cccc_tool_plugin module

Apply CCCC tool and gather results.

To run the CCCC tool locally (without Statick) one way to do so is:

find . -name *.h -print -o -name *.cpp -print | xargs cccc

That will generate several reports, including HTML. The results can be viewd in a web browser.

class statick_tool.plugins.tool.cccc_tool_plugin.CCCCToolPlugin[source]

Bases: statick_tool.tool_plugin.ToolPlugin

Apply CCCC tool and gather results.

classmethod convert_name_to_id(name: str) → str[source]

Convert result name to configuration name.

The name given in CCCC results is different than the name given in CCCC configuration. This will map the name in the configuration file to the name given in the results.

find_issues(config: Dict[Any, Any], results: Dict[Any, Any], src: str) → List[statick_tool.issue.Issue][source]

Identify issues by comparing tool results with tool configuration.

gather_args(args: argparse.Namespace) → None[source]

Gather arguments.

get_name() → str[source]

Get name of tool.

classmethod parse_config(config_file: str) → Dict[str, str][source]

Parse CCCC configuration file.

Gets warning and error thresholds for all the metrics. An explanation to dump default values to a configuration file is at: http://sarnold.github.io/cccc/CCCC_User_Guide.html#config

cccc –opt_outfile=cccc.opt

parse_tool_output(output: Dict[Any, Any], src: str, config_file: str) → List[statick_tool.issue.Issue][source]

Parse tool output and report issues.

scan(package: statick_tool.package.Package, level: str) → Optional[List[statick_tool.issue.Issue]][source]

Run tool and gather output.

statick_tool.plugins.tool.clang_format_tool_plugin module

Apply clang-format tool and gather results.

class statick_tool.plugins.tool.clang_format_tool_plugin.ClangFormatToolPlugin[source]

Bases: statick_tool.tool_plugin.ToolPlugin

Apply clang-format tool and gather results.

check_configuration(clang_format_bin: str) → Optional[bool][source]

Check that configuration is configured properly.

gather_args(args: argparse.Namespace) → None[source]

Gather arguments.

get_name() → str[source]

Get name of tool.

parse_tool_output(total_output: List[str], files: List[str]) → List[statick_tool.issue.Issue][source]

Parse tool output and report issues.

scan(package: statick_tool.package.Package, level: str) → Optional[List[statick_tool.issue.Issue]][source]

Run tool and gather output.

statick_tool.plugins.tool.clang_tidy_tool_plugin module

Apply clang-tidy tool and gather results.

class statick_tool.plugins.tool.clang_tidy_tool_plugin.ClangTidyToolPlugin[source]

Bases: statick_tool.tool_plugin.ToolPlugin

Apply clang-tidy tool and gather results.

classmethod check_for_exceptions(match: Match[str]) → bool[source]

Manual exceptions.

gather_args(args: argparse.Namespace) → None[source]

Gather arguments.

get_name() → str[source]

Get name of tool.

classmethod get_tool_dependencies() → List[str][source]

Get a list of tools that must run before this one.

parse_tool_output(output: str) → List[statick_tool.issue.Issue][source]

Parse tool output and report issues.

scan(package: statick_tool.package.Package, level: str) → Optional[List[statick_tool.issue.Issue]][source]

Run tool and gather output.

statick_tool.plugins.tool.cmakelint_tool_plugin module

Apply cmakelint tool and gather results.

class statick_tool.plugins.tool.cmakelint_tool_plugin.CMakelintToolPlugin[source]

Bases: statick_tool.tool_plugin.ToolPlugin

Apply cmakelint tool and gather results.

get_file_types() → List[str][source]

Return a list of file types the plugin can scan.

get_name() → str[source]

Get name of tool.

parse_output(total_output: List[str], package: Optional[statick_tool.package.Package] = None) → List[statick_tool.issue.Issue][source]

Parse tool output and report issues.

process_files(package: statick_tool.package.Package, level: str, files: List[str], user_flags: List[str]) → Optional[List[str]][source]

Run tool and gather output.

statick_tool.plugins.tool.cppcheck_tool_plugin module

Apply cppcheck tool and gather results.

class statick_tool.plugins.tool.cppcheck_tool_plugin.CppcheckToolPlugin[source]

Bases: statick_tool.tool_plugin.ToolPlugin

Apply cppcheck tool and gather results.

classmethod check_for_exceptions(match: Match[str]) → bool[source]

Manual exceptions.

gather_args(args: argparse.Namespace) → None[source]

Gather arguments.

get_name() → str[source]

Get name of tool.

parse_tool_output(output: str) → List[statick_tool.issue.Issue][source]

Parse tool output and report issues.

scan(package: statick_tool.package.Package, level: str) → Optional[List[statick_tool.issue.Issue]][source]

Run tool and gather output.

statick_tool.plugins.tool.cpplint_tool_plugin module

Apply Cpplint tool and gather results.

class statick_tool.plugins.tool.cpplint_tool_plugin.CpplintToolPlugin[source]

Bases: statick_tool.tool_plugin.ToolPlugin

Apply Cpplint tool and gather results.

classmethod check_for_exceptions(match: Match[str]) → bool[source]

Manual exceptions.

get_name() → str[source]

Get name of tool.

parse_tool_output(output: str) → List[statick_tool.issue.Issue][source]

Parse tool output and report issues.

scan(package: statick_tool.package.Package, level: str) → Optional[List[statick_tool.issue.Issue]][source]

Run tool and gather output.

statick_tool.plugins.tool.docformatter_tool_plugin module

Apply docformatter tool and gather results.

class statick_tool.plugins.tool.docformatter_tool_plugin.DocformatterToolPlugin[source]

Bases: statick_tool.tool_plugin.ToolPlugin

Apply docformatter tool and gather results.

get_file_types() → List[str][source]

Return a list of file types the plugin can scan.

get_name() → str[source]

Get name of tool.

parse_output(total_output: List[str], package: Optional[statick_tool.package.Package] = None) → List[statick_tool.issue.Issue][source]

Parse tool output and report issues.

process_files(package: statick_tool.package.Package, level: str, files: List[str], user_flags: List[str]) → Optional[List[str]][source]

Run tool and gather output.

statick_tool.plugins.tool.do_nothing_tool_plugin module

Do nothing, this is primarily useful for testing purposes.

class statick_tool.plugins.tool.do_nothing_tool_plugin.DoNothingToolPlugin[source]

Bases: statick_tool.tool_plugin.ToolPlugin

Do nothing, this is primarily useful for testing purposes.

get_file_types() → List[str][source]

Return a list of file types the plugin can scan.

get_name() → str[source]

Get name of tool.

parse_output(total_output: List[str], package: Optional[statick_tool.package.Package] = None) → List[statick_tool.issue.Issue][source]

Parse tool output and report issues.

process_files(package: statick_tool.package.Package, level: str, files: List[str], user_flags: List[str]) → Optional[List[str]][source]

Run tool and gather output.

statick_tool.plugins.tool.flawfinder_tool_plugin module

Apply flawfinder tool and gather results.

class statick_tool.plugins.tool.flawfinder_tool_plugin.FlawfinderToolPlugin[source]

Bases: statick_tool.tool_plugin.ToolPlugin

Apply flawfinder tool and gather results.

get_file_types() → List[str][source]

Return a list of file types the plugin can scan.

get_name() → str[source]

Get name of tool.

parse_output(total_output: List[str], package: Optional[statick_tool.package.Package] = None) → List[statick_tool.issue.Issue][source]

Parse tool output and report issues.

process_files(package: statick_tool.package.Package, level: str, files: List[str], user_flags: List[str]) → Optional[List[str]][source]

Run tool and gather output.

statick_tool.plugins.tool.groovylint_tool_plugin module

Apply GroovyLint tool and gather results.

class statick_tool.plugins.tool.groovylint_tool_plugin.GroovyLintToolPlugin[source]

Bases: statick_tool.tool_plugin.ToolPlugin

Apply GroovyLint tool and gather results.

get_file_types() → List[str][source]

Return a list of file types the plugin can scan.

get_name() → str[source]

Get name of tool.

parse_output(total_output: List[str], package: Optional[statick_tool.package.Package] = None) → List[statick_tool.issue.Issue][source]

Parse tool output and report issues.

process_files(package: statick_tool.package.Package, level: str, files: List[str], user_flags: List[str]) → Optional[List[str]][source]

Run tool and gather output.

statick_tool.plugins.tool.isort_tool_plugin module

Apply isort tool and gather results.

The isort tool will only find if a file has issues with imports. To automatically fix the issues you can run isort <file>.

class statick_tool.plugins.tool.isort_tool_plugin.IsortToolPlugin[source]

Bases: statick_tool.tool_plugin.ToolPlugin

Apply isort tool and gather results.

get_file_types() → List[str][source]

Return a list of file types the plugin can scan.

get_name() → str[source]

Get name of tool.

parse_output(total_output: List[str], package: Optional[statick_tool.package.Package] = None) → List[statick_tool.issue.Issue][source]

Parse tool output and report issues.

process_files(package: statick_tool.package.Package, level: str, files: List[str], user_flags: List[str]) → Optional[List[str]][source]

Run tool and gather output.

statick_tool.plugins.tool.lizard_tool_plugin module

Apply lizard tool and gather results.

class statick_tool.plugins.tool.lizard_tool_plugin.LizardToolPlugin[source]

Bases: statick_tool.tool_plugin.ToolPlugin

Apply Lizard tool and gather results.

Note: The -f/–input_file, -o/–output_file, and -Edumpcomments options are unsupported.

get_name() → str[source]

Get name of tool.

parse_tool_output(output: str) → List[statick_tool.issue.Issue][source]

Parse tool output and report issues.

remove_invalid_flags(flag_list: List[str]) → List[str][source]

Filter out all disabled flags.

scan(package: statick_tool.package.Package, level: str) → Optional[List[statick_tool.issue.Issue]][source]

Run tool and gather output.

classmethod valid_flag(flag: str) → bool[source]

Indicate if passed flag is invalid.

statick_tool.plugins.tool.make_tool_plugin module

Apply make tool and gather results.

class statick_tool.plugins.tool.make_tool_plugin.MakeToolPlugin[source]

Bases: statick_tool.tool_plugin.ToolPlugin

Apply Make tool and gather results.

classmethod check_for_exceptions(match: Match[str]) → bool[source]

Manual exceptions.

classmethod filter_matches(matches: Any, package: statick_tool.package.Package) → Any[source]

Filter matches.

get_name() → str[source]

Get name of tool.

parse_package_output(package: statick_tool.package.Package, output: str) → List[statick_tool.issue.Issue][source]

Parse tool output and report issues.

scan(package: statick_tool.package.Package, level: str) → Optional[List[statick_tool.issue.Issue]][source]

Run tool and gather output.

statick_tool.plugins.tool.mypy_tool_plugin module

Apply mypy tool and gather results.

class statick_tool.plugins.tool.mypy_tool_plugin.MypyToolPlugin[source]

Bases: statick_tool.tool_plugin.ToolPlugin

Apply mypy tool and gather results.

get_file_types() → List[str][source]

Return a list of file types the plugin can scan.

get_name() → str[source]

Get name of tool.

parse_output(total_output: List[str], package: Optional[statick_tool.package.Package] = None) → List[statick_tool.issue.Issue][source]

Parse tool output and report issues.

process_files(package: statick_tool.package.Package, level: str, files: List[str], user_flags: List[str]) → Optional[List[str]][source]

Run tool and gather output.

statick_tool.plugins.tool.perlcritic_tool_plugin module

Apply Perl::Critic tool and gather results.

class statick_tool.plugins.tool.perlcritic_tool_plugin.PerlCriticToolPlugin[source]

Bases: statick_tool.tool_plugin.ToolPlugin

Apply Perl::Critic tool and gather results.

gather_args(args: argparse.Namespace) → None[source]

Gather arguments.

get_file_types() → List[str][source]

Return a list of file types the plugin can scan.

get_name() → str[source]

Get name of tool.

parse_output(total_output: List[str], package: Optional[statick_tool.package.Package] = None) → List[statick_tool.issue.Issue][source]

Parse tool output and report issues.

process_files(package: statick_tool.package.Package, level: str, files: List[str], user_flags: List[str]) → Optional[List[str]][source]

Run tool and gather output.

statick_tool.plugins.tool.pycodestyle_tool_plugin module

Apply pycodestyle tool and gather results.

class statick_tool.plugins.tool.pycodestyle_tool_plugin.PycodestyleToolPlugin[source]

Bases: statick_tool.tool_plugin.ToolPlugin

Apply pycodestyle tool and gather results.

get_file_types() → List[str][source]

Return a list of file types the plugin can scan.

get_name() → str[source]

Get name of tool.

parse_output(total_output: List[str], package: Optional[statick_tool.package.Package] = None) → List[statick_tool.issue.Issue][source]

Parse tool output and report issues.

process_files(package: statick_tool.package.Package, level: str, files: List[str], user_flags: List[str]) → Optional[List[str]][source]

Run tool and gather output.

statick_tool.plugins.tool.pydocstyle_tool_plugin module

Apply pydocstyle tool and gather results.

class statick_tool.plugins.tool.pydocstyle_tool_plugin.PydocstyleToolPlugin[source]

Bases: statick_tool.tool_plugin.ToolPlugin

Apply pydocstyle tool and gather results.

get_file_types() → List[str][source]

Return a list of file types the plugin can scan.

get_name() → str[source]

Get name of tool.

parse_output(total_output: List[str], package: Optional[statick_tool.package.Package] = None) → List[statick_tool.issue.Issue][source]

Parse tool output and report issues.

process_files(package: statick_tool.package.Package, level: str, files: List[str], user_flags: List[str]) → Optional[List[str]][source]

Run tool and gather output.

statick_tool.plugins.tool.pyflakes_tool_plugin module

Apply pyflakes tool and gather results.

class statick_tool.plugins.tool.pyflakes_tool_plugin.PyflakesToolPlugin[source]

Bases: statick_tool.tool_plugin.ToolPlugin

Apply pyflakes tool and gather results.

get_file_types() → List[str][source]

Return a list of file types the plugin can scan.

get_name() → str[source]

Get name of tool.

parse_output(total_output: List[str], package: Optional[statick_tool.package.Package] = None) → List[statick_tool.issue.Issue][source]

Parse tool output and report issues.

process_files(package: statick_tool.package.Package, level: str, files: List[str], user_flags: List[str]) → Optional[List[str]][source]

Run tool and gather output.

statick_tool.plugins.tool.pylint_tool_plugin module

Apply pylint tool and gather results.

class statick_tool.plugins.tool.pylint_tool_plugin.PylintToolPlugin[source]

Bases: statick_tool.tool_plugin.ToolPlugin

Apply pylint tool and gather results.

get_file_types() → List[str][source]

Return a list of file types the plugin can scan.

get_name() → str[source]

Get name of tool.

parse_output(total_output: List[str], package: Optional[statick_tool.package.Package] = None) → List[statick_tool.issue.Issue][source]

Parse tool output and report issues.

process_files(package: statick_tool.package.Package, level: str, files: List[str], user_flags: List[str]) → Optional[List[str]][source]

Run tool and gather output.

statick_tool.plugins.tool.ruff_tool_plugin module

Apply ruff tool and gather results.

class statick_tool.plugins.tool.ruff_tool_plugin.RuffToolPlugin[source]

Bases: statick_tool.tool_plugin.ToolPlugin

Apply ruff tool and gather results.

get_file_types() → List[str][source]

Return a list of file types the plugin can scan.

get_name() → str[source]

Get name of tool.

parse_output(total_output: List[str], package: Optional[statick_tool.package.Package] = None) → List[statick_tool.issue.Issue][source]

Parse tool output and report issues.

process_files(package: statick_tool.package.Package, level: str, files: List[str], user_flags: List[str]) → Optional[List[str]][source]

Run tool and gather output.

statick_tool.plugins.tool.shellcheck_tool_plugin module

Apply shellcheck tool and gather results.

The output from the tool is collected in JSON format to facilitate parsing.

class statick_tool.plugins.tool.shellcheck_tool_plugin.ShellcheckToolPlugin[source]

Bases: statick_tool.tool_plugin.ToolPlugin

Apply shellcheck tool and gather results.

gather_args(args: argparse.Namespace) → None[source]

Gather arguments.

get_name() → str[source]

Get name of tool.

parse_json_output(output: Any) → List[statick_tool.issue.Issue][source]

Parse tool output and report issues.

scan(package: statick_tool.package.Package, level: str) → Optional[List[statick_tool.issue.Issue]][source]

Run tool and gather output.

statick_tool.plugins.tool.shellcheck_tool_plugin module

Apply shellcheck tool and gather results.

The output from the tool is collected in JSON format to facilitate parsing.

class statick_tool.plugins.tool.shellcheck_tool_plugin.ShellcheckToolPlugin[source]

Bases: statick_tool.tool_plugin.ToolPlugin

Apply shellcheck tool and gather results.

gather_args(args: argparse.Namespace) → None[source]

Gather arguments.

get_name() → str[source]

Get name of tool.

parse_json_output(output: Any) → List[statick_tool.issue.Issue][source]

Parse tool output and report issues.

scan(package: statick_tool.package.Package, level: str) → Optional[List[statick_tool.issue.Issue]][source]

Run tool and gather output.

statick_tool.plugins.tool.spotbugs_tool_plugin module

Apply spotbugs tool and gather results.

class statick_tool.plugins.tool.spotbugs_tool_plugin.SpotbugsToolPlugin[source]

Bases: statick_tool.tool_plugin.ToolPlugin

Apply spotbugs tool and gather results.

get_name() → str[source]

Get name of tool.

classmethod get_tool_dependencies() → List[str][source]

Get a list of tools that must run before this one.

parse_file_output(output: str) → Optional[List[statick_tool.issue.Issue]][source]

Parse tool output and report issues.

scan(package: statick_tool.package.Package, level: str) → Optional[List[statick_tool.issue.Issue]][source]

Run tool and gather output.

statick_tool.plugins.tool.uncrustify_tool_plugin module

Apply uncrustify tool and gather results.

class statick_tool.plugins.tool.uncrustify_tool_plugin.UncrustifyToolPlugin[source]

Bases: statick_tool.tool_plugin.ToolPlugin

Apply uncrustify tool and gather results.

gather_args(args: argparse.Namespace) → None[source]

Gather arguments.

get_name() → str[source]

Get name of tool.

parse_output(total_output: List[str], package: Optional[statick_tool.package.Package] = None) → List[statick_tool.issue.Issue][source]

Parse tool output and report issues.

scan(package: statick_tool.package.Package, level: str) → Optional[List[statick_tool.issue.Issue]][source]

Run tool and gather output.

statick_tool.plugins.tool.xmllint_tool_plugin module

Apply xmllint tool and gather results.

class statick_tool.plugins.tool.xmllint_tool_plugin.XmllintToolPlugin[source]

Bases: statick_tool.tool_plugin.ToolPlugin

Apply xmllint tool and gather results.

get_file_types() → List[str][source]

Return a list of file types the plugin can scan.

get_name() → str[source]

Get name of tool.

parse_output(total_output: List[str], package: Optional[statick_tool.package.Package] = None) → List[statick_tool.issue.Issue][source]

Parse tool output and report issues.

process_files(package: statick_tool.package.Package, level: str, files: List[str], user_flags: List[str]) → Optional[List[str]][source]

Run tool and gather output.

statick_tool.plugins.tool.yamllint_tool_plugin module

Apply yamllint tool and gather results.

class statick_tool.plugins.tool.yamllint_tool_plugin.YamllintToolPlugin[source]

Bases: statick_tool.tool_plugin.ToolPlugin

Apply yamllint tool and gather results.

get_file_types() → List[str][source]

Return a list of file types the plugin can scan.

get_name() → str[source]

Get name of tool.

parse_output(total_output: List[str], package: Optional[statick_tool.package.Package] = None) → List[statick_tool.issue.Issue][source]

Parse tool output and report issues.

process_files(package: statick_tool.package.Package, level: str, files: List[str], user_flags: List[str]) → Optional[List[str]][source]

Run tool and gather output.