piccolbo/Pweave

View on GitHub

Showing 86 of 86 total issues

Avoid too many return statements within this function.
Open

            return "html"
Severity: Major
Found in pweave/formatters/__init__.py - About 30 mins to fix

    Function load_inline_string has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def load_inline_string(self, code_string):
            from nbconvert import filters
    
            outputs = self.loadstring(code_string)
            result = ""
    Severity: Minor
    Found in pweave/processors/jupyter.py - About 25 mins 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 _getoldresults has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def _getoldresults(self):
            """Get the results of previous run for documentation mode"""
    
            success = self.restore()
            if not success:
    Severity: Minor
    Found in pweave/processors/base.py - About 25 mins 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 formatfigure has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def formatfigure(self, chunk):
            result = ""
            figstring = ""
            for fig in chunk["figure"]:
                figstring += '<img src="%s" width="%s"/>\n' % (fig, chunk["width"])
    Severity: Minor
    Found in pweave/formatters/publish.py - About 25 mins 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 formatfigure has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def formatfigure(self, chunk):
            result = ""
            figstring = ""
    
            for fig in chunk["figure"]:
    Severity: Minor
    Found in pweave/formatters/publish.py - About 25 mins 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 publish has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    def publish(
        file, doc_format="html", theme="skeleton", latex_engine="pdflatex", output=None
    ):
        """Publish python script and results to html or pdf, expects that doc
        chunks are  written in markdown.
    Severity: Minor
    Found in pweave/__init__.py - About 25 mins 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

    Severity
    Category
    Status
    Source
    Language