intracom-telecom-sdn/nstat

View on GitHub
util/html.py

Summary

Maintainability
C
1 day
Test Coverage

Showing 11 of 11 total issues

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

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

Cyclomatic complexity is too high in function single_dict_to_html. (8)
Open

def single_dict_to_html(data, key_title, data_title, table_title='',
map_dictionary=None):
"""
Generates html tables according to the input it gets from the input \
arguments. The table generated is by row, which means that on each row \
Severity: Minor
Found in util/html.py by radon

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

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

    def single_dict_to_html(data, key_title, data_title, table_title='',
    map_dictionary=None):
    """
    Generates html tables according to the input it gets from the input \
    arguments. The table generated is by row, which means that on each row \
    Severity: Minor
    Found in util/html.py - About 1 hr to fix

    Function isalistofdictionaries has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def isalistofdictionaries(lst):
    """
    Takes a list as argument and checks if all the elements of this list \
    are dictionaries. If they are then it returns true, else it returns \
    false. If the input argument type is not list then it also returns \
    Severity: Minor
    Found in util/html.py - About 55 mins to fix

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

    def single_dict_to_html(data, key_title, data_title, table_title='',
    Severity: Minor
    Found in util/html.py - About 35 mins to fix

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

      def single_dict_table_data(data_values, td_style=None, td_class=None):
      """
      Returns a <td> ... </td> html element for the single_dict_to_html() \
      type of tables, data columns. In case that the input data_values is a \
      list of dictionaries, this function calls recursively \
      Severity: Minor
      Found in util/html.py - About 25 mins to fix

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

      if row_ordered_index % 2 == 0:
      row_str = row_str + '<tr>'
      else:
      row_str = row_str + '<tr class=\"odd\">'
      Severity: Major
      Found in util/html.py and 2 other locations - About 1 hr to fix
      util/html.py on lines 154..157
      util/html.py on lines 261..264

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

      if num_row % 2 == 0:
      table_html = table_html + '<tr>'
      else:
      table_html = table_html + '<tr class=\"odd\">'
      Severity: Major
      Found in util/html.py and 2 other locations - About 1 hr to fix
      util/html.py on lines 261..264
      util/html.py on lines 278..281

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

      if row_ordered_index % 2 == 0:
      row_str = row_str + '<tr>'
      else:
      row_str = row_str + '<tr class=\"odd\">'
      Severity: Major
      Found in util/html.py and 2 other locations - About 1 hr to fix
      util/html.py on lines 154..157
      util/html.py on lines 278..281

      There are no issues that match your filters.

      Category
      Status