intracom-telecom-sdn/nstat

View on GitHub
stress_test/test_run.py

Summary

Maintainability
F
2 wks
Test Coverage

Showing 24 of 24 total issues

File test_run.py has 775 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: Major
Found in stress_test/test_run.py - About 1 day to fix

    Cyclomatic complexity is too high in method nb_active_scalability_multinet_run. (19)
    Open

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

    Function nb_active_scalability_multinet_run has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

    def nb_active_scalability_multinet_run(self,
    json_conf,
    json_output,
    output_dir):
    """ Runs the NorthBound scalability test with idle Multinet switches
    Severity: Minor
    Found in stress_test/test_run.py - About 3 hrs to fix

    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

    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 sb_idle_scalability_multinet_run. (9)
    Open

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

    Cyclomatic complexity is too high in class TestRun. (9)
    Open

    class TestRun:
    """
    Creates a Test run object
    """
    def __init__(self, args, json_conf, test_type):
    Severity: Minor
    Found in stress_test/test_run.py by radon

    Cyclomatic complexity is too high in method __init__. (6)
    Open

    def __init__(self, args, json_conf, test_type):
    """
    Initializes the appropriate test component objects according to the
    test_type and the test configuration json object, in order to prepare
    the test for running
    Severity: Minor
    Found in stress_test/test_run.py by radon

    Cyclomatic complexity is too high in method sb_active_stability_mtcbench_run. (6)
    Open

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

    Cyclomatic complexity is too high in method sb_active_scalability_mtcbench_run. (6)
    Open

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

    Cyclomatic complexity is too high in method sb_idle_scalability_mtcbench_run. (6)
    Open

    def sb_idle_scalability_mtcbench_run(self, json_conf, json_output,
    output_dir):
    """
    Runs the SouthBound scalability test with idle MT-Cbench switches
     
     
    Severity: Minor
    Found in stress_test/test_run.py by radon

    Function sb_idle_stability_multinet_run has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    def sb_idle_stability_multinet_run(self,
    json_conf,
    json_output,
    output_dir):
    """
    Severity: Minor
    Found in stress_test/test_run.py - About 1 hr to fix

    Function sb_active_scalability_multinet_run has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    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 - About 1 hr to fix

    Function sb_idle_scalability_multinet_run has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    def sb_idle_scalability_multinet_run(self,
    json_conf,
    json_output,
    output_dir):
    """
    Severity: Minor
    Found in stress_test/test_run.py - About 1 hr to fix

    Function __init__ has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    def __init__(self, args, json_conf, test_type):
    """
    Initializes the appropriate test component objects according to the
    test_type and the test configuration json object, in order to prepare
    the test for running
    Severity: Minor
    Found in stress_test/test_run.py - About 1 hr to fix

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

    def sb_active_stability_mtcbench_run(self,
    json_conf,
    json_output,
    output_dir):
    """
    Severity: Major
    Found in stress_test/test_run.py and 1 other location - About 4 days to fix
    stress_test/test_run.py on lines 176..254

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

    def sb_active_scalability_mtcbench_run(self,
    json_conf,
    json_output,
    output_dir):
    """
    Severity: Major
    Found in stress_test/test_run.py and 1 other location - About 4 days to fix
    stress_test/test_run.py on lines 94..174

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

    try:
    # OFTRAF preparation
    # ------------------------------------------------------------------
    self.of.build()
     
     
    Severity: Major
    Found in stress_test/test_run.py and 3 other locations - About 6 hrs to fix
    stress_test/test_run.py on lines 340..406
    stress_test/test_run.py on lines 459..511
    stress_test/test_run.py on lines 679..840

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

    try:
     
    # Configuring controller for FLOWS_MODS
    # ------------------------------------------------------------------
    self.ctrl.flowmods_config()
    Severity: Major
    Found in stress_test/test_run.py and 3 other locations - About 6 hrs to fix
    stress_test/test_run.py on lines 459..511
    stress_test/test_run.py on lines 558..626
    stress_test/test_run.py on lines 679..840

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

    try:
    global_sample_id = 0
    for (self.sb_emu.topo_size,
    self.sb_emu.topo_group_size,
    self.sb_emu.topo_group_delay_ms,
    Severity: Major
    Found in stress_test/test_run.py and 3 other locations - About 6 hrs to fix
    stress_test/test_run.py on lines 340..406
    stress_test/test_run.py on lines 558..626
    stress_test/test_run.py on lines 679..840

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

    try:
    self.ctrl.flowmods_config()
     
    # TEST run
    # ---------------------------------------------------------------
    Severity: Major
    Found in stress_test/test_run.py and 3 other locations - About 6 hrs to fix
    stress_test/test_run.py on lines 340..406
    stress_test/test_run.py on lines 459..511
    stress_test/test_run.py on lines 558..626

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

    for (self.sb_emu.threads,
    self.sb_emu.switches_per_thread,
    self.sb_emu.thread_creation_delay_ms,
    self.sb_emu.delay_before_traffic_ms,
    self.sb_emu.simulated_hosts,
    Severity: Major
    Found in stress_test/test_run.py and 2 other locations - About 1 hr to fix
    stress_test/test_run.py on lines 353..365
    stress_test/test_run.py on lines 461..474

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

    for (self.sb_emu.topo_size,
    self.sb_emu.topo_type,
    self.sb_emu.topo_hosts_per_switch,
    self.sb_emu.topo_group_size,
    self.sb_emu.topo_group_delay_ms,
    Severity: Major
    Found in stress_test/test_run.py and 2 other locations - About 1 hr to fix
    stress_test/test_run.py on lines 271..283
    stress_test/test_run.py on lines 461..474

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

    for (self.sb_emu.topo_size,
    self.sb_emu.topo_group_size,
    self.sb_emu.topo_group_delay_ms,
    self.sb_emu.topo_hosts_per_switch,
    self.sb_emu.topo_type,
    Severity: Major
    Found in stress_test/test_run.py and 2 other locations - About 1 hr to fix
    stress_test/test_run.py on lines 271..283
    stress_test/test_run.py on lines 353..365

    There are no issues that match your filters.

    Category
    Status