conan-io/conan

View on GitHub

Showing 365 of 2,578 total issues

Avoid deeply nested control flow statements.
Open

                        with conan_v2_property(conanfile, 'options',
                                               "'self.options' access in source() method is deprecated"):
                            conanfile.source()

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

    Avoid deeply nested control flow statements.
    Open

                            if node.binary == BINARY_MISSING:
                                self._raise_missing([node])
                        if node.binary == BINARY_EDITABLE:
    Severity: Major
    Found in conans/client/installer.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                          if member.linkpath.startswith(common_folder):
                              # https://github.com/conan-io/conan/issues/11065
                              linkpath = member.linkpath.replace("\\", "/")
                              member.linkpath = linkpath.split("/", 1)[1]
                              member.linkname = member.linkpath
      Severity: Major
      Found in conans/client/tools/files.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if isinstance(attr, dict):  # options, settings
                                    attr = OrderedDict(sorted(attr.items()))
                                    for key, value in attr.items():
                                        self._print_colored_line(key, value=value, indent=3)
                                elif isinstance(attr, list):  # full requires
        Severity: Major
        Found in conans/client/printer.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if "@" not in ref:
                                      ref += "@"
                              else:
          Severity: Major
          Found in conans/model/graph_lock.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                if name in libs:
                                    _save_lib_path(name, full_path)
            
            
            Severity: Major
            Found in conan/tools/google/bazeldeps.py - About 45 mins to fix

              Function context has a Cognitive Complexity of 23 (exceeds 20 allowed). Consider refactoring.
              Open

                  def context(self):
                      # Parsing existing toolchain file to get existing configured runtimes
                      settings = self._conanfile.settings
                      if settings.get_safe("os") != "Windows":
                          return
              Severity: Minor
              Found in conan/tools/cmake/toolchain/blocks.py - About 45 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

              Avoid deeply nested control flow statements.
              Open

                                      if node.prev is None:
                                          node.prev = prev
              
              
              Severity: Major
              Found in conans/model/graph_lock.py - About 45 mins to fix

                Function infix_to_postfix has a Cognitive Complexity of 23 (exceeds 20 allowed). Consider refactoring.
                Open

                def infix_to_postfix(exp):
                    """
                    Translates an infix expression to postfix using an standard algorithm
                    with little hacks for parse complex expressions like "compiler.version=4"
                    instead of just numbers and without taking in account the operands priority
                Severity: Minor
                Found in conans/search/query_parse.py - About 45 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

                Avoid deeply nested control flow statements.
                Open

                                    if start:
                                        break
                                    start = True
                Severity: Major
                Found in conans/cli/commands/help.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                      if (temp_value.isnumeric() or
                                              temp_value in ['true', 'false', 'undefined']):
                                          value = temp_value
                                  config[key] = value
                  Severity: Major
                  Found in conan/tools/qbs/qbsprofile.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            for comp_name, comp_cpp_info in sorted_components:
                                                public_deps.append((_format_name(d.ref.name), _format_name(comp_name)))
                                        else:
                    Severity: Major
                    Found in conan/tools/apple/xcodedeps.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              for comp_name, comp in components.items():
                                                  for dep_name, dep in components.items():
                                                      for require in self._filter_component_requires(dep.requires):
                                                          if require == comp_name:
                                                              dset.add("   {} requires {}".format(dep_name, comp_name))
                      Severity: Major
                      Found in conans/model/build_info.py - About 45 mins to fix

                        Function __init__ has a Cognitive Complexity of 23 (exceeds 20 allowed). Consider refactoring.
                        Open

                            def __init__(self, conanfile, backend=None):
                                self._conanfile = conanfile
                                self._os = self._conanfile.settings.get_safe("os")
                                self._is_apple_system = is_apple_os(self._conanfile)
                        
                        
                        Severity: Minor
                        Found in conan/tools/meson/toolchain.py - About 45 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

                        Avoid deeply nested control flow statements.
                        Open

                                            if member.linkpath.startswith(common_folder):
                                                # https://github.com/conan-io/conan/issues/11065
                                                linkpath = member.linkpath.replace("\\", "/")
                                                member.linkpath = linkpath.split("/", 1)[1]
                                                member.linkname = member.linkpath
                        Severity: Major
                        Found in conan/tools/files/files.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                              for file_doc in down_module["files"]:
                                                  module.dependencies.append(_get_dependency(file_doc, mod_dep_id))
                          
                          
                          Severity: Major
                          Found in conans/build_info/conan_build_info.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                    if "@" not in ref:
                                                        ref = ref.replace("#", "@#")
                                                if (ref, locked_node.package_id, locked_node.context) not in total_prefs:
                            Severity: Major
                            Found in conans/model/graph_lock.py - About 45 mins to fix

                              Function upload has 11 arguments (exceeds 10 allowed). Consider refactoring.
                              Open

                                  def upload(self, pattern, package=None, remote_name=None, all_packages=False, confirm=False,
                              Severity: Major
                              Found in conans/client/conan_api.py - About 35 mins to fix

                                Function get_graph_info has 11 arguments (exceeds 10 allowed). Consider refactoring.
                                Open

                                def get_graph_info(profile_host, profile_build, cwd, install_folder, cache, output,
                                Severity: Major
                                Found in conans/client/conan_api.py - About 35 mins to fix

                                  Function info_build_order has 11 arguments (exceeds 10 allowed). Consider refactoring.
                                  Open

                                      def info_build_order(self, reference, settings=None, options=None, env=None,
                                  Severity: Major
                                  Found in conans/client/conan_api.py - About 35 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language