src/shoobx/rml2odt/flowable.py
File flowable.py
has 609 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
##############################################################################
#
# Copyright (c) 2017 Shoobx, Inc.
# All Rights Reserved.
#
Function _addSpaceHolders
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
Open
def _addSpaceHolders(self, text):
# ODF also squashes plain spaces, because it's XML
# need to add text:S tags to keep more than 1 space intact
# this is required for pre and xpre tags
span = odf.text.Span()
- 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 addSpan
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Open
def addSpan(self, text=None, styleName=None):
if text is not None:
if self.cleanText:
text = self._cleanText(text)
span = odf.text.Span(text=text)
- 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 inputImageIntoCell
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def inputImageIntoCell(self):
manager = attr.getManager(self)
paraStyleName = manager.getNextStyleName('ImagePara')
paraStyle = odf.style.Style(
family='paragraph',