conan-io/conan

View on GitHub

Showing 344 of 2,342 total issues

Function remove has a Cognitive Complexity of 70 (exceeds 20 allowed). Consider refactoring.
Open

    def remove(self, pattern, remote_name, src=None, build_ids=None, package_ids_filter=None,
               force=False, packages_query=None, outdated=False):
        """ Remove local/remote conans, package folders, etc.
        @param src: Remove src folder
        @param pattern: it could be OpenCV* or OpenCV or a ConanFileReference
Severity: Minor
Found in conans/client/remover.py - About 1 day 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 _replace_scm_data_in_conanfile has a Cognitive Complexity of 68 (exceeds 20 allowed). Consider refactoring.
Open

def _replace_scm_data_in_conanfile(conanfile_path, scm_data):
    # FIXME: Remove in Conan 2.0, it will use conandata.yml as the only way
    # Parsing and replacing the SCM field
    content = load(conanfile_path)
    headers = []
Severity: Minor
Found in conans/client/cmd/export.py - About 1 day 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

ConanAPIV1 has 81 functions (exceeds 50 allowed). Consider refactoring.
Open

class ConanAPIV1(object):
    @classmethod
    def factory(cls):
        return cls(), None, None

Severity: Major
Found in conans/client/conan_api.py - About 7 hrs to fix

    Function _recurse_build_requires has a Cognitive Complexity of 61 (exceeds 20 allowed). Consider refactoring.
    Open

        def _recurse_build_requires(self, graph, builder, check_updates,
                                    update, build_mode, remotes, profile_build_requires, recorder,
                                    profile_host, profile_build, graph_lock, apply_build_requires=True,
                                    nodes_subset=None, root=None):
            """
    Severity: Minor
    Found in conans/client/graph/graph_manager.py - About 7 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 print_info has a Cognitive Complexity of 60 (exceeds 20 allowed). Consider refactoring.
    Open

        def print_info(self, data, _info, package_filter=None, show_paths=False, show_revisions=False):
            """ Print in console the dependency information for a conan file
            """
            if _info is None:  # No filter
                def show(_):
    Severity: Minor
    Found in conans/client/printer.py - About 6 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 _collect_packages_to_upload has a Cognitive Complexity of 56 (exceeds 20 allowed). Consider refactoring.
    Open

        def _collect_packages_to_upload(self, refs, confirm, remotes, all_packages, query, package_id):
            """ compute the references with revisions and the package_ids to be uploaded
            """
            # Group recipes by remote
            refs_by_remote = defaultdict(list)
    Severity: Minor
    Found in conans/client/cmd/uploader.py - About 6 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 cmd_new has a Cognitive Complexity of 55 (exceeds 20 allowed). Consider refactoring.
    Open

    def cmd_new(ref, header=False, pure_c=False, test=False, exports_sources=False, bare=False,
                visual_versions=None, linux_gcc_versions=None, linux_clang_versions=None,
                osx_clang_versions=None, shared=None, upload_url=None, gitignore=None,
                gitlab_gcc_versions=None, gitlab_clang_versions=None,
                circleci_gcc_versions=None, circleci_clang_versions=None, circleci_osx_versions=None,
    Severity: Minor
    Found in conans/client/cmd/new.py - About 6 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 vcvars_command has a Cognitive Complexity of 55 (exceeds 20 allowed). Consider refactoring.
    Open

    def vcvars_command(conanfile=None, arch=None, compiler_version=None, force=False, vcvars_ver=None,
                       winsdk_version=None, output=None, settings=None):
        # Handle input arguments (backwards compatibility with 'settings' as first argument)
        # TODO: This can be promoted to a decorator pattern for any function
        if conanfile and settings:
    Severity: Minor
    Found in conans/client/tools/win.py - About 6 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 print_search_packages has a Cognitive Complexity of 52 (exceeds 20 allowed). Consider refactoring.
    Open

        def print_search_packages(self, search_info, ref, packages_query, raw, outdated=False):
            assert(isinstance(ref, ConanFileReference))
            if not raw:
                self._out.info("Existing packages for recipe %s:\n" % str(ref))
            for remote_info in search_info:
    Severity: Minor
    Found in conans/client/printer.py - About 5 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 _raise_incorrect_components_definition has a Cognitive Complexity of 50 (exceeds 20 allowed). Consider refactoring.
    Open

        def _raise_incorrect_components_definition(self, package_name, package_requires):
            if not self.components and not self.requires:
                return
    
            # Raise if mixing components
    Severity: Minor
    Found in conans/model/build_info.py - About 5 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 _download_file has a Cognitive Complexity of 49 (exceeds 20 allowed). Consider refactoring.
    Open

        def _download_file(self, url, auth, headers, file_path, try_resume=False):
            t1 = time.time()
            if try_resume and file_path and os.path.exists(file_path):
                range_start = os.path.getsize(file_path)
                headers = headers.copy() if headers else {}
    Severity: Minor
    Found in conans/client/downloaders/file_downloader.py - About 5 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 unzip has a Cognitive Complexity of 47 (exceeds 20 allowed). Consider refactoring.
    Open

    def unzip(filename, destination=".", keep_permissions=False, pattern=None, output=None,
              strip_root=False):
        """
        Unzip a zipped file
        :param filename: Path to the zip file
    Severity: Minor
    Found in conans/client/tools/files.py - About 4 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 _expand_require has a Cognitive Complexity of 47 (exceeds 20 allowed). Consider refactoring.
    Open

        def _expand_require(self, require, node, graph, check_updates, update, remotes, profile_host,
                            profile_build, new_reqs, new_options, graph_lock, context_switch,
                            populate_settings_target=True):
            # Handle a requirement of a node. There are 2 possibilities
            #    node -(require)-> new_node (creates a new node in the graph)
    Severity: Minor
    Found in conans/client/graph/graph_builder.py - About 4 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 _grab_info_data has a Cognitive Complexity of 46 (exceeds 20 allowed). Consider refactoring.
    Open

        def _grab_info_data(self, deps_graph, grab_paths):
            """ Convert 'deps_graph' into consumible information for json and cli """
            compact_nodes = OrderedDict()
            for node in sorted(deps_graph.nodes):
                compact_nodes.setdefault((node.ref, node.package_id), []).append(node)
    Severity: Minor
    Found in conans/client/conan_command_output.py - About 4 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 configure has a Cognitive Complexity of 45 (exceeds 20 allowed). Consider refactoring.
    Open

        def configure(self, configure_dir=None, args=None, build=None, host=None, target=None,
                      pkg_config_paths=None, vars=None, use_default_install_dirs=True):
            """
            :param pkg_config_paths: Optional paths to locate the *.pc files
            :param configure_dir: Absolute or relative path to the configure script
    Severity: Minor
    Found in conans/client/build/autotools_environment.py - About 4 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 unzip has a Cognitive Complexity of 45 (exceeds 20 allowed). Consider refactoring.
    Open

    def unzip(conanfile, filename, destination=".", keep_permissions=False, pattern=None,
              strip_root=False):
        """
        Unzip a zipped file
        :param filename: Path to the zip file
    Severity: Minor
    Found in conan/tools/files/files.py - About 4 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 _evaluate_node has a Cognitive Complexity of 44 (exceeds 20 allowed). Consider refactoring.
    Open

        def _evaluate_node(self, node, build_mode, update, remotes):
            assert node.binary is None, "Node.binary should be None"
            assert node.package_id is not None, "Node.package_id shouldn't be None"
            assert node.package_id != PACKAGE_ID_UNKNOWN, "Node.package_id shouldn't be Unknown"
            assert node.prev is None, "Node.prev should be None"
    Severity: Minor
    Found in conans/client/graph/graph_binaries.py - About 4 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 _cmake_cross_build_defines has a Cognitive Complexity of 43 (exceeds 20 allowed). Consider refactoring.
    Open

        def _cmake_cross_build_defines(self, cmake_version):
            os_ = self._ss("os")
            arch = self._ss("arch")
            os_ver_str = "os.api_level" if os_ == "Android" else "os.version"
            op_system_version = self._ss(os_ver_str)
    Severity: Minor
    Found in conans/client/build/cmake_flags.py - About 4 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_sorted_components has a Cognitive Complexity of 43 (exceeds 20 allowed). Consider refactoring.
    Open

        def _get_sorted_components(self):
            """
            Sort Components from most dependent one first to the less dependent one last
            :return: List of sorted components
            """
    Severity: Minor
    Found in conans/model/build_info.py - About 4 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 info has a Cognitive Complexity of 41 (exceeds 20 allowed). Consider refactoring.
    Open

        def info(self, *args):
            """
            Gets information about the dependency graph of a recipe.
    
            It can be used with a recipe or a reference for any existing package in
    Severity: Minor
    Found in conans/client/command.py - About 3 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

    Severity
    Category
    Status
    Source
    Language