src/cistat/model/xunit_report.py
Xunitrpt
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Xunitrpt(object):
""" The XUnit Test Report Class.
Which represents an XML file as a test report in XUnit format.
The XSD refers to below document:
https://github.com/apache/maven-surefire/blob/master/maven-surefire-plugin/src/site/resources/xsd/surefire-test-report.xsd
Function accumulate_xunit_str
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
def accumulate_xunit_str(self, xunit=None):
""" Update data in given XUnit str to current XUnitReport Object
If supplied with malformed str or None, silently do nothing but return itself.
:param xunit: XUnit in a string
:return: XunitReport Object itself after the accumulation
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"