Shoobx/shoobx.rml2odt

View on GitHub
src/shoobx/rml2odt/flowable.py

Summary

Maintainability
D
2 days
Test Coverage

File flowable.py has 609 lines of code (exceeds 250 allowed). Consider refactoring.
Open

##############################################################################
#
# Copyright (c) 2017 Shoobx, Inc.
# All Rights Reserved.
#
Severity: Major
Found in src/shoobx/rml2odt/flowable.py - About 1 day to fix

    Function _addSpaceHolders has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    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()
    Severity: Minor
    Found in src/shoobx/rml2odt/flowable.py - About 2 hrs to fix

    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

        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)
    Severity: Minor
    Found in src/shoobx/rml2odt/flowable.py - About 1 hr to fix

    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

        def inputImageIntoCell(self):
            manager = attr.getManager(self)
            paraStyleName = manager.getNextStyleName('ImagePara')
            paraStyle = odf.style.Style(
                family='paragraph',
    Severity: Minor
    Found in src/shoobx/rml2odt/flowable.py - About 1 hr to fix

      There are no issues that match your filters.

      Category
      Status