intracom-telecom-sdn/nstat

View on GitHub

Showing 544 of 544 total issues

Identical blocks of code found in 2 locations. Consider refactoring.
Open

plt.legend(list(plots.values()),
[z_axis_key + ':' + str(k) for k in list(plots.keys())],
scatterpoints=1, loc=plot_options.legend_position, fontsize=8)
Severity: Major
Found in util/plot_utils.py and 1 other location - About 3 hrs to fix
util/plot_utils.py on lines 190..193

Similar blocks of code found in 2 locations. Consider refactoring.
Open

def test_vm_size(self):
"""Test functionality of sysstats.proc_vm_size function
"""
 
self.assertTrue(isinstance(util.sysstats.proc_vm_size(
Severity: Major
Found in util/unittests/test_sysstats.py and 1 other location - About 3 hrs to fix
util/unittests/test_sysstats.py on lines 205..217

Similar blocks of code found in 2 locations. Consider refactoring.
Open

def test_cpu_system_time(self):
"""Test functionality of sysstats.proc_cpu_system_time function
"""
 
self.assertTrue(
Severity: Major
Found in util/unittests/test_sysstats.py and 1 other location - About 3 hrs to fix
util/unittests/test_sysstats.py on lines 219..227

Identical blocks of code found in 2 locations. Consider refactoring.
Open

plt.legend(list(plots.values()),
[z_axis_key + ':' + str(k) for k in list(plots.keys())],
scatterpoints=1,
loc=plot_options.legend_position,
Severity: Major
Found in util/plot_utils.py and 1 other location - About 3 hrs to fix
util/plot_utils.py on lines 268..270

File oftraf.py has 282 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright (c) 2016 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 stress_test/oftraf.py - About 2 hrs to fix

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

    if results_thread['end_to_end_flows_operation_time'] != -1:
    results['end_to_end_installation_rate'] = \
    float(self.nbgen.total_flows) / \
    results_thread['end_to_end_flows_operation_time']
    else:
    Severity: Major
    Found in stress_test/monitor.py and 2 other locations - About 2 hrs to fix
    stress_test/monitor.py on lines 1029..1034
    stress_test/monitor.py on lines 1037..1041

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

    if results_thread['switch_operation_time'] != -1:
    results['add_switch_rate'] = \
    float(self.nbgen.total_flows) / \
    results_thread['switch_operation_time']
    else:
    Severity: Major
    Found in stress_test/monitor.py and 2 other locations - About 2 hrs to fix
    stress_test/monitor.py on lines 1018..1023
    stress_test/monitor.py on lines 1037..1041

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

    if results_thread['confirm_time'] != -1:
    results['add_confirm_rate'] = \
    float(self.nbgen.total_flows) / results_thread['confirm_time']
    else:
    results['add_confirm_rate'] = -1
    Severity: Major
    Found in stress_test/monitor.py and 2 other locations - About 2 hrs to fix
    stress_test/monitor.py on lines 1018..1023
    stress_test/monitor.py on lines 1029..1034

    Cyclomatic complexity is too high in function merge_dict_and_avg. (11)
    Open

    def merge_dict_and_avg(results_add, results_delete):
    """
    Takes two dictionaries results_add, results_delete and returns a merged \
    dictionary. Special purpose method for the NSTAT NorthBound \
    stress test.
    Severity: Minor
    Found in util/file_ops.py by radon

    Cyclomatic complexity is too high in method sb_idle_stability_multinet_run. (11)
    Open

    def sb_idle_stability_multinet_run(self,
    json_conf,
    json_output,
    output_dir):
    """
    Severity: Minor
    Found in stress_test/test_run.py by radon

    File controller_exceptions.py has 277 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # Copyright (c) 2016 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 stress_test/controller_exceptions.py - About 2 hrs to fix

      File plot_utils.py has 274 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/plot_utils.py - About 2 hrs to fix

        Cyclomatic complexity is too high in function command_exec_wrapper. (10)
        Open

        def command_exec_wrapper(cmd, ssh_client=None, return_type='str'):
        """
        Executes a command either locally or remotely and returns the result
         
        :param cmd: the command to be executed
        Severity: Minor
        Found in util/sysstats.py by radon

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        if (time.time() - t_discovery_start) > \
        self.nbgen.flows_ds_discovery_deadline:
        logging.info('[NB_emulator] [Poll_flows_switches thread] '
        'Deadline of {0} seconds passed'
        .format(self.flows_ds_discovery_deadline))
        Severity: Major
        Found in stress_test/monitor.py and 1 other location - About 2 hrs to fix
        stress_test/monitor.py on lines 796..806

        Cyclomatic complexity is too high in method sb_active_scalability_multinet_run. (10)
        Open

        def sb_active_scalability_multinet_run(self,
        json_conf,
        json_output,
        output_dir):
        """ Runs the SouthBound scalability test with active Multinet switches
        Severity: Minor
        Found in stress_test/test_run.py by radon

        Cyclomatic complexity is too high in method start. (10)
        Open

        def start(self):
        """
        Wrapper to the controller start handler
         
        :raises IOError: if the handler does not exist on the remote host
        Severity: Minor
        Found in stress_test/controller.py by radon

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

        def monitor_thread_active(self):
        """
        This monitor function is used from south bound active mtcbench \
        tests to put into gevent queue the results during test running
        """
        Severity: Minor
        Found in stress_test/monitor.py - About 2 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

        Similar blocks of code found in 8 locations. Consider refactoring.
        Open

        results['tcp_of_out_packets_per_sec'] = \
        (abs(float(oftraf_monitor_results['tcp_of_out_traffic'][0])) -
        reference_results['tcp_of_out_traffic'][0]) / traffic_gen_ms
        Severity: Major
        Found in stress_test/monitor.py and 7 other locations - About 2 hrs to fix
        stress_test/monitor.py on lines 627..629
        stress_test/monitor.py on lines 630..632
        stress_test/monitor.py on lines 633..635
        stress_test/monitor.py on lines 636..638
        stress_test/monitor.py on lines 642..644
        stress_test/monitor.py on lines 645..647
        stress_test/monitor.py on lines 648..650

        Similar blocks of code found in 8 locations. Consider refactoring.
        Open

        results['of_in_packets_per_sec'] = \
        (abs(float(oftraf_monitor_results['of_in_traffic'][0])) -
        reference_results['of_in_traffic'][0]) / traffic_gen_ms
        Severity: Major
        Found in stress_test/monitor.py and 7 other locations - About 2 hrs to fix
        stress_test/monitor.py on lines 627..629
        stress_test/monitor.py on lines 630..632
        stress_test/monitor.py on lines 636..638
        stress_test/monitor.py on lines 639..641
        stress_test/monitor.py on lines 642..644
        stress_test/monitor.py on lines 645..647
        stress_test/monitor.py on lines 648..650
        Severity
        Category
        Status
        Source
        Language