conan-io/conan

View on GitHub

Showing 365 of 2,578 total issues

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

    def __init__(self, text, allowed_fields=None, parse_lines=False, raise_unexpected_field=True):
        self._sections = {}
        self._allowed_fields = allowed_fields or []
        pattern = re.compile(r"^\[([a-z_]{2,50})]")
        current_lines = None
Severity: Minor
Found in conans/util/config_parser.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

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

def get_graph_info(profile_host, profile_build, cwd, install_folder, cache, output,
                   name=None, version=None, user=None, channel=None, lockfile=None):
    if lockfile:
        try:
            graph_info_folder = lockfile if os.path.isdir(lockfile) else os.path.dirname(lockfile)
Severity: Minor
Found in conans/client/conan_api.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/client/command.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            if response.status_code != 200:  # Error message is text
                                # To be able to access ret.text (ret.content are bytes)
                                response.charset = "utf-8"
                                raise get_exception_from_error(response.status_code)(response.text)
    
    
    Severity: Major
    Found in conans/client/rest/rest_client_v2.py - About 45 mins to fix

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

      def export_pkg(app, recorder, full_ref, source_folder, build_folder, package_folder, install_folder,
      Severity: Major
      Found in conans/client/cmd/export_pkg.py - About 45 mins to fix

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

            def upload(self, reference_or_pattern, remotes, upload_recorder, package_id=None,
        Severity: Major
        Found in conans/client/cmd/uploader.py - About 45 mins to fix

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

              def __init__(self, conanfile, generator=None, cmake_system_name=True,
          Severity: Major
          Found in conans/client/build/cmake.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

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

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

                  def search(self, *args):
                      """
                      Searches package recipes and binaries in the local cache or a remote.
                      Unless a remote is specified only the local cache is searched.
              
              
              Severity: Minor
              Found in conans/client/command.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

                                  with open(abs_path, 'rb') as file_handler:
                                      tgz.addfile(tarinfo=info, fileobj=file_handler)
                      tgz.close()
              Severity: Major
              Found in conans/client/cmd/uploader.py - About 45 mins to fix

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

                    def config(self, *args):
                        """
                        Manages Conan configuration.
                
                        Used to edit conan.conf, or install config files.
                Severity: Minor
                Found in conans/client/command.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 pkg_metadata.remote == remote_name:
                                            pkg_metadata.remote = None
                
                
                Severity: Major
                Found in conans/client/cache/remote_registry.py - About 45 mins to fix

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

                  def _process_file(directory, filename, config, cache, output, folder):
                      if filename == "settings.yml":
                          output.info("Installing settings.yml")
                          _filecopy(directory, filename, cache.cache_folder)
                      elif filename == "conan.conf":
                  Severity: Minor
                  Found in conans/client/conf/config_installer.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

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

                  def _apply_inner_profile(doc, base_profile):
                      """
                  
                      :param doc: ConfigParser object from the current profile (excluding includes and vars,
                      and with values already replaced)
                  Severity: Minor
                  Found in conans/client/profile_loader.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 self._print_commands_to_output:
                                              log_handler.write(call_message)
                                          return self._pipe_os_call(command, stream_output, log_handler, cwd, user_output)
                  Severity: Major
                  Found in conans/client/runner.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

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

                      Avoid deeply nested control flow statements.
                      Open

                                              if ret:
                                                  self._conanfile.output.info("Patched paths for %s: %s to %s"
                                                                              % (dep, from_str, dep_str))
                      
                      
                      Severity: Major
                      Found in conans/client/build/cmake.py - About 45 mins to fix

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

                            def is_pristine(self):
                                # Check if working copy is pristine/consistent
                                if self.version >= SVN.API_CHANGE_VERSION:
                                    try:
                                        output = self.run("status -u -r {} --xml".format(self.get_revision()))
                        Severity: Minor
                        Found in conans/client/tools/scm.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

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

                            def workspace_install(self, path, 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(src_dirs, list):  # it can return a "config" CppInfo item!
                                                      src_dirs += src_dir
                          
                          
                          Severity: Major
                          Found in conans/client/importer.py - About 45 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language