statick_tool.plugins.tool package

Module contents

Default tool plugins for statick.

Submodules

statick_tool.plugins.tool.bandit module

Apply bandit tool and gather results.

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

Bases: ToolPlugin

Apply bandit tool and gather results.

gather_args(args: Namespace) None[source]

Gather arguments.

Parameters:

args – Flags for this plugin will be added to these existing arguments.

get_binary(level: str | None = None, package: Package | None = None) str[source]

Get tool binary name.

Parameters:
  • level – The level to run the tool at.

  • package – The package being processed.

Returns:

The binary name.

get_file_types() list[str][source]

Return a list of file types the plugin can scan.

Returns:

List of file types.

get_name() str[source]

Get name of tool.

Returns:

Name of the tool.

parse_output(total_output: list[str], package: Package | None = None) list[Issue][source]

Parse tool output and report issues.

Parameters:
  • total_output – List of output strings.

  • package – The package being processed.

Returns:

List of issues found.

process_files(package: Package, level: str, files: list[str], user_flags: list[str]) list[str] | None[source]

Run tool and gather output.

Parameters:
  • package – The package to process.

  • level – The level to run the tool at.

  • files – List of files to process.

  • user_flags – List of user flags.

Returns:

List of output strings or None.

statick_tool.plugins.tool.black module

Apply black tool and gather results.

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

Bases: ToolPlugin

Apply black tool and gather results.

get_file_types() list[str][source]

Return a list of file types the plugin can scan.

Returns:

List of file types.

get_name() str[source]

Get name of tool.

Returns:

Name of the tool.

parse_output(total_output: list[str], package: Package | None = None) list[Issue][source]

Parse tool output and report issues.

Parameters:
  • total_output – List of output strings.

  • package – The package being processed.

Returns:

List of issues found.

process_files(package: Package, level: str, files: list[str], user_flags: list[str]) list[str] | None[source]

Run tool and gather output.

Parameters:
  • package – The package to process.

  • level – The level to run the tool at.

  • files – List of files to process.

  • user_flags – List of user flags.

Returns:

List of output strings or None.

statick_tool.plugins.tool.catkin_lint module

Apply catkin_lint tool and gather results.

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

Bases: ToolPlugin

Apply catkin_lint tool and gather results.

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

Manual exceptions.

Parameters:
  • match – The regex match object.

  • package – The package to scan.

Returns:

True if the match is an exception, False otherwise.

get_file_types() list[str][source]

Return a list of file types the plugin can scan.

Returns:

A list of file types.

get_name() str[source]

Get name of tool.

Returns:

Name of the tool.

classmethod get_severity(issue_type: str) int[source]

Get level for given issue type.

Parameters:

issue_type – The type of the issue.

Returns:

The severity level.

parse_output(total_output: list[str], package: Package | None = None) list[Issue][source]

Parse tool output and report issues.

Parameters:
  • total_output – The output from the tool.

  • package – The package to scan.

Returns:

A list of issues found by the tool.

process_files(package: Package, level: str, files: list[str], user_flags: list[str]) list[str] | None[source]

Run tool and gather output.

Parameters:
  • package – The package to scan.

  • level – The level of the scan.

  • files – The files to scan.

  • user_flags – The user flags to use.

Returns:

The output from the tool.

statick_tool.plugins.tool.cccc 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.CCCCToolPlugin[source]

Bases: 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.

Parameters:

name – The name to convert.

Returns:

The converted name.

find_issues(config: dict[Any, Any], results: dict[Any, Any], src: str) list[Issue][source]

Identify issues by comparing tool results with tool configuration.

Parameters:
  • config – The configuration dictionary.

  • results – The results dictionary.

  • src – The source file being scanned.

Returns:

A list of issues found by the tool.

gather_args(args: Namespace) None[source]

Gather arguments.

Parameters:

args – Flags for this plugin will be added to these existing arguments.

get_binary(level: str | None = None, package: Package | None = None) str[source]

Get tool binary name.

Parameters:
  • level – The level of the scan.

  • package – The package to scan.

Returns:

The name of the tool binary.

get_name() str[source]

Get name of tool.

Returns:

Name of the tool.

get_version() str[source]

Figure out and return the version of the tool that’s installed.

If no version is found the function returns “Uninstalled”.

Returns:

The version of the 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

Parameters:

config_file – The configuration file.

Returns:

A dictionary containing the parsed configuration.

parse_tool_output(output: dict[Any, Any], src: str, config_file: str) list[Issue][source]

Parse tool output and report issues.

Parameters:
  • output – The output from the tool.

  • src – The source file being scanned.

  • config_file – The configuration file.

Returns:

A list of issues found by the tool.

scan(package: Package, level: str) list[Issue] | None[source]

Run tool and gather output.

Parameters:
  • package – The package to scan.

  • level – The level of the scan.

Returns:

A list of issues found by the tool.

statick_tool.plugins.tool.chktex module

Apply chktex tool and gather results.

Chktex documentation at http://mirrors.rit.edu/CTAN/systems/doc/chktex/ChkTeX.pdf.

class statick_tool.plugins.tool.chktex.ChktexToolPlugin[source]

Bases: ToolPlugin

Apply chktex tool and gather results.

get_file_types() list[str][source]

Return a list of file types the plugin can scan.

Returns:

A list of file types.

get_name() str[source]

Get name of tool.

Returns:

Name of the tool.

parse_output(total_output: list[str], package: Package | None = None) list[Issue][source]

Parse tool output and report issues.

Parameters:
  • total_output – The output from the tool.

  • package – The package to scan.

Returns:

A list of issues found by the tool.

process_files(package: Package, level: str, files: list[str], user_flags: list[str]) list[str] | None[source]

Run tool and gather output.

Parameters:
  • package – The package to scan.

  • level – The level of the scan.

  • files – The files to scan.

  • user_flags – The user flags to use.

Returns:

The output from the tool.

statick_tool.plugins.tool.clang_format module

Apply clang-format tool and gather results.

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

Bases: ToolPlugin

Apply clang-format tool and gather results.

check_configuration(clang_format_bin: str) bool | None[source]

Check that configuration is configured properly.

Parameters:

clang_format_bin – The clang-format binary.

Returns:

True if the configuration is correct, False otherwise.

gather_args(args: Namespace) None[source]

Gather arguments.

Parameters:

args – Flags for this plugin will be added to these existing arguments.

get_binary(level: str | None = None, package: Package | None = None) str[source]

Return the name of the tool binary.

Parameters:
  • level – The level of the scan.

  • package – The package to scan.

Returns:

The name of the tool binary.

get_name() str[source]

Get name of tool.

Returns:

Name of the tool.

parse_tool_output(total_output: list[str], files: list[str]) list[Issue][source]

Parse tool output and report issues.

Parameters:
  • total_output – The output from the tool.

  • files – The files to scan.

Returns:

A list of issues found by the tool.

scan(package: Package, level: str) list[Issue] | None[source]

Run tool and gather output.

Parameters:
  • package – The package to scan.

  • level – The level of the scan.

Returns:

A list of issues found by the tool.

statick_tool.plugins.tool.clang_tidy module

Apply clang-tidy tool and gather results.

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

Bases: ToolPlugin

Apply clang-tidy tool and gather results.

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

Manual exceptions.

Parameters:

match – The regex match object.

Returns:

True if the match is an exception, False otherwise.

gather_args(args: Namespace) None[source]

Gather arguments.

Parameters:

args – Flags for this plugin will be added to these existing arguments.

get_name() str[source]

Get name of tool.

Returns:

Name of the tool.

classmethod get_tool_dependencies() list[str][source]

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

Returns:

A list of tool dependencies.

parse_tool_output(output: str) list[Issue][source]

Parse tool output and report issues.

Parameters:

output – The output from the tool.

Returns:

A list of issues found by the tool.

scan(package: Package, level: str) list[Issue] | None[source]

Run tool and gather output.

Parameters:
  • package – The package to scan.

  • level – The level of the scan.

Returns:

A list of issues found by the tool.

statick_tool.plugins.tool.cmakelint module

Apply cmakelint tool and gather results.

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

Bases: ToolPlugin

Apply cmakelint tool and gather results.

get_file_types() list[str][source]

Return a list of file types the plugin can scan.

Returns:

A list of file types.

get_name() str[source]

Get name of tool.

Returns:

Name of the tool.

parse_output(total_output: list[str], package: Package | None = None) list[Issue][source]

Parse tool output and report issues.

Parameters:
  • total_output – The output from the tool.

  • package – The package to scan.

Returns:

A list of issues found by the tool.

process_files(package: Package, level: str, files: list[str], user_flags: list[str]) list[str] | None[source]

Run tool and gather output.

Parameters:
  • package – The package to scan.

  • level – The level of the scan.

  • files – The files to scan.

  • user_flags – The user flags to use.

Returns:

The output from the tool.

statick_tool.plugins.tool.cppcheck module

Apply cppcheck tool and gather results.

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

Bases: ToolPlugin

Apply cppcheck tool and gather results.

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

Manual exceptions.

Parameters:

match – The regex match object.

Returns:

True if the match is an exception, False otherwise.

gather_args(args: Namespace) None[source]

Gather arguments.

Parameters:

args – Flags for this plugin will be added to these existing arguments.

get_binary(level: str | None = None, package: Package | None = None) str[source]

Get tool binary name.

Parameters:
  • level – The level of the scan.

  • package – The package to scan.

Returns:

The name of the tool binary.

get_name() str[source]

Get name of tool.

Returns:

Name of the tool.

parse_tool_output(output: str) list[Issue][source]

Parse tool output and report issues.

Parameters:

output – The output from the tool.

Returns:

A list of issues found by the tool.

parse_version(version_str: str) str[source]

Parse version of tool.

If no version is found the function returns “0.0”.

Parameters:

version_str – The version string to parse.

Returns:

The parsed version string.

scan(package: Package, level: str) list[Issue] | None[source]

Run tool and gather output.

Parameters:
  • package – The package to scan.

  • level – The level of the scan.

Returns:

A list of issues found by the tool.

statick_tool.plugins.tool.cpplint module

Apply Cpplint tool and gather results.

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

Bases: ToolPlugin

Apply Cpplint tool and gather results.

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

Manual exceptions.

Parameters:

match – The regex match object.

Returns:

True if the match is an exception, False otherwise.

get_binary(level: str | None = None, package: Package | None = None) str[source]

Return the name of the tool binary.

Parameters:
  • level – The level of the scan.

  • package – The package to scan.

Returns:

The name of the tool binary.

get_name() str[source]

Get name of tool.

Returns:

Name of the tool.

parse_tool_output(output: str) list[Issue][source]

Parse tool output and report issues.

Parameters:

output – The output from the tool.

Returns:

A list of issues found by the tool.

scan(package: Package, level: str) list[Issue] | None[source]

Run tool and gather output.

Parameters:
  • package – The package to scan.

  • level – The level of the scan.

Returns:

A list of issues found by the tool.

statick_tool.plugins.tool.docformatter module

Apply docformatter tool and gather results.

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

Bases: ToolPlugin

Apply docformatter tool and gather results.

get_file_types() list[str][source]

Return a list of file types the plugin can scan.

Returns:

List of file types.

get_name() str[source]

Get name of tool.

Returns:

Name of the tool.

parse_output(total_output: list[str], package: Package | None = None) list[Issue][source]

Parse tool output and report issues.

Parameters:
  • total_output – List of output strings.

  • package – The package being analyzed.

Returns:

List of issues.

process_files(package: Package, level: str, files: list[str], user_flags: list[str]) list[str] | None[source]

Run tool and gather output.

Parameters:
  • package – The package being analyzed.

  • level – The analysis level.

  • files – List of files to process.

  • user_flags – List of user flags.

Returns:

List of output strings or None.

statick_tool.plugins.tool.dockerfile_lint module

Apply dockerfile-lint tool and gather results.

class statick_tool.plugins.tool.dockerfile_lint.DockerfileULintToolPlugin[source]

Bases: ToolPlugin

Apply dockerfile-lint tool and gather results.

classmethod add_filename(output: str, src: str) str[source]

Add the filename to the json output.

This is because dockerfile-lint does not include the filename in the output.

Some warnings and errors are included in the tool output, but they are not in json format. Those lines start with a “(”. Any line that does not start with a “(” is considered to be a line of output.

Parameters:
  • output – The output string.

  • src – The source file.

Returns:

Updated output string.

get_binary(level: str | None = None, package: Package | None = None) str[source]

Get tool binary name.

Parameters:
  • level – The analysis level.

  • package – The package being analyzed.

Returns:

Name of the tool binary.

get_file_types() list[str][source]

Return a list of file types the plugin can scan.

Returns:

List of file types.

get_name() str[source]

Get name of tool.

Returns:

Name of the tool.

get_version() str[source]

Figure out and return the version of the tool that’s installed.

Returns:

Version of the tool or “Unknown” if not found.

parse_output(total_output: list[str], package: Package | None = None) list[Issue][source]

Parse tool output and report issues.

Parameters:
  • total_output – List of output strings.

  • package – The package being analyzed.

Returns:

List of issues.

process_files(package: Package, level: str, files: list[str], user_flags: list[str]) list[str] | None[source]

Run tool and gather output.

Parameters:
  • package – The package being analyzed.

  • level – The analysis level.

  • files – List of files to process.

  • user_flags – List of user flags.

Returns:

List of output strings or None.

statick_tool.plugins.tool.dockerfilelint module

Apply dockerfilelint tool and gather results.

class statick_tool.plugins.tool.dockerfilelint.DockerfileLintToolPlugin[source]

Bases: ToolPlugin

Apply dockerfilelint tool and gather results.

get_file_types() list[str][source]

Return a list of file types the plugin can scan.

Returns:

List of file types.

get_name() str[source]

Get name of tool.

Returns:

Name of the tool.

parse_output(total_output: list[str], package: Package | None = None) list[Issue][source]

Parse tool output and report issues.

Parameters:
  • total_output – List of output strings.

  • package – The package being analyzed.

Returns:

List of issues.

process_files(package: Package, level: str, files: list[str], user_flags: list[str]) list[str] | None[source]

Run tool and gather output.

Parameters:
  • package – The package being analyzed.

  • level – The analysis level.

  • files – List of files to process.

  • user_flags – List of user flags.

Returns:

List of output strings or None.

statick_tool.plugins.tool.do_nothing module

Do nothing, this is primarily useful for testing purposes.

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

Bases: ToolPlugin

Do nothing, this is primarily useful for testing purposes.

get_binary(level: str | None = None, package: Package | None = None) str[source]

Get tool binary name.

Parameters:
  • level – The analysis level.

  • package – The package being analyzed.

Returns:

Name of the tool binary.

get_file_types() list[str][source]

Return a list of file types the plugin can scan.

Returns:

List of file types.

get_name() str[source]

Get name of tool.

Returns:

Name of the tool.

get_version() str[source]

Figure out and return the version of the tool that’s installed.

Returns:

Version of the tool.

parse_output(total_output: list[str], package: Package | None = None) list[Issue][source]

Parse tool output and report issues.

Parameters:
  • total_output – List of output strings.

  • package – The package being analyzed.

Returns:

List of issues.

process_files(package: Package, level: str, files: list[str], user_flags: list[str]) list[str] | None[source]

Run tool and gather output.

Parameters:
  • package – The package being analyzed.

  • level – The analysis level.

  • files – List of files to process.

  • user_flags – List of user flags.

Returns:

List of output strings or None.

statick_tool.plugins.tool.eslint module

Apply eslint tool and gather results.

class statick_tool.plugins.tool.eslint.ESLintToolPlugin[source]

Bases: ToolPlugin

Apply eslint tool and gather results.

get_file_types() list[str][source]

Return a list of file types the plugin can scan.

Returns:

List of file types.

get_format_file(level: str) Tuple[str | None, bool][source]

Retrieve format file path.

Parameters:

level – The analysis level.

Returns:

Tuple containing the format file path and a boolean indicating if the file was copied.

get_name() str[source]

Get name of tool.

Returns:

Name of the tool.

parse_output(total_output: list[str], package: Package | None = None) list[Issue][source]

Parse tool output and report issues.

Parameters:
  • total_output – List of output strings.

  • package – The package being analyzed.

Returns:

List of issues.

process_files(package: Package, level: str, files: list[str], user_flags: list[str]) list[str] | None[source]

Run tool and gather output.

Parameters:
  • package – The package being analyzed.

  • level – The analysis level.

  • files – List of files to process.

  • user_flags – List of user flags.

Returns:

List of output strings or None.

classmethod remove_config_file(format_file_name: str) None[source]

Remove config file automatically copied into directory.

Parameters:

format_file_name – The name of the format file.

statick_tool.plugins.tool.flawfinder module

Apply flawfinder tool and gather results.

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

Bases: ToolPlugin

Apply flawfinder tool and gather results.

get_file_types() list[str][source]

Return a list of file types the plugin can scan.

Returns:

List of file types.

get_name() str[source]

Get name of tool.

Returns:

Name of the tool.

parse_output(total_output: list[str], package: Package | None = None) list[Issue][source]

Parse tool output and report issues.

Parameters:
  • total_output – List of output strings.

  • package – The package being analyzed.

Returns:

List of issues.

process_files(package: Package, level: str, files: list[str], user_flags: list[str]) list[str] | None[source]

Run tool and gather output.

Parameters:
  • package – The package being analyzed.

  • level – The analysis level.

  • files – List of files to process.

  • user_flags – List of user flags.

Returns:

List of output strings or None.

statick_tool.plugins.tool.groovylint module

Apply GroovyLint tool and gather results.

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

Bases: ToolPlugin

Apply GroovyLint tool and gather results.

get_binary(level: str | None = None, package: Package | None = None) str[source]

Get tool binary name.

Parameters:
  • level – The analysis level.

  • package – The package being analyzed.

Returns:

Name of the tool binary.

get_file_types() list[str][source]

Return a list of file types the plugin can scan.

Returns:

List of file types.

get_name() str[source]

Get name of tool.

Returns:

Name of the tool.

get_version() str[source]

Figure out and return the version of the tool that’s installed.

Returns:

Version of the tool or “Unknown” if not found.

parse_output(total_output: list[str], package: Package | None = None) list[Issue][source]

Parse tool output and report issues.

Parameters:
  • total_output – List of output strings.

  • package – The package being analyzed.

Returns:

List of issues.

process_files(package: Package, level: str, files: list[str], user_flags: list[str]) list[str] | None[source]

Run tool and gather output.

Parameters:
  • package – The package being analyzed.

  • level – The analysis level.

  • files – List of files to process.

  • user_flags – List of user flags.

Returns:

List of output strings or None.

statick_tool.plugins.tool.hadolint module

Apply hadolint tool and gather results.

class statick_tool.plugins.tool.hadolint.HadolintToolPlugin[source]

Bases: ToolPlugin

Apply hadolint tool and gather results.

gather_args(args: Namespace) None[source]

Gather arguments.

Parameters:

args – Flags for this plugin will be added to these existing arguments.

get_binary(level: str | None = None, package: Package | None = None) str[source]

Get tool binary name.

Parameters:
  • level – The analysis level.

  • package – The package being analyzed.

Returns:

Name of the tool binary.

get_file_types() list[str][source]

Return a list of file types the plugin can scan.

Returns:

List of file types.

get_name() str[source]

Get name of tool.

Returns:

Name of the tool.

get_version() str[source]

Figure out and return the version of the tool that’s installed.

Returns:

Version of the tool or “Unknown” if not found.

parse_output(total_output: list[str], package: Package | None = None) list[Issue][source]

Parse tool output and report issues.

Parameters:
  • total_output – List of output strings.

  • package – The package being analyzed.

Returns:

List of issues.

process_files(package: Package, level: str, files: list[str], user_flags: list[str]) list[str] | None[source]

Run tool and gather output.

Parameters:
  • package – The package being analyzed.

  • level – The analysis level.

  • files – List of files to process.

  • user_flags – List of user flags.

Returns:

List of output strings or None.

scan_docker(tool_bin: str, flags: list[str], files: list[str], config_file_path: str) str | None[source]

Use hadolint docker image to scan.

Parameters:
  • tool_bin – The tool binary.

  • flags – List of flags.

  • files – List of files to scan.

  • config_file_path – Path to the config file.

Returns:

Output string or None.

scan_local_binary(tool_bin: str, flags: list[str], files: list[str]) str | None[source]

Use locally installed hadolint binary to scan.

Parameters:
  • tool_bin – The tool binary.

  • flags – List of flags.

  • files – List of files to scan.

Returns:

Output string or None.

statick_tool.plugins.tool.htmllint module

Apply htmllint tool and gather results.

class statick_tool.plugins.tool.htmllint.HTMLLintToolPlugin[source]

Bases: ToolPlugin

Apply HTML tidy tool and gather results.

get_file_types() list[str][source]

Return a list of file types the plugin can scan.

Returns:

List of file types.

get_name() str[source]

Get name of tool.

Returns:

Name of the tool.

parse_output(total_output: list[str], package: Package | None = None) list[Issue][source]

Parse tool output and report issues.

process_files(package: Package, level: str, files: list[str], user_flags: list[str]) list[str] | None[source]

Run tool and gather output.

Parameters:
  • package – The package being analyzed.

  • level – The analysis level.

  • files – List of files to process.

  • user_flags – List of user flags.

Returns:

List of output strings or None.

statick_tool.plugins.tool.isort 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.IsortToolPlugin[source]

Bases: ToolPlugin

Apply isort tool and gather results.

get_file_types() list[str][source]

Return a list of file types the plugin can scan.

Returns:

List of file types.

get_name() str[source]

Get name of tool.

Returns:

Name of the tool.

parse_output(total_output: list[str], package: Package | None = None) list[Issue][source]

Parse tool output and report issues.

Parameters:
  • total_output – List of output strings.

  • package – The package being processed.

Returns:

List of issues found.

process_files(package: Package, level: str, files: list[str], user_flags: list[str]) list[str] | None[source]

Run tool and gather output.

Parameters:
  • package – The package to process.

  • level – The level to run the tool at.

  • files – List of files to process.

  • user_flags – List of user flags.

Returns:

List of output strings or None.

statick_tool.plugins.tool.jshint module

Apply jshint tool and gather results.

class statick_tool.plugins.tool.jshint.JSHintToolPlugin[source]

Bases: ToolPlugin

Apply jshint tool and gather results.

get_file_types() list[str][source]

Return a list of file types the plugin can scan.

Returns:

List of file types.

get_name() str[source]

Get name of tool.

Returns:

Name of the tool.

parse_output(total_output: list[str], package: Package | None = None) list[Issue][source]

Parse tool output and report issues.

Parameters:
  • total_output – List of output strings.

  • package – The package being processed.

Returns:

List of issues found.

process_files(package: Package, level: str, files: list[str], user_flags: list[str]) list[str] | None[source]

Run tool and gather output.

Parameters:
  • package – The package to process.

  • level – The level to run the tool at.

  • files – List of files to process.

  • user_flags – List of user flags.

Returns:

List of output strings or None.

statick_tool.plugins.tool.lacheck module

Apply lacheck tool and gather results.

class statick_tool.plugins.tool.lacheck.LacheckToolPlugin[source]

Bases: ToolPlugin

Apply lacheck tool and gather results.

get_file_types() list[str][source]

Return a list of file types the plugin can scan.

Returns:

List of file types.

get_name() str[source]

Get name of tool.

Returns:

Name of the tool.

parse_output(total_output: list[str], package: Package | None = None) list[Issue][source]

Parse tool output and report issues.

Parameters:
  • total_output – List of output strings.

  • package – The package being processed.

Returns:

List of issues found.

process_files(package: Package, level: str, files: list[str], user_flags: list[str]) list[str] | None[source]

Run tool and gather output.

Parameters:
  • package – The package to process.

  • level – The level to run the tool at.

  • files – List of files to process.

  • user_flags – List of user flags.

Returns:

List of output strings or None.

statick_tool.plugins.tool.lizard module

Apply lizard tool and gather results.

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

Bases: 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.

Returns:

Name of the tool.

parse_tool_output(output: str) list[Issue][source]

Parse tool output and report issues.

Parameters:

output – The output from the tool.

Returns:

List of issues found.

remove_invalid_flags(flag_list: list[str]) list[str][source]

Filter out all disabled flags.

Parameters:

flag_list – List of flags to filter.

Returns:

List of valid flags.

scan(package: Package, level: str) list[Issue] | None[source]

Run tool and gather output.

Parameters:
  • package – The package to process.

  • level – The level to run the tool at.

Returns:

List of issues found or None.

classmethod valid_flag(flag: str) bool[source]

Indicate if passed flag is invalid.

Parameters:

flag – The flag to check.

Returns:

Boolean indicating if the flag is valid.

statick_tool.plugins.tool.make module

Apply make tool and gather results.

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

Bases: ToolPlugin

Apply Make tool and gather results.

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

Manual exceptions.

Parameters:

match – The regex match object.

Returns:

Boolean indicating if the match is an exception.

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

Filter matches.

Parameters:
  • matches – List of matches.

  • package – The package being processed.

Returns:

Filtered list of matches.

get_name() str[source]

Get name of tool.

Returns:

Name of the tool.

parse_package_output(package: Package, output: str) list[Issue][source]

Parse tool output and report issues.

Parameters:
  • package – The package being processed.

  • output – The output from the tool.

Returns:

List of issues found.

scan(package: Package, level: str) list[Issue] | None[source]

Run tool and gather output.

Parameters:
  • package – The package to process.

  • level – The level to run the tool at.

Returns:

List of issues found or None.

statick_tool.plugins.tool.markdownlint module

Apply markdownlint tool and gather results.

class statick_tool.plugins.tool.markdownlint.MarkdownlintToolPlugin[source]

Bases: ToolPlugin

Apply markdownlint tool and gather results.

get_file_types() list[str][source]

Return a list of file types the plugin can scan.

Returns:

List of file types.

get_name() str[source]

Get name of tool.

Returns:

Name of the tool.

parse_output(total_output: list[str], package: Package | None = None) list[Issue][source]

Parse tool output and report issues.

Parameters:
  • total_output – List of output strings.

  • package – The package being processed.

Returns:

List of issues found.

process_files(package: Package, level: str, files: list[str], user_flags: list[str]) list[str] | None[source]

Run tool and gather output.

Parameters:
  • package – The package to process.

  • level – The level to run the tool at.

  • files – List of files to process.

  • user_flags – List of user flags.

Returns:

List of output strings or None.

statick_tool.plugins.tool.mypy module

Apply mypy tool and gather results.

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

Bases: ToolPlugin

Apply mypy tool and gather results.

get_file_types() list[str][source]

Return a list of file types the plugin can scan.

Returns:

List of file types.

get_name() str[source]

Get name of tool.

Returns:

Name of the tool.

parse_output(total_output: list[str], package: Package | None = None) list[Issue][source]

Parse tool output and report issues.

Parameters:
  • total_output – List of output strings.

  • package – The package being processed.

Returns:

List of issues found.

process_files(package: Package, level: str, files: list[str], user_flags: list[str]) list[str] | None[source]

Run tool and gather output.

Parameters:
  • package – The package to process.

  • level – The level to run the tool at.

  • files – List of files to process.

  • user_flags – List of user flags.

Returns:

List of output strings or None.

statick_tool.plugins.tool.perlcritic module

Apply Perl::Critic tool and gather results.

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

Bases: ToolPlugin

Apply Perl::Critic tool and gather results.

gather_args(args: Namespace) None[source]

Gather arguments.

Parameters:

args – Flags for this plugin will be added to these existing arguments.

get_binary(level: str | None = None, package: Package | None = None) str[source]

Get tool binary name.

Parameters:
  • level – The level of the scan.

  • package – The package to scan.

Returns:

The binary name of the tool.

get_file_types() list[str][source]

Return a list of file types the plugin can scan.

Returns:

A list of file types.

get_name() str[source]

Get name of tool.

Returns:

The name of the tool.

parse_output(total_output: list[str], package: Package | None = None) list[Issue][source]

Parse tool output and report issues.

Parameters:
  • total_output – The output from the tool.

  • package – The package to scan.

Returns:

A list of issues parsed from the output.

process_files(package: Package, level: str, files: list[str], user_flags: list[str]) list[str] | None[source]

Run tool and gather output.

Parameters:
  • package – The package to scan.

  • level – The level of the scan.

  • files – The files to scan.

  • user_flags – The user flags to pass to the tool.

Returns:

The output from the tool.

statick_tool.plugins.tool.pycodestyle module

Apply pycodestyle tool and gather results.

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

Bases: ToolPlugin

Apply pycodestyle tool and gather results.

get_file_types() list[str][source]

Return a list of file types the plugin can scan.

Returns:

A list of file types.

get_name() str[source]

Get name of tool.

Returns:

The name of the tool.

parse_output(total_output: list[str], package: Package | None = None) list[Issue][source]

Parse tool output and report issues.

Parameters:
  • total_output – The output from the tool.

  • package – The package to scan.

Returns:

A list of issues parsed from the output.

process_files(package: Package, level: str, files: list[str], user_flags: list[str]) list[str] | None[source]

Run tool and gather output.

Parameters:
  • package – The package to scan.

  • level – The level of the scan.

  • files – The files to scan.

  • user_flags – The user flags to pass to the tool.

Returns:

The output from the tool.

statick_tool.plugins.tool.pydocstyle module

Apply pydocstyle tool and gather results.

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

Bases: ToolPlugin

Apply pydocstyle tool and gather results.

get_file_types() list[str][source]

Return a list of file types the plugin can scan.

Returns:

A list of file types.

get_name() str[source]

Get name of tool.

Returns:

The name of the tool.

parse_output(total_output: list[str], package: Package | None = None) list[Issue][source]

Parse tool output and report issues.

Parameters:
  • total_output – The output from the tool.

  • package – The package to scan.

Returns:

A list of issues parsed from the output.

process_files(package: Package, level: str, files: list[str], user_flags: list[str]) list[str] | None[source]

Run tool and gather output.

Parameters:
  • package – The package to scan.

  • level – The level of the scan.

  • files – The files to scan.

  • user_flags – The user flags to pass to the tool.

Returns:

The output from the tool.

statick_tool.plugins.tool.pyflakes module

Apply pyflakes tool and gather results.

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

Bases: ToolPlugin

Apply pyflakes tool and gather results.

get_file_types() list[str][source]

Return a list of file types the plugin can scan.

Returns:

A list of file types.

get_name() str[source]

Get name of tool.

Returns:

The name of the tool.

parse_output(total_output: list[str], package: Package | None = None) list[Issue][source]

Parse tool output and report issues.

Parameters:
  • total_output – The output from the tool.

  • package – The package to scan.

Returns:

A list of issues parsed from the output.

process_files(package: Package, level: str, files: list[str], user_flags: list[str]) list[str] | None[source]

Run tool and gather output.

Parameters:
  • package – The package to scan.

  • level – The level of the scan.

  • files – The files to scan.

  • user_flags – The user flags to pass to the tool.

Returns:

The output from the tool.

statick_tool.plugins.tool.pylint module

Apply pylint tool and gather results.

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

Bases: ToolPlugin

Apply pylint tool and gather results.

get_file_types() list[str][source]

Return a list of file types the plugin can scan.

Returns:

A list of file types.

get_name() str[source]

Get name of tool.

Returns:

The name of the tool.

parse_output(total_output: list[str], package: Package | None = None) list[Issue][source]

Parse tool output and report issues.

Parameters:
  • total_output – The output from the tool.

  • package – The package to scan.

Returns:

A list of issues parsed from the output.

process_files(package: Package, level: str, files: list[str], user_flags: list[str]) list[str] | None[source]

Run tool and gather output.

Parameters:
  • package – The package to scan.

  • level – The level of the scan.

  • files – The files to scan.

  • user_flags – The user flags to pass to the tool.

Returns:

The output from the tool.

statick_tool.plugins.tool.pyright module

Apply pyright tool and gather results.

class statick_tool.plugins.tool.pyright.PyrightToolPlugin[source]

Bases: ToolPlugin

Apply pyright tool and gather results.

get_file_types() list[str][source]

Return a list of file types the plugin can scan.

Returns:

List of file types.

get_name() str[source]

Get name of tool.

Returns:

Name of the tool.

parse_output(total_output: list[str], package: Package | None = None) list[Issue][source]

Parse tool output and report issues.

Parameters:
  • total_output – List of output strings.

  • package – The package being processed.

Returns:

List of issues found.

process_files(package: Package, level: str, files: list[str], user_flags: list[str]) list[str] | None[source]

Run tool and gather output.

Parameters:
  • package – The package to process.

  • level – The level to run the tool at.

  • files – List of files to process.

  • user_flags – List of user flags.

Returns:

List of output strings or None.

statick_tool.plugins.tool.rstcheck module

Apply rstcheck tool and gather results.

class statick_tool.plugins.tool.rstcheck.RstcheckToolPlugin[source]

Bases: ToolPlugin

Apply rstcheck tool and gather results.

get_file_types() list[str][source]

Return a list of file types the plugin can scan.

Returns:

A list of file types.

get_name() str[source]

Get name of tool.

Returns:

The name of the tool.

parse_output(total_output: list[str], package: Package | None = None) list[Issue][source]

Parse tool output and report issues.

Parameters:
  • total_output – The output from the tool.

  • package – The package to scan.

Returns:

A list of issues parsed from the output.

process_files(package: Package, level: str, files: list[str], user_flags: list[str]) list[str] | None[source]

Run tool and gather output.

Parameters:
  • package – The package to scan.

  • level – The level of the scan.

  • files – The files to scan.

  • user_flags – The user flags to pass to the tool.

Returns:

The output from the tool.

statick_tool.plugins.tool.rstlint module

Apply rst-lint tool and gather results.

class statick_tool.plugins.tool.rstlint.RstlintToolPlugin[source]

Bases: ToolPlugin

Apply rst-lint tool and gather results.

get_binary(level: str | None = None, package: Package | None = None) str[source]

Get tool binary name.

Parameters:
  • level – The level of the scan.

  • package – The package to scan.

Returns:

The binary name of the tool.

get_name() str[source]

Get name of tool.

Returns:

The name of the tool.

parse_tool_output(total_output: list[SystemMessage]) list[Issue][source]

Parse tool output and report issues.

Parameters:

total_output – The output from the tool.

Returns:

A list of issues parsed from the output.

scan(package: Package, level: str) list[Issue] | None[source]

Run tool and gather output.

Parameters:
  • package – The package to scan.

  • level – The level of the scan.

Returns:

A list of issues found by the tool.

statick_tool.plugins.tool.ruff module

Apply ruff tool and gather results.

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

Bases: ToolPlugin

Apply ruff tool and gather results.

get_file_types() list[str][source]

Return a list of file types the plugin can scan.

Returns:

A list of file types.

get_name() str[source]

Get name of tool.

Returns:

The name of the tool.

parse_output(total_output: list[str], package: Package | None = None) list[Issue][source]

Parse tool output and report issues.

Parameters:
  • total_output – The output from the tool.

  • package – The package to scan.

Returns:

A list of issues parsed from the output.

process_files(package: Package, level: str, files: list[str], user_flags: list[str]) list[str] | None[source]

Run tool and gather output.

Parameters:
  • package – The package to scan.

  • level – The level of the scan.

  • files – The files to scan.

  • user_flags – The user flags to pass to the tool.

Returns:

The output from the tool.

statick_tool.plugins.tool.shellcheck 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.ShellcheckToolPlugin[source]

Bases: ToolPlugin

Apply shellcheck tool and gather results.

gather_args(args: Namespace) None[source]

Gather arguments.

Parameters:

args – Flags for this plugin will be added to these existing arguments.

get_binary(level: str | None = None, package: Package | None = None) str[source]

Get tool binary name.

Parameters:
  • level – The level of the scan.

  • package – The package to scan.

Returns:

The binary name of the tool.

get_name() str[source]

Get name of tool.

Returns:

The name of the tool.

parse_json_output(output: Any) list[Issue][source]

Parse tool output and report issues.

Parameters:

output – The JSON output from the tool.

Returns:

A list of issues parsed from the output.

scan(package: Package, level: str) list[Issue] | None[source]

Run tool and gather output.

Parameters:
  • package – The package to scan.

  • level – The level of the scan.

Returns:

A list of issues found by the tool.

statick_tool.plugins.tool.spotbugs module

Apply spotbugs tool and gather results.

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

Bases: ToolPlugin

Apply spotbugs tool and gather results.

get_name() str[source]

Get name of tool.

Returns:

Name of the tool.

classmethod get_tool_dependencies() list[str][source]

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

Returns:

List of tool dependencies.

parse_file_output(output: str) list[Issue] | None[source]

Parse tool output and report issues.

Parameters:

output – Output string.

Returns:

List of issues or None.

scan(package: Package, level: str) list[Issue] | None[source]

Run tool and gather output.

Parameters:
  • package – The package to process.

  • level – The level to process.

Returns:

List of issues or None.

statick_tool.plugins.tool.stylelint module

Apply stylelint tool and gather results.

class statick_tool.plugins.tool.stylelint.StylelintToolPlugin[source]

Bases: ToolPlugin

Apply stylelint tool and gather results.

get_file_types() list[str][source]

Return a list of file types the plugin can scan.

Returns:

List of file types.

get_name() str[source]

Get name of tool.

Returns:

Name of the tool.

parse_output(total_output: list[str], package: Package | None = None) list[Issue][source]

Parse tool output and report issues.

Parameters:
  • total_output – List of output strings.

  • package – The package to process (optional).

Returns:

List of issues.

process_files(package: Package, level: str, files: list[str], user_flags: list[str]) list[str] | None[source]

Run tool and gather output.

Parameters:
  • package – The package to process.

  • level – The level to process.

  • files – List of files to process.

  • user_flags – List of user flags.

Returns:

List of output strings or None.

statick_tool.plugins.tool.uncrustify module

Apply uncrustify tool and gather results.

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

Bases: ToolPlugin

Apply uncrustify tool and gather results.

gather_args(args: Namespace) None[source]

Gather arguments.

Parameters:

args – Flags for this plugin will be added to these existing arguments.

get_binary(level: str | None = None, package: Package | None = None) str[source]

Get tool binary name.

Parameters:
  • level – The level to process (optional).

  • package – The package to process (optional).

Returns:

Name of the tool binary.

get_name() str[source]

Get name of tool.

Returns:

Name of the tool.

parse_output(total_output: list[str], package: Package | None = None) list[Issue][source]

Parse tool output and report issues.

Parameters:
  • total_output – List of output strings.

  • package – The package to process (optional).

Returns:

List of issues.

scan(package: Package, level: str) list[Issue] | None[source]

Run tool and gather output.

Parameters:
  • package – The package to process.

  • level – The level to process.

Returns:

List of issues or None.

statick_tool.plugins.tool.val_parser module

Apply VAL Parser tool and gather results.

Tool is from King’s College London. Tool authors are:

  • Maria Fox and Derek Long - PDDL2.2 and VAL

  • Richard Howey - PDDL2.2 and VAL and Continuous Effects, derived predicates, timed initial literals and LaTeX report in VAL

  • Stephen Cresswell - PDDL2.2 Parser

https://github.com/KCL-Planning/VAL/tree/master/applications#parser

class statick_tool.plugins.tool.val_parser.ValParserToolPlugin[source]

Bases: ToolPlugin

Apply Parser tool and gather results.

gather_args(args: Namespace) None[source]

Gather arguments.

Parameters:

args – Flags for this plugin will be added to these existing arguments.

get_binary(level: str | None = None, package: Package | None = None) str[source]

Get tool binary name.

Parameters:
  • level – The level to process (optional).

  • package – The package to process (optional).

Returns:

Name of the tool binary.

get_name() str[source]

Get name of tool.

Returns:

Name of the tool.

parse_tool_output(output: str) list[Issue][source]

Parse tool output and report issues.

Parameters:

output – Output string.

Returns:

List of issues.

scan(package: Package, level: str) list[Issue] | None[source]

Run tool and gather output.

Parameters:
  • package – The package to process.

  • level – The level to process.

Returns:

List of issues or None.

statick_tool.plugins.tool.val_validate module

Apply VAL Validate tool and gather results.

Tool is from King’s College London. Tool authors are:

  • Maria Fox and Derek Long - PDDL2.2 and VAL

  • Richard Howey - PDDL2.2 and VAL and Continuous Effects, derived predicates, timed initial literals and LaTeX report in VAL

  • Stephen Cresswell - PDDL2.2 Parser

https://github.com/KCL-Planning/VAL/tree/master/applications#validate

class statick_tool.plugins.tool.val_validate.ValValidateToolPlugin[source]

Bases: ToolPlugin

Apply Validate tool and gather results.

gather_args(args: Namespace) None[source]

Gather arguments.

Parameters:

args – Flags for this plugin will be added to these existing arguments.

get_binary(level: str | None = None, package: Package | None = None) str[source]

Get tool binary name.

Parameters:
  • level – The level to process (optional).

  • package – The package to process (optional).

Returns:

Name of the tool binary.

get_name() str[source]

Get name of tool.

Returns:

Name of the tool.

parse_tool_output(output: str, filename: str) list[Issue][source]

Parse tool output and report issues.

Parameters:
  • output – Output string.

  • filename – Name of the file.

Returns:

List of issues.

scan(package: Package, level: str) list[Issue] | None[source]

Run tool and gather output.

Parameters:
  • package – The package to process.

  • level – The level to process.

Returns:

List of issues or None.

statick_tool.plugins.tool.writegood module

Apply writegood tool and gather results.

Website: https://github.com/btford/write-good

class statick_tool.plugins.tool.writegood.WriteGoodToolPlugin[source]

Bases: ToolPlugin

Apply writegood tool and gather results.

get_binary(level: str | None = None, package: Package | None = None) str[source]

Get tool binary name.

Parameters:
  • level – The level to process (optional).

  • package – The package to process (optional).

Returns:

Name of the tool binary.

get_file_types() list[str][source]

Return a list of file types the plugin can scan.

Returns:

List of file types.

get_name() str[source]

Get name of tool.

Returns:

Name of the tool.

parse_output(total_output: list[str], package: Package | None = None) list[Issue][source]

Parse tool output and report issues.

Parameters:
  • total_output – List of output strings.

  • package – The package to process (optional).

Returns:

List of issues.

process_files(package: Package, level: str, files: list[str], user_flags: list[str]) list[str] | None[source]

Run tool and gather output.

Parameters:
  • package – The package to process.

  • level – The level to process.

  • files – List of files to process.

  • user_flags – List of user flags.

Returns:

List of output strings or None.

statick_tool.plugins.tool.xmllint module

Apply xmllint tool and gather results.

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

Bases: ToolPlugin

Apply xmllint tool and gather results.

get_file_types() list[str][source]

Return a list of file types the plugin can scan.

Returns:

List of file types.

get_name() str[source]

Get name of tool.

Returns:

Name of the tool.

parse_output(total_output: list[str], package: Package | None = None) list[Issue][source]

Parse tool output and report issues.

Parameters:
  • total_output – List of output strings.

  • package – The package to process (optional).

Returns:

List of issues.

process_files(package: Package, level: str, files: list[str], user_flags: list[str]) list[str] | None[source]

Run tool and gather output.

Parameters:
  • package – The package to process.

  • level – The level to process.

  • files – List of files to process.

  • user_flags – List of user flags.

Returns:

List of output strings or None.

statick_tool.plugins.tool.yamllint module

Apply yamllint tool and gather results.

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

Bases: ToolPlugin

Apply yamllint tool and gather results.

get_file_types() list[str][source]

Return a list of file types the plugin can scan.

Returns:

List of file types.

get_name() str[source]

Get name of tool.

Returns:

Name of the tool.

parse_output(total_output: list[str], package: Package | None = None) list[Issue][source]

Parse tool output and report issues.

Parameters:
  • total_output – List of output strings.

  • package – The package to process (optional).

Returns:

List of issues.

process_files(package: Package, level: str, files: list[str], user_flags: list[str]) list[str] | None[source]

Run tool and gather output.

Parameters:
  • package – The package to process.

  • level – The level to process.

  • files – List of files to process.

  • user_flags – List of user flags.

Returns:

List of output strings or None.