tobspr/RenderPipeline

View on GitHub
rpcore/mount_manager.py

Summary

Maintainability
B
5 hrs
Test Coverage

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 ..")
Severity: Minor
Found in rpcore/mount_manager.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 _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
Severity: Minor
Found in rpcore/mount_manager.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 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)
Severity: Minor
Found in rpcore/mount_manager.py - About 55 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

Avoid too many return statements within this function.
Open

                return False
Severity: Major
Found in rpcore/mount_manager.py - About 30 mins to fix

    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. """
    Severity: Minor
    Found in rpcore/mount_manager.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

    There are no issues that match your filters.

    Category
    Status