sepandhaghighi/csv2latex

View on GitHub

Showing 4 of 6 total issues

Function create_latex has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

def create_latex(file_name,dir_folder="LaTeX",empty_space=True):

    '''

    :param file_name: file name of latex file 9(as string)
Severity: Minor
Found in csv2latex/csv2LaTeX.py - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function white_space has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

def white_space(line_list):
    '''

    :param line_list: list of lines as input (list of strings)
    :return: list of comma seperated item in plain text for spacing in next step
Severity: Minor
Found in csv2latex/csv2LaTeX.py - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Avoid deeply nested control flow statements.
Open

                    if len(item) > len_list[i]:
                        len_list[i] = len(item)
    return len_list
Severity: Major
Found in csv2latex/csv2LaTeX.py - About 45 mins to fix

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

    def escape_char(lines_list):
        '''
    
        :param lines_list: list of lines as input (list of strings)
        :return: list of lines after escape character
    Severity: Minor
    Found in csv2latex/csv2LaTeX.py - About 25 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Severity
    Category
    Status
    Source
    Language