cloudcomputinghust/CAL

View on GitHub
calplus/tests/unit/conf/test_conf.py

Summary

Maintainability
A
50 mins
Test Coverage

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

    def test_list_opts(self):
        for group, opt_list in opts.list_opts():
            if isinstance(group, six.string_types):
                self.assertEqual(group, 'DEFAULT')
            else:
Severity: Minor
Found in calplus/tests/unit/conf/test_conf.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

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

    def test_load_config_file_to_realize_all_driver(self):
        CONF(['--config-file',
              'calplus/tests/fake_config_file.conf'])
        # TODO: Maybe we need remove example group,
        # such as: openstack and amazon
Severity: Minor
Found in calplus/tests/unit/conf/test_conf.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

TODO found
Open

        # TODO: Maybe we need remove example group,
Severity: Minor
Found in calplus/tests/unit/conf/test_conf.py by fixme

There are no issues that match your filters.

Category
Status