conan-io/conan

View on GitHub
conans/client/importer.py

Summary

Maintainability
A
2 hrs
Test Coverage

Function __call__ has a Cognitive Complexity of 29 (exceeds 20 allowed). Consider refactoring.
Open

    def __call__(self, pattern, dst="", src="", root_package=None, folder=False,
                 ignore_case=True, excludes=None, keep_path=True):
        """
        param pattern: an fnmatch file pattern of the files that should be copied. Eg. *.dll
        param dst: the destination local folder, wrt to current conanfile dir, to which
Severity: Minor
Found in conans/client/importer.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

Avoid deeply nested control flow statements.
Open

                        if isinstance(src_dirs, list):  # it can return a "config" CppInfo item!
                            src_dirs += src_dir

Severity: Major
Found in conans/client/importer.py - About 45 mins to fix

    There are no issues that match your filters.

    Category
    Status