conan-io/conan

View on GitHub

Showing 364 of 2,550 total issues

Function _get_metadata_artifacts has a Cognitive Complexity of 28 (exceeds 20 allowed). Consider refactoring.
Open

    def _get_metadata_artifacts(self, metadata, ref_path, use_id=False, name_format="{}",
                                package_id=None):
        ret = {}
        need_sources = False
        if package_id:
Severity: Minor
Found in conans/build_info/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 build has 18 arguments (exceeds 10 allowed). Consider refactoring.
Open

    def build(self, project_file, targets=None, upgrade_project=True, build_type=None, arch=None,
Severity: Major
Found in conans/client/build/msbuild.py - About 1 hr to fix

    Function architecture_flag has a Cognitive Complexity of 27 (exceeds 20 allowed). Consider refactoring.
    Open

    def architecture_flag(settings):
        """
        returns flags specific to the target architecture and compiler
        """
        compiler = settings.get_safe("compiler")
    Severity: Minor
    Found in conans/client/build/compiler_flags.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 ci_get_files has a Cognitive Complexity of 27 (exceeds 20 allowed). Consider refactoring.
    Open

    def ci_get_files(name, version, user, channel, visual_versions, linux_gcc_versions,
                     linux_clang_versions, osx_clang_versions, shared, upload_url, gitlab_gcc_versions,
                     gitlab_clang_versions, circleci_gcc_versions, circleci_clang_versions,
                     circleci_osx_versions):
        if shared and not (visual_versions or linux_gcc_versions or linux_clang_versions or
    Severity: Minor
    Found in conans/client/cmd/new_ci.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 fill_old_cppinfo has a Cognitive Complexity of 27 (exceeds 20 allowed). Consider refactoring.
    Open

    def fill_old_cppinfo(origin, old_cpp):
        """Copy the values from a new cpp info object to an old one but prioritizing it,
        if the value is not None, then override the declared in the conanfile.cpp_info => (dest)"""
    
        if origin.has_components:
    Severity: Minor
    Found in conans/model/new_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 get has 17 arguments (exceeds 10 allowed). Consider refactoring.
    Open

    def get(url, md5=None, sha1=None, sha256=None, destination=".", filename="", keep_permissions=False,
    Severity: Major
    Found in conans/client/tools/net.py - About 1 hr to fix

      Function _new_generator has a Cognitive Complexity of 26 (exceeds 20 allowed). Consider refactoring.
      Open

          def _new_generator(self, generator_name, output):
              if generator_name not in self._new_generators:
                  return
              if generator_name in self._generators:  # Avoid colisions with user custom generators
                  msg = ("******* Your custom generator name '{}' is colliding with a new experimental "
      Severity: Minor
      Found in conans/client/generators/__init__.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 create has 16 arguments (exceeds 10 allowed). Consider refactoring.
      Open

      def create(app, ref, graph_info, remotes, update, build_modes,
      Severity: Major
      Found in conans/client/cmd/create.py - About 1 hr to fix

        Function _import_parameters has a Cognitive Complexity of 26 (exceeds 20 allowed). Consider refactoring.
        Open

            def _import_parameters(self):
                def _parse_args(param_string):
                    root_package, ignore_case, folder, excludes, keep_path = None, True, False, None, True
                    params = param_string.split(",")
                    params = [p.strip() for p in params if p.strip()]
        Severity: Minor
        Found in conans/client/loader_txt.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 generate has a Cognitive Complexity of 26 (exceeds 20 allowed). Consider refactoring.
        Open

            def generate(self, install_folder, graph, output):
                if self._ws_generator == "cmake":
                    cmake = ""
                    add_subdirs = ""
                    # To avoid multiple additions (can happen for build_requires repeated nodes)
        Severity: Minor
        Found in conans/model/workspace.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 env_dicts has a Cognitive Complexity of 26 (exceeds 20 allowed). Consider refactoring.
        Open

            def env_dicts(self, package_name, version=None, user=None, channel=None):
                """Returns two dicts of env variables that applies to package 'name',
                 the first for simple values A=1, and the second for multiple A=1;2;3"""
                ret = {}
                ret_multi = {}
        Severity: Minor
        Found in conans/model/env_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 ci_get_files has 15 arguments (exceeds 10 allowed). Consider refactoring.
        Open

        def ci_get_files(name, version, user, channel, visual_versions, linux_gcc_versions,
        Severity: Major
        Found in conans/client/cmd/new_ci.py - About 1 hr to fix

          Function cmd_build has 15 arguments (exceeds 10 allowed). Consider refactoring.
          Open

          def cmd_build(app, conanfile_path, base_path, source_folder, build_folder, package_folder,
          Severity: Major
          Found in conans/client/cmd/build.py - About 1 hr to fix

            Function _recurse_build_requires has 15 arguments (exceeds 10 allowed). Consider refactoring.
            Open

                def _recurse_build_requires(self, graph, builder, check_updates,
            Severity: Major
            Found in conans/client/graph/graph_manager.py - About 1 hr to fix

              Function get has 15 arguments (exceeds 10 allowed). Consider refactoring.
              Open

              def get(conanfile, url, md5=None, sha1=None, sha256=None, destination=".", filename="",
              Severity: Major
              Found in conan/tools/files/files.py - About 1 hr to fix

                Function _pipe_os_call has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring.
                Open

                    def _pipe_os_call(self, command, stream_output, log_handler, cwd, user_output):
                
                        try:
                            # piping both stdout, stderr and then later only reading one will hang the process
                            # if the other fills the pip. So piping stdout, and redirecting stderr to stdout,
                Severity: Minor
                Found in conans/client/runner.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 write_generators has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring.
                Open

                    def write_generators(self, conanfile, old_gen_folder, new_gen_folder, output):
                        """ produces auxiliary files, required to build a project or a package.
                        """
                        _receive_conf(conanfile)
                
                
                Severity: Minor
                Found in conans/client/generators/__init__.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 which has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring.
                Open

                def which(filename):
                    """ same affect as posix which command or shutil.which from python3 """
                    # FIXME: Replace with shutil.which in Conan 2.0
                    def verify(file_abspath):
                        return os.path.isfile(file_abspath) and os.access(file_abspath, os.X_OK)
                Severity: Minor
                Found in conans/client/tools/files.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 25 (exceeds 20 allowed). Consider refactoring.
                Open

                    def __init__(self, params, output):
                        self._out = output
                        self.outdated = False
                        self.missing = False
                        self.never = False
                Severity: Minor
                Found in conans/client/graph/build_mode.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 has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring.
                Open

                    def update(self, down_reqs, output, own_ref, down_ref):
                        """ Compute actual requirement values when downstream values are defined
                        param down_reqs: the current requirements as coming from downstream to override
                                         current requirements
                        param own_ref: ConanFileReference of the current conanfile
                Severity: Minor
                Found in conans/model/requires.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