tk0miya/testing.mysqld

View on GitHub

Showing 4 of 4 total issues

Function initialize_database has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    def initialize_database(self):
        # assign port if networking not disabled
        if 'port' not in self.my_cnf and 'skip-networking' not in self.my_cnf:
            self.my_cnf['port'] = get_unused_port()

Severity: Minor
Found in src/testing/mysqld.py - About 1 hr 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 find_program has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

def find_program(name, subdirs):
    path = get_path_of(name)
    if path:
        return path

Severity: Minor
Found in src/testing/mysqld.py - About 1 hr 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 dsn has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def dsn(self, **kwargs):
        params = dict(kwargs)

        if 'port' in self.my_cnf:
            params.setdefault('port', self.my_cnf['port'])
Severity: Minor
Found in src/testing/mysqld.py - About 35 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

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

    def url(self, **kwargs):
        params = self.dsn(**kwargs)

        driver = params.get('driver', 'pymysql')

Severity: Minor
Found in src/testing/mysqld.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