2.2. codepeer module

GNAThub plug-in for the CodePeer command-line tool.

It exports the CodePeer class which implements the GNAThub.Plugin interface. This allows GNAThub’s plug-in scanner to automatically find this module and load it as part of the GNAThub default execution.

class codepeer.CodePeer[source]

Bases: Plugin, Runner, Reporter

CodePeer plugin for GNAThub.

Configures and executes CodePeer, then analyzes the output.

CODEPEER_TO_RANKING = {'annotation': 0, 'high': 5, 'info': 2, 'low': 3, 'medium': 4}
__init__()[source]

Initialize instance properties.

property output_dir

Return the path to the directory where to generate the Codepeer files

Returns:

the full path to the output directory

Return type:

str

report()[source]

Execute CodePeer message reader and parses the output.

Sets the exec_status property according to the success of the analysis:

  • GNAThub.EXEC_SUCCESS: on successful execution and analysis

  • GNAThub.EXEC_FAILURE: on any error

run()[source]

Execute CodePeer.

Sets the exec_status property according to the success of the execution of the tool:

  • GNAThub.EXEC_SUCCESS: on successful execution

  • GNAThub.EXEC_FAILURE: on any error