conan-io/conan

View on GitHub

Showing 365 of 2,578 total issues

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

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

    def loads(text):
        result = ProfileEnvironment()
        for line in text.splitlines():
            line = line.strip()
            if not line or line.startswith("#"):
Severity: Minor
Found in conan/tools/env/environment.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 lock_create has 14 arguments (exceeds 10 allowed). Consider refactoring.
Open

    def lock_create(self, path, lockfile_out,
Severity: Major
Found in conans/client/conan_api.py - About 1 hr to fix

    Function get_command has 14 arguments (exceeds 10 allowed). Consider refactoring.
    Open

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

      Function test has 14 arguments (exceeds 10 allowed). Consider refactoring.
      Open

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

        Function install_build_and_test has 14 arguments (exceeds 10 allowed). Consider refactoring.
        Open

        def install_build_and_test(app, conanfile_abs_path, reference, graph_info,
        Severity: Major
        Found in conans/client/cmd/test.py - About 1 hr to fix

          Function cmd_export has a Cognitive Complexity of 24 (exceeds 20 allowed). Consider refactoring.
          Open

          def cmd_export(app, conanfile_path, name, version, user, channel, keep_source,
                         export=True, graph_lock=None, ignore_dirty=False):
              """ Export the recipe
              param conanfile_path: the original source directory of the user containing a
                                 conanfile.py
          Severity: Minor
          Found in conans/client/cmd/export.py - About 55 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

          Function __cmp__ has a Cognitive Complexity of 24 (exceeds 20 allowed). Consider refactoring.
          Open

              def __cmp__(self, other):
                  if other is None:
                      return 1
                  if not isinstance(other, Version):
                      other = Version(other)
          Severity: Minor
          Found in conans/model/version.py - About 55 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

          Function create has a Cognitive Complexity of 24 (exceeds 20 allowed). Consider refactoring.
          Open

              def create(lockfiles, revisions_enabled, cwd):
                  def ref_convert(r):
                      # Necessary so "build-order" output is usable by install
                      if "@" not in r:
                          if "#" in r:
          Severity: Minor
          Found in conans/model/lock_bundle.py - About 55 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

          Function download has 13 arguments (exceeds 10 allowed). Consider refactoring.
          Open

          def download(url, filename, verify=True, out=None, retry=None, retry_wait=None, overwrite=False,
          Severity: Major
          Found in conans/client/tools/net.py - About 50 mins to fix

            Function _expand_require has 13 arguments (exceeds 10 allowed). Consider refactoring.
            Open

                def _expand_require(self, require, node, graph, check_updates, update, remotes, profile_host,
            Severity: Major
            Found in conans/client/graph/graph_builder.py - About 50 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      for token in tokens:
                                          if token.startswith("-D") or token.startswith("/D"):
                                              token = token[2:]
                                              if '=' in token:
                                                  name, value = token.split('=', 2)
              Severity: Major
              Found in conans/client/conf/compiler_id.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if ref.revision != rec_rev:
                                            self._output.warn("Skipping package '%s', it doesn't belong to the"
                                                              " current recipe revision" % package_id)
                                            continue
                                    package_revision = metadata.packages[package_id].revision
                Severity: Major
                Found in conans/client/cmd/uploader.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          if os.path.isfile(dst) or os.path.islink(dst):
                                              os.unlink(dst)
                                          os.symlink(linkto, dst)
                  Severity: Major
                  Found in conans/client/generators/deploy.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if pkg_metadata.remote not in remotes:
                                                pkg_metadata.remote = None
                    
                    
                    Severity: Major
                    Found in conans/client/cache/remote_registry.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              if not os.path.isabs(link_target):
                                                  link_target = os.path.join(os.path.dirname(src), link_target)
                                              linkto = os.path.relpath(link_target, os.path.dirname(src))
                      Severity: Major
                      Found in conans/client/generators/deploy.py - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                if response.status_code == 404:
                                                    raise PackageNotFoundException(pref)
                                                if response.status_code != 200:  # Error message is text
                        Severity: Major
                        Found in conans/client/rest/rest_client_v2.py - About 45 mins to fix

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

                              def info(self, reference_or_path, remote_name=None, settings=None, options=None, env=None,
                          Severity: Major
                          Found in conans/client/conan_api.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                if isinstance(stmt.targets[0], ast.Name) and stmt.targets[0].id == "scm":
                                                    try:
                                                        if i + 1 == len(statements):  # Last statement in my ClassDef
                                                            if i_body + 1 == len(tree.body):  # Last statement over all
                                                                next_line = len(lines)
                            Severity: Major
                            Found in conans/client/cmd/export.py - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                      for pkg_metadata in metadata.packages.values():
                                                          if pkg_metadata.remote == renamed:
                                                              pkg_metadata.remote = remote_name
                              
                              
                              Severity: Major
                              Found in conans/client/cache/remote_registry.py - About 45 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language