conan-io/conan

View on GitHub

Showing 364 of 2,550 total issues

Function _build has a Cognitive Complexity of 32 (exceeds 20 allowed). Consider refactoring.
Open

    def _build(self, nodes_by_level, keep_build, root_node, profile_host, profile_build, graph_lock,
               remotes, build_mode, update):
        using_build_profile = bool(profile_build)
        missing, invalid, downloads = self._classify(nodes_by_level)
        if invalid:
Severity: Minor
Found in conans/client/installer.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 _content has a Cognitive Complexity of 32 (exceeds 20 allowed). Consider refactoring.
Open

    def _content(self):
        result = {}

        # Generate the config files for each component with name conan_pkgname_compname.xcconfig
        # If a package has no components the name is conan_pkgname_pkgname.xcconfig
Severity: Minor
Found in conan/tools/apple/xcodedeps.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 deps_install has 23 arguments (exceeds 10 allowed). Consider refactoring.
Open

def deps_install(app, ref_or_path, install_folder, base_folder, graph_info, remotes=None,
Severity: Major
Found in conans/client/manager.py - About 2 hrs to fix

    Function _parse_compiler_version has a Cognitive Complexity of 31 (exceeds 20 allowed). Consider refactoring.
    Open

    def _parse_compiler_version(defines):
        try:
            if '__LCC__' in defines and '__e2k__' in defines:
                compiler = MCST_LCC
                version = int(defines['__LCC__'])
    Severity: Minor
    Found in conans/client/conf/compiler_id.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 _get_vars has a Cognitive Complexity of 31 (exceeds 20 allowed). Consider refactoring.
    Open

        def _get_vars(self):
            def append(*args):
                ret = []
                for arg in args:
                    if arg:
    Severity: Minor
    Found in conans/client/build/autotools_environment.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 content has a Cognitive Complexity of 30 (exceeds 20 allowed). Consider refactoring.
    Open

        def content(self):
            copied_files = []
    
            for dep_name in self.conanfile.deps_cpp_info.deps:
                rootpath = self.conanfile.deps_cpp_info[dep_name].rootpath
    Severity: Minor
    Found in conans/client/generators/deploy.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 from_node has a Cognitive Complexity of 30 (exceeds 20 allowed). Consider refactoring.
    Open

        def from_node(node):
            # TODO: This construction will be easier in 2.0
            build, test, host, private = [], [], [], []
            for edge in node.dependencies:
                if edge.build_require:
    Severity: Minor
    Found in conans/model/dependencies.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 export_pkg has 21 arguments (exceeds 10 allowed). Consider refactoring.
    Open

        def export_pkg(self, conanfile_path, name, channel, source_folder=None, build_folder=None,
    Severity: Major
    Found in conans/client/conan_api.py - About 1 hr to fix

      Function new has 21 arguments (exceeds 10 allowed). Consider refactoring.
      Open

          def new(self, name, header=False, pure_c=False, test=False, exports_sources=False, bare=False,
      Severity: Major
      Found in conans/client/conan_api.py - About 1 hr to fix

        Function cmd_new has 21 arguments (exceeds 10 allowed). Consider refactoring.
        Open

        def cmd_new(ref, header=False, pure_c=False, test=False, exports_sources=False, bare=False,
        Severity: Major
        Found in conans/client/cmd/new.py - About 1 hr to fix

          Function install_reference has 21 arguments (exceeds 10 allowed). Consider refactoring.
          Open

              def install_reference(self, reference, settings=None, options=None, env=None,
          Severity: Major
          Found in conans/client/conan_api.py - About 1 hr to fix

            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

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

                def _build(self, args=None, build_dir=None, target=None):
                    args = args or []
                    build_dir = build_dir or self.build_dir or self._conanfile.build_folder
                    if target is not None:
                        args = ["--target", target] + args
            Severity: Minor
            Found in conans/client/build/cmake.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 _process_node has a Cognitive Complexity of 29 (exceeds 20 allowed). Consider refactoring.
            Open

                def _process_node(self, node, pref, build_mode, update, remotes):
                    # Check that this same reference hasn't already been checked
                    if self._evaluate_is_cached(node, pref):
                        return
            
            
            Severity: Minor
            Found in conans/client/graph/graph_binaries.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 update_bundle has a Cognitive Complexity of 29 (exceeds 20 allowed). Consider refactoring.
            Open

                def update_bundle(bundle_path, revisions_enabled):
                    """ Update both the bundle information as well as every individual lockfile, from the
                    information that was modified in the individual lockfile. At the end, all lockfiles will
                    have the same PREV for the binary of same package_id
                    """
            Severity: Minor
            Found in conans/model/lock_bundle.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 _get_upload_modules_with_deps has a Cognitive Complexity of 29 (exceeds 20 allowed). Consider refactoring.
            Open

            def _get_upload_modules_with_deps(uploaded_files, downloaded_files):
                modules = []
                deps = defaultdict(set)  # Reference: [Reference, Reference]
                # Extract needed information
                for module_id, mod_doc in uploaded_files.items():
            Severity: Minor
            Found in conans/build_info/conan_build_info.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 run_in_windows_bash has a Cognitive Complexity of 28 (exceeds 20 allowed). Consider refactoring.
            Open

            def run_in_windows_bash(conanfile, bashcmd, cwd=None, subsystem=None, msys_mingw=True, env=None,
                                    with_login=True):
                """ Will run a unix command inside a bash terminal
                    It requires to have MSYS2, CYGWIN, or WSL
                """
            Severity: Minor
            Found in conans/client/tools/win.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 _get_toolset has a Cognitive Complexity of 28 (exceeds 20 allowed). Consider refactoring.
            Open

                def _get_toolset(self, generator):
                    if generator is None or ("Visual" not in generator and "Xcode" not in generator):
                        return None
                    settings = self._conanfile.settings
                    compiler = settings.get_safe("compiler")
            Severity: Minor
            Found in conan/tools/cmake/toolchain/blocks.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 __init__ has a Cognitive Complexity of 28 (exceeds 20 allowed). Consider refactoring.
            Open

                def __init__(self, deps_graph, revisions_enabled):
                    self._nodes = {}  # {id: GraphLockNode}
                    self._revisions_enabled = revisions_enabled
                    self._relaxed = False  # If True, the lock can be expanded with new Nodes
            
            
            Severity: Minor
            Found in conans/model/graph_lock.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 constraint has a Cognitive Complexity of 28 (exceeds 20 allowed). Consider refactoring.
            Open

                def constraint(self, constraint_def):
                    """ allows to restrict a given Settings object with the input of another Settings object
                    1. The other Settings object MUST be exclusively a subset of the former.
                       No additions allowed
                    2. If the other defines {"compiler": None} means to keep the full specification
            Severity: Minor
            Found in conans/model/settings.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

            Severity
            Category
            Status
            Source
            Language