caellion-python-commons
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
pathpath to the file in which the issue happens
severityseverity level for the issue, allowed options are LOW, NORMAL, HIGH, CRITICAL or ERROR
messageissue message (brief description of the problem)
lineStartline at which issue happens or starting line of a block in which it happens
lineEndending line of a block in which issue hapens
columnStartcolumn at which issue happens or starting column of a block in which it happens
columnEndending column of a block in which issue happens
categoryissue category to show in jenkins
typeissue type to show in jenkins
descriptionissue description (longer and more precise than message)
packageNamefully qualified name of the package in which the issue happens
moduleNamefully qualifies name of the module in which the issue happens
additionalPropertiesadditional 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
pathpath 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: