intracom-telecom-sdn/nstat

View on GitHub

Showing 544 of 544 total issues

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

def test_io_error(self):
"""Test functionality of sysstats.sys_iowait_time function
"""
var = util.sysstats.sys_iowait_time()
self.assertTrue((var > 0) and isinstance(var, float),
Severity: Major
Found in util/unittests/test_sysstats.py and 5 other locations - About 5 hrs to fix
util/unittests/test_sysstats.py on lines 51..60
util/unittests/test_sysstats.py on lines 62..71
util/unittests/test_sysstats.py on lines 73..82
util/unittests/test_sysstats.py on lines 84..93
util/unittests/test_sysstats.py on lines 95..104

Cyclomatic complexity is too high in method test_selector. (23)
Open

def test_selector(self, args):
"""
Selects which test to run depending on the information coming from
the args object. nstat_test_type_run variable contains information
test_type + sb_emulator_name, necessary to select which test to run.
Severity: Minor
Found in stress_test/test_type.py by radon

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

    File test_html.py has 338 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/unittests/test_html.py - About 4 hrs 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

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

      class CtrlError(Exception):
      """
      Contains the exception handling concerning the Controller class
      functionalities.
      """
      Severity: Major
      Found in stress_test/controller_exceptions.py and 3 other locations - About 3 hrs to fix
      stress_test/nbemu_exceptions.py on lines 11..31
      stress_test/oftraf_exceptions.py on lines 11..31
      stress_test/sbemu_exceptions.py on lines 10..30

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

      class NBGenError(Exception):
      """
      Contains the exception handling concerning the North-Bound Emulator
      class functionalities.
      """
      Severity: Major
      Found in stress_test/nbemu_exceptions.py and 3 other locations - About 3 hrs to fix
      stress_test/controller_exceptions.py on lines 11..32
      stress_test/oftraf_exceptions.py on lines 11..31
      stress_test/sbemu_exceptions.py on lines 10..30

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

      class OftrafError(Exception):
      """
      Contains the exception handling concerning the Oftraf class
      functionalities.
      """
      Severity: Major
      Found in stress_test/oftraf_exceptions.py and 3 other locations - About 3 hrs to fix
      stress_test/controller_exceptions.py on lines 11..32
      stress_test/nbemu_exceptions.py on lines 11..31
      stress_test/sbemu_exceptions.py on lines 10..30

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

      class SBEmuError(Exception):
      """
      Contains the exception handling concerning the South-Bound Emulator
      class functionalities.
      """
      Severity: Major
      Found in stress_test/sbemu_exceptions.py and 3 other locations - About 3 hrs to fix
      stress_test/controller_exceptions.py on lines 11..32
      stress_test/nbemu_exceptions.py on lines 11..31
      stress_test/oftraf_exceptions.py on lines 11..31

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

      def multi_dict_to_html(data, table_title='', map_dictionary=None,
      row_ordering_key=None):
      """Generates html tables according to the input it gets from the input \
      arguments.
       
      Severity: Minor
      Found in util/html.py - About 3 hrs to fix

      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

      File plot_json.py has 318 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_json.py - About 3 hrs to fix

        File test_sysstats.py has 312 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/unittests/test_sysstats.py - About 3 hrs to fix

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

          if not util.netutil.isfile(self.ip, self.ssh_port,
          self.ssh_user, self.ssh_pass,
          [clean_hnd]):
          raise(IOError(
          '{0} clean handler does not exist'.
          Severity: Major
          Found in stress_test/oftraf.py and 3 other locations - About 3 hrs to fix
          stress_test/oftraf.py on lines 101..112
          stress_test/oftraf.py on lines 185..194
          stress_test/oftraf.py on lines 229..238

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

          if not util.netutil.isfile(self.ip,
          self.ssh_port,
          self.ssh_user,
          self.ssh_pass,
          [build_hnd]):
          Severity: Major
          Found in stress_test/oftraf.py and 3 other locations - About 3 hrs to fix
          stress_test/oftraf.py on lines 143..152
          stress_test/oftraf.py on lines 185..194
          stress_test/oftraf.py on lines 229..238

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

          if not util.netutil.isfile(self.ip, self.ssh_port,
          self.ssh_user, self.ssh_pass,
          [start_hnd]):
          raise(IOError(
          '{0} start handler does not exist'.
          Severity: Major
          Found in stress_test/oftraf.py and 3 other locations - About 3 hrs to fix
          stress_test/oftraf.py on lines 101..112
          stress_test/oftraf.py on lines 143..152
          stress_test/oftraf.py on lines 229..238

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

          if not util.netutil.isfile(self.ip, self.ssh_port,
          self.ssh_user, self.ssh_pass,
          [stop_hnd]):
          raise(IOError(
          '{0} stop handler does not exist'.
          Severity: Major
          Found in stress_test/oftraf.py and 3 other locations - About 3 hrs to fix
          stress_test/oftraf.py on lines 101..112
          stress_test/oftraf.py on lines 143..152
          stress_test/oftraf.py on lines 185..194

          File html_generation.py has 308 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 stress_test/html_generation.py - About 3 hrs to fix

            Cyclomatic complexity is too high in function multi_dict_to_html. (14)
            Open

            def multi_dict_to_html(data, table_title='', map_dictionary=None,
            row_ordering_key=None):
            """Generates html tables according to the input it gets from the input \
            arguments.
             
            Severity: Minor
            Found in util/html.py by radon

            Function merge_dict_and_avg has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
            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 - About 3 hrs to fix
            Severity
            Category
            Status
            Source
            Language