Function write_equalsize_bedfile
has a Cognitive Complexity of 24 (exceeds 15 allowed). Consider refactoring. Open
def write_equalsize_bedfile(bedfile, size, outfile):
"""Read input from <bedfile>, set the size of all entries to <size> and
write the result to <outfile>.
Input file needs to be in BED or WIG format."""
if size is None or size <= 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 determine_file_type
has a Cognitive Complexity of 24 (exceeds 15 allowed). Consider refactoring. Open
def determine_file_type(fname):
"""
Detect file type.
The following file types are supported:
- 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 warn_no_summit:
logger.warning(
"No summit present in narrowPeak file, "
"using the peak center."
)
Avoid too many return
statements within this function. Open
return "unknown"
Avoid too many return
statements within this function. Open
return "unknown"
Avoid too many return
statements within this function. Open
return "narrowpeak"
Avoid too many return
statements within this function. Open
return "unknown"
Avoid too many return
statements within this function. Open
return "region"
Avoid too many return
statements within this function. Open
return "bed"
Function pfmfile_location
has a Cognitive Complexity of 16 (exceeds 15 allowed). Consider refactoring. Open
def pfmfile_location(infile=None):
"""Return the path to the pfmfile"""
config = MotifConfig()
if infile is None:
- 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"