Showing 46 of 86 total issues
Function format_text_result
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def format_text_result(self, text, chunk):
chunk["result"] = text
result = ""
if "%s" in chunk["outputstart"]:
chunk["outputstart"] = chunk["outputstart"] % self.language
- 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 __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function parsetitle
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def parsetitle(self, chunk):
"""Parse titleblock from first doc chunk, like Pandoc"""
lines = chunk["content"].splitlines()
if len(lines) > 3:
if lines[0].startswith("%"):
- 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 parsetitle
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def parsetitle(self, chunk):
"""Parse titleblock from first doc chunk, like Pandoc"""
lines = chunk["content"].splitlines()
if len(lines) > 3:
if lines[0].startswith("%"):
- 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 run
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def run(self):
# Create directory for figures
self.ensureDirectoryExists(self.getFigDirectory())
# Documentation mode uses results from previous executions
# so that compilation is fast if you only work on doc chunks
- 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 __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function loadinline
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def loadinline(self, content):
"""Evaluate code from doc chunks using ERB markup"""
# Flags don't work with ironpython
splitted = re.split("(<%[\w\s\W]*?%>)", content) # , flags = re.S)
# No inline code
- 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 figures_from_chunk
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def figures_from_chunk(self, chunk):
"""Extract base64 encoded figures from chunk"""
figs = []
i = 1
for out in chunk["result"]:
- 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 __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, parsed, kernel, source, docmode, figdir, outdir):
Function convert
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def convert(
Function publish
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def publish(
Function formatfigure
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def formatfigure(self, chunk):
fignames = chunk["figure"]
caption = chunk["caption"]
width = chunk["width"]
result = ""
- 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 convert
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def convert(self):
output = []
if self.outformat == "noweb":
code = "<<%s>>=%s\n@\n"
- 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 formatfigure
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def formatfigure(self, chunk):
fignames = chunk["figure"]
if chunk["caption"]:
- 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 too many return
statements within this function. Open
return ""
Avoid too many return
statements within this function. Open
return self.render_text(out["data"]["text/plain"], chunk)
Avoid too many return
statements within this function. Open
return chunks
Avoid too many return
statements within this function. Open
return ""
Avoid too many return
statements within this function. Open
return chunk
Avoid too many return
statements within this function. Open
return "markdown"