Function _on_exit_cleanup
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def _on_exit_cleanup(self):
""" Gets called when the application exists """
if self._do_cleanup:
self.debug("Cleaning up ..")
- 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 _is_pid_running
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _is_pid_running(self, pid):
""" Checks if a pid is still running """
# Code snippet from:
# http://stackoverflow.com/questions/568271/how-to-check-if-there-exists-a-process-with-a-given-pid
- 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 mount
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def mount(self):
""" Inits the VFS Mounts. This creates the following virtual directory
structure, from which all files can be located:
/$$rp/ (Mounted from the render pipeline base directory)
- 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 False
Function get_lock
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_lock(self):
""" Checks if we are the only instance running. If there is no instance
running, write the current PID to the instance.pid file. If the
instance file exists, checks if the specified process still runs. This
way only 1 instance of the pipeline can be run at one time. """
- 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"