conan-io/conan

View on GitHub

Showing 364 of 2,550 total issues

Function build_sln_command has 12 arguments (exceeds 10 allowed). Consider refactoring.
Open

def build_sln_command(settings, sln_path, targets=None, upgrade_project=True, build_type=None,
Severity: Major
Found in conans/client/tools/win.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            for cur_name, _ in self.settings.items():
                                if cur_name.startswith("%s." % name):
                                    del res[cur_name]
                # Now merge the new values
                res.update(new_settings)
    Severity: Major
    Found in conans/model/profile.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if comp_name not in [require for dep in components.values() for require in
                                                   self._filter_component_requires(dep.requires)]:
                                  ordered[comp_name] = comp
                                  del components[comp_name]
                                  break
      Severity: Major
      Found in conans/model/build_info.py - About 45 mins to fix

        Function load_graph has 12 arguments (exceeds 10 allowed). Consider refactoring.
        Open

            def load_graph(self, reference, create_reference, graph_info, build_mode, check_updates, update,
        Severity: Major
        Found in conans/client/graph/graph_manager.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if getattr(component, n):
                                      dest = result.get_init(n, [])
                                      dest.extend([i for i in getattr(component, n) if i not in dest])
          
                              # NOTE: The properties are not aggregated because they might refer only to the
          Severity: Major
          Found in conans/model/new_build_info.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 is_editable:
                                          # IMPORTANT: Need to go first, otherwise fill_old_cppinfo() destroys
                                          # component information
                                          conanfile.layouts.package.set_relative_base_folder(conanfile.package_folder)
                                          conanfile.buildenv_info.compose_env(conanfile.layouts.package.buildenv_info)
              Severity: Major
              Found in conans/client/installer.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if graph_lock.nodes[node_id].prev is None:
                                            graph_lock.nodes[node_id].prev = prev
                                    graph_lock_conf.save(lockfile)
                Severity: Major
                Found in conans/model/lock_bundle.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                      if product_type in product["productId"]:
                                          vs_paths.append(product["installationPath"])
                  
                          # Append products without "productId" (Legacy installations)
                          for product in seen_products:
                  Severity: Major
                  Found in conans/client/tools/win.py - About 45 mins to fix

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

                        def aggregated_components(self):
                            """Aggregates all the components as global values, returning a new NewCppInfo"""
                            if self._aggregated is None:
                                if self.has_components:
                                    result = _NewComponent()
                    Severity: Minor
                    Found in conans/model/new_build_info.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 isinstance(value, list):
                                                updates[prop_name] = [os.path.join(folder, v) for v in value]
                                            else:
                                                updates[prop_name] = os.path.join(folder, value)
                                    component._generator_properties.update(updates)
                    Severity: Major
                    Found in conans/model/new_build_info.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 br_key in package_build_requires:  # Override defined
                                                    # this is a way to have only one package Name for all versions
                                                    # (no conflicts)
                                                    # but the dict key is not used at all
                                                    package_build_requires[br_key] = build_require
                        Severity: Major
                        Found in conans/client/graph/graph_manager.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                              if verify(trick_path):
                                                  return trick_path
                          
                          
                          Severity: Major
                          Found in conans/client/tools/files.py - About 45 mins to fix

                            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 ctxt == CONTEXT_BUILD:
                                                          br_build.append((it, ctxt))
                                                      else:
                                                          br_host.append((it, ctxt))
                                                  if br_build:
                              Severity: Major
                              Found in conans/client/graph/graph_manager.py - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                        if package_id == node.package_id:
                                                            node.conanfile.output.info("Compatible package ID %s equal to the "
                                                                                       "default package ID" % package_id)
                                                            continue
                                                        pref = PackageReference(node.ref, package_id)
                                Severity: Major
                                Found in conans/client/graph/graph_binaries.py - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                              if not is_editable and not hasattr(conanfile, "layout"):
                                                                  # FIXME: The default for the cppinfo from build are not the same
                                                                  #        so this check fails when editable
                                                                  # FIXME: Remove when new cppinfo model. If using the layout method
                                                                  #        the cppinfo object is filled from self.cpp.package new
                                  Severity: Major
                                  Found in conans/client/installer.py - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                            if prev is None:
                                                                prev = lock_prev
                                                                prev_lockfile = lockfile
                                                                modified = graph_lock.nodes[node_id].modified
                                                            elif lock_prev is not None and prev != lock_prev:
                                    Severity: Major
                                    Found in conans/model/lock_bundle.py - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                              if isinstance(value, list):
                                                                  value = copy.copy(value)  # Aware of copying by reference the list
                                                              self.add(name, value, package_name)
                                      Severity: Major
                                      Found in conans/model/env_info.py - About 45 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language