statick_tool.plugins.reporting package

Module contents

Default reporting plugins for Statick.

Submodules

statick_tool.plugins.reporting.code_climate module

Prints the Statick reports out to the terminal or file in Code Climate JSON.

class statick_tool.plugins.reporting.code_climate.CodeClimateReportingPlugin[source]

Bases: ReportingPlugin

Prints the Statick reports out to the terminal or file in Code Climate JSON.

classmethod get_issue_dict(issue: Issue, category_mapping: dict[str, str], gitlab: bool) dict[str, Any][source]

Convert Issue object into dictionary.

Parameters:
  • issue – The Issue object to convert.

  • category_mapping – A dictionary mapping issue categories.

  • gitlab – A boolean indicating if the output is for GitLab.

Returns:

A dictionary representation of the issue.

get_name() str[source]

Return the plugin name.

report(package: Package, issues: dict[str, list[Issue]], level: str) Tuple[None, bool][source]

Go through the issues list and print them in JSON format.

Parameters:
  • package – The Package object that was analyzed.

  • issues – The issues found by the Statick analysis, keyed by the tool that found them.

  • level – Name of the level used in the scan.

Returns:

None, True if the report was successfully printed, otherwise None, False.

write_output(package: Package, level: str, line: str) bool[source]

Write JSON output to a file.

Parameters:
  • package – The Package object that was analyzed.

  • level – Name of the level used in the scan.

  • line – The JSON string to write to the file.

Returns:

True if the output was successfully written, otherwise False.

statick_tool.plugins.reporting.do_nothing module

Do nothing to have a default reporting plugin with no side effects.

class statick_tool.plugins.reporting.do_nothing.DoNothingReportingPlugin[source]

Bases: ReportingPlugin

Do nothing.

get_name() str[source]

Return the name of the plugin.

report(package: Package, issues: dict[str, list[Issue]], level: str) Tuple[None, bool][source]

Do nothing.

Parameters:
  • package – The Package object that was analyzed.

  • issues – The issues found by the Statick analysis, keyed by the tool that found them.

  • level – Name of the level used in the scan.

Returns:

None, True indicating the report was processed (even though nothing was done).

statick_tool.plugins.reporting.json module

Prints the Statick reports out to the terminal or file in JSON format.

class statick_tool.plugins.reporting.json.JsonReportingPlugin[source]

Bases: ReportingPlugin

Prints the Statick reports out to the terminal or file in JSON format.

get_name() str[source]

Return the plugin name.

report(package: Package, issues: dict[str, list[Issue]], level: str) Tuple[None, bool][source]

Go through the issues list and print them in JSON format.

Parameters:
  • package – The Package object that was analyzed.

  • issues – The issues found by the Statick analysis, keyed by the tool that found them.

  • level – Name of the level used in the scan.

Returns:

None, True if the report was successfully printed, otherwise None, False.

write_output(package: Package, level: str, line: str) bool[source]

Write JSON output to a file.

Parameters:
  • package – The Package object that was analyzed.

  • level – Name of the level used in the scan.

  • line – The JSON string to write to the file.

Returns:

True if the output was successfully written, otherwise False.

statick_tool.plugins.reporting.print_to_console module

Write issue reports to the console.

class statick_tool.plugins.reporting.print_to_console.PrintToConsoleReportingPlugin[source]

Bases: ReportingPlugin

Prints the Statick reports out to the terminal.

get_name() str[source]

Return the name of the plugin.

report(package: Package, issues: dict[str, list[Issue]], level: str) Tuple[None, bool][source]

Go through the issues list and print them to the console.

Parameters:
  • package – The Package object that was analyzed.

  • issues – The issues found by the Statick analysis, keyed by the tool that found them.

  • level – Name of the level used in the scan.

Returns:

None, True if the report was successfully printed, otherwise None, False.

statick_tool.plugins.reporting.write_jenkins_warnings_ng module

Write Statick results to Jenkins Warnings-NG plugin json-log compatible output.

class statick_tool.plugins.reporting.write_jenkins_warnings_ng.WriteJenkinsWarningsNGReportingPlugin[source]

Bases: ReportingPlugin

Writes Statick results to Jenkins Warnings-NG json-log compatible output.

get_name() str[source]

Return the plugin name.

report(package: Package, issues: dict[str, list[Issue]], level: str) Tuple[None, bool][source]

Write the results to Jenkins Warnings-NG plugin compatible file.

Parameters:
  • package – The Package object that was analyzed.

  • issues – The issues found by the Statick analysis, keyed by the tool that found them.

  • level – Name of the level used in the scan.

Returns:

None, True if the report was successfully written, otherwise None, False.