caellion-python-commons: caellion.pycommons.codeanalysis.reports.ReportBuilder Class Reference

caellion-python-commons

Public Member Functions | Static Public Attributes | List of all members
caellion.pycommons.codeanalysis.reports.ReportBuilder Class Reference

This class provides a set of methods to create reports that are compatible with Jenkins' warnings-ng plugin. More...

## Public Member Functions
def | __init__ (self)
| Initialize the ReportBuilder. More...
def | extract_basename_file (self, path)
| Extracts basename of a given path (only files). More...
def | addIssue (self, path, severity, message, lineStart=-1, lineEnd=-1, columnStart=-1, columnEnd=-1, category=None, type=None, description=None, packageName=None, moduleName=None, additionalProperties=None)
| Adds a new issue to the report. More...
def | generateReport (self)
| Generates the report in json format. More...

## Static Public Attributes
| issues_all = None

## Detailed Description

This class provides a set of methods to create reports that are compatible with Jenkins' warnings-ng plugin.

Definition at line 9 of file reports.py.

## Constructor & Destructor Documentation

## ◆ __init__()

def caellion.pycommons.codeanalysis.reports.ReportBuilder.__init__ | ( |  | self | ) |

Initialize the ReportBuilder.

Definition at line 16 of file reports.py.

## Member Function Documentation

## ◆ addIssue()

def caellion.pycommons.codeanalysis.reports.ReportBuilder.addIssue | ( |  | self,
|  |  | path,
|  |  | severity,
|  |  | message,
|  |  | lineStart = `-1`,
|  |  | lineEnd = `-1`,
|  |  | columnStart = `-1`,
|  |  | columnEnd = `-1`,
|  |  | category = `None`,
|  |  | type = `None`,
|  |  | description = `None`,
|  |  | packageName = `None`,
|  |  | moduleName = `None`,
|  |  | additionalProperties = `None`
| ) |  |

Adds a new issue to the report.

Warning
  This function will not add duplicate issue to the report

Parameters

  path | path to the file in which the issue happens
  severity | severity level for the issue, allowed options are LOW, NORMAL, HIGH, CRITICAL or ERROR
  message | issue message (brief description of the problem)
  lineStart | line at which issue happens or starting line of a block in which it happens
  lineEnd | ending line of a block in which issue hapens
  columnStart | column at which issue happens or starting column of a block in which it happens
  columnEnd | ending column of a block in which issue happens
  category | issue category to show in jenkins
  type | issue type to show in jenkins
  description | issue description (longer and more precise than message)
  packageName | fully qualified name of the package in which the issue happens
  moduleName | fully qualifies name of the module in which the issue happens
  additionalProperties | additional parameters to pass to Jenkins' warnings-ng plugin

Definition at line 36 of file reports.py.

## ◆ extract_basename_file()

def caellion.pycommons.codeanalysis.reports.ReportBuilder.extract_basename_file | ( |  | self,
|  |  | path
| ) |  |

Extracts basename of a given path (only files).

Should Work with any OS Path on any OS

Parameters

  path | path to get base folder path of

Returns
  base folder path

Definition at line 25 of file reports.py.

## ◆ generateReport()

def caellion.pycommons.codeanalysis.reports.ReportBuilder.generateReport | ( |  | self | ) |

Generates the report in json format.

Returns
  json-formatted dictionary containing all issues and _class header

Definition at line 106 of file reports.py.

## Member Data Documentation

## ◆ issues_all

caellion.pycommons.codeanalysis.reports.ReportBuilder.issues_all = None
| static

Definition at line 14 of file reports.py.

The documentation for this class was generated from the following file:

- caellion/pycommons/codeanalysis/reports.py