Showing 37 of 48 total issues
Function inputImageIntoCell
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def inputImageIntoCell(self):
manager = attr.getManager(self)
paraStyleName = manager.getNextStyleName('ImagePara')
paraStyle = odf.style.Style(
family='paragraph',
Function _applyAttributes
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _applyAttributes(self, stylemap, attrs):
start_col, start_row, end_col, end_row = self._getStartEndPos(attrs)
for col in range(start_col, end_col+1):
for row in range(start_row, end_row+1):
- 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"
Further reading
Function _doInnerGrid
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _doInnerGrid(self, stylemap, attrs):
start_col, start_row, end_col, end_row = self._getStartEndPos(attrs)
if start_row == end_row and start_col == end_col:
return
- 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"
Further reading
Function registerParagraphStyle
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def registerParagraphStyle(doc, name, rmlStyle):
if 'style.' in name:
name = name[6:]
odtStyle = odf.style.Style(name=name, family='paragraph')
Function _doZebraRows
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _doZebraRows(self, stylemap, attrs):
start_col, start_row, end_col, end_row = self._getStartEndPos(attrs)
colors = attrs['cellProps']['backgroundcolors']
for col in range(start_col, end_col+1):
idx = 0
- 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"
Further reading
Function getStyleMap
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def getStyleMap(self):
# prepare a map of styles for each cell in the table
stylemap = [
[_styleCell()
for r in range(self.rows)] for c in range(self.columns)]
- 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"
Further reading
Function process
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def process(self):
# if we have a bulkData tag, let's have first TableBulkData
# process the data by adding tr and td tags
# XXX: might be simpler to grasp if this would be done here
# and we'd just drop the bulkData child tag
- 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"
Further reading
Avoid deeply nested control flow statements. Open
if aname.startswith(where):
aname = aname[len(where):]
odtname = self.lineAttributesMapping[aname]
borders[targetAttr][odtname] = avalue
Avoid deeply nested control flow statements. Open
if dash[0] in (1, 2):
style = 'dotted'
elif dash[0] in (3, 4):
style = 'fine-dashed'
else:
Function _doZebraCols
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _doZebraCols(self, stylemap, attrs):
start_col, start_row, end_col, end_row = self._getStartEndPos(attrs)
colors = attrs['cellProps']['backgroundcolors']
idx = 0
for col in range(start_col, end_col+1):
- 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"
Further reading
Avoid deeply nested control flow statements. Open
if 'bulletFormat' in attrs:
bulletFormat = attrs['bulletFormat']
pre, post = bulletFormat.split('%s')
levelstyle.setAttribute('numprefix', pre)
levelstyle.setAttribute('numsuffix', post)
Avoid deeply nested control flow statements. Open
if 'start' in attrs:
start = attrs['start']
if isinstance(start, int):
bulletType = None
else:
Avoid deeply nested control flow statements. Open
if 'bulletType' in attrs:
bulletType = attrs['bulletType']
levelstyle.setAttribute('numformat', bulletType)
Function registerListStyle
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def registerListStyle(doc, name, rmlStyle, attributes=None, ulol=None):
Function _getParaStyle
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _getParaStyle(self):
# Any childnodes that are paragraphs must have a special style
# for indentation purposes.
node = top = self
- 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"
Further reading
Function _convertSimpleContent
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _convertSimpleContent(self):
# Check whether we need to create a para element.
# Any paragraphs should specifically have the lists paragraph style:
para_style = self._getParaStyle()
- 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"
Further reading
Function _doOutline
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _doOutline(self, stylemap, attrs):
start_col, start_row, end_col, end_row = self._getStartEndPos(attrs)
border = attrs['border']
- 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"