intracom-telecom-sdn/nstat

View on GitHub
util/netutil.py

Summary

Maintainability
D
2 days
Test Coverage

Showing 17 of 17 total issues

File netutil.py has 346 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright (c) 2015 Intracom S.A. Telecom Solutions. All rights reserved.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v1.0 which accompanies this distribution,
# and is available at http://www.eclipse.org/legal/epl-v10.html
Severity: Minor
Found in util/netutil.py - About 4 hrs to fix

    Function ssh_run_command has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

    def ssh_run_command(ssh_client, command_to_run, prefix='', lines_queue=None,
    print_flag=True, block_flag=True, getpty_flag=False):
    """
    Runs the specified command on a remote machine
     
     
    Severity: Minor
    Found in util/netutil.py - About 2 hrs to fix

    Cyclomatic complexity is too high in function ssh_run_command. (9)
    Open

    def ssh_run_command(ssh_client, command_to_run, prefix='', lines_queue=None,
    print_flag=True, block_flag=True, getpty_flag=False):
    """
    Runs the specified command on a remote machine
     
     
    Severity: Minor
    Found in util/netutil.py by radon

    Cyclomatic complexity is too high in function copy_dir_remote_to_local. (7)
    Open

    def copy_dir_remote_to_local(ip, ssh_port, username, password,
    remote_path, local_path):
    """
    Copy recursively remote directories (Copies all files and other \
    sub-directories).
    Severity: Minor
    Found in util/netutil.py by radon

    Function copy_dir_remote_to_local has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    def copy_dir_remote_to_local(ip, ssh_port, username, password,
    remote_path, local_path):
    """
    Copy recursively remote directories (Copies all files and other \
    sub-directories).
    Severity: Minor
    Found in util/netutil.py - About 1 hr to fix

    Function ssh_run_command has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def ssh_run_command(ssh_client, command_to_run, prefix='', lines_queue=None,
    Severity: Major
    Found in util/netutil.py - About 50 mins to fix

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

      def copy_dir_remote_to_local(ip, ssh_port, username, password,
      Severity: Minor
      Found in util/netutil.py - About 45 mins to fix

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

        def copy_dir_local_to_remote(ip, ssh_port, username, password,
        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(ip, ssh_port, username, password, local_file,
          Severity: Minor
          Found in util/netutil.py - About 45 mins to fix

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

            def create_dir_remote(ip, ssh_port, username, password, remote_path):
            Severity: Minor
            Found in util/netutil.py - About 35 mins to fix

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

              def ssh_connect_or_return(ip, ssh_port, username, password, maxretries):
              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(ip, port, username, password, remote_file):
                Severity: Minor
                Found in util/netutil.py - About 35 mins to fix

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

                  def isfile(ip, port, username, password, file_list):
                  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(ip, ssh_port, username, password, 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(ip, ssh_port, username, password, path):
                      Severity: Minor
                      Found in util/netutil.py - About 35 mins to fix

                        Function isfile has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def isfile(ip, port, username, password, file_list):
                        """
                        Checks if all files in a given list exist. All files are located \
                        remotely
                         
                         
                        Severity: Minor
                        Found in util/netutil.py - About 35 mins to fix

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

                        def copy_dir_local_to_remote(ip, ssh_port, username, password,
                        local_path, remote_path):
                        """Copy a local directory on a remote machine.
                         
                        :param connection: A named tuple with all the connection information. \
                        Severity: Minor
                        Found in util/netutil.py - About 25 mins to fix

                        There are no issues that match your filters.

                        Category
                        Status