intracom-telecom-sdn/multinet

View on GitHub
util/netutil.py

Summary

Maintainability
B
5 hrs
Test Coverage

Function copy_directory_to_target has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

def copy_directory_to_target(ipaddr, user, passwd, local_path, remote_path,
Severity: Minor
Found in util/netutil.py - About 45 mins to fix

    Function ssh_copy_file_to_target has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def ssh_copy_file_to_target(ipaddr, user, passwd, local_file, remote_file,
    Severity: Minor
    Found in util/netutil.py - About 45 mins to fix

      Function ssh_connect_or_return has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def ssh_connect_or_return(ipaddr, user, passwd, maxretries, remote_port=22):
      Severity: Minor
      Found in util/netutil.py - About 35 mins to fix

        Function create_remote_directory has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def create_remote_directory(ipaddr, user, passwd, remote_path, remote_port=22):
        Severity: Minor
        Found in util/netutil.py - About 35 mins to fix

          Function ssh_delete_file_if_exists has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def ssh_delete_file_if_exists(ipaddr, user, passwd, remote_file,
          Severity: Minor
          Found in util/netutil.py - About 35 mins to fix

            Function make_remote_file_executable has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def make_remote_file_executable(ipaddr, user, passwd, remote_file,
            Severity: Minor
            Found in util/netutil.py - About 35 mins to fix

              Function remove_remote_directory has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def remove_remote_directory(ipaddr, user, passwd, path, remote_port=22):
              Severity: Minor
              Found in util/netutil.py - About 35 mins to fix

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

                def copy_directory_to_target(ipaddr, user, passwd, local_path, remote_path,
                                             remote_port=22):
                    """Copy a local directory on a remote machine.
                
                    :param ipaddr: IP adress of the remote machine
                Severity: Minor
                Found in util/netutil.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