conan-io/conan

View on GitHub
conans/client/conan_api.py

Summary

Maintainability
F
1 wk
Test Coverage

ConanAPIV1 has 81 functions (exceeds 50 allowed). Consider refactoring.
Open

class ConanAPIV1(object):
    @classmethod
    def factory(cls):
        return cls(), None, None

Severity: Major
Found in conans/client/conan_api.py - About 7 hrs to fix

    Function create has 28 arguments (exceeds 10 allowed). Consider refactoring.
    Open

        def create(self, conanfile_path, name=None, version=None, user=None, channel=None,
    Severity: Major
    Found in conans/client/conan_api.py - About 2 hrs to fix

      Function install has 25 arguments (exceeds 10 allowed). Consider refactoring.
      Open

          def install(self, path="", name=None, version=None, user=None, channel=None,
      Severity: Major
      Found in conans/client/conan_api.py - About 2 hrs to fix

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

            def export_pkg(self, conanfile_path, name, channel, source_folder=None, build_folder=None,
        Severity: Major
        Found in conans/client/conan_api.py - About 1 hr to fix

          Function new has 21 arguments (exceeds 10 allowed). Consider refactoring.
          Open

              def new(self, name, header=False, pure_c=False, test=False, exports_sources=False, bare=False,
          Severity: Major
          Found in conans/client/conan_api.py - About 1 hr to fix

            Function install_reference has 21 arguments (exceeds 10 allowed). Consider refactoring.
            Open

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

              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 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 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

                    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

                      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

                      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 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

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

                              def info_nodes_to_build(self, reference, build_modes, settings=None, options=None, env=None,
                          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

                              Similar blocks of code found in 2 locations. Consider refactoring.
                              Open

                                          if remote:
                                              try:
                                                  revisions = self.app.remote_manager.get_recipe_revisions(ref, remote)
                                              except RecipeNotFoundException:
                                                  pass
                              Severity: Major
                              Found in conans/client/conan_api.py and 1 other location - About 4 hrs to fix
                              conans/client/conan_api.py on lines 1290..1299

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 79.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 2 locations. Consider refactoring.
                              Open

                                          if remote:
                                              try:
                                                  revisions = self.app.remote_manager.get_package_revisions(pref, remote)
                                              except RecipeNotFoundException:
                                                  pass
                              Severity: Major
                              Found in conans/client/conan_api.py and 1 other location - About 4 hrs to fix
                              conans/client/conan_api.py on lines 1249..1258

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 79.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 2 locations. Consider refactoring.
                              Open

                                  @api_method
                                  def remote_update_ref(self, reference, remote_name):
                                      ref = ConanFileReference.loads(reference, validate=True)
                                      remote = self.app.cache.registry.load_remotes()[remote_name]
                                      with self.app.cache.package_layout(ref).update_metadata() as metadata:
                              Severity: Major
                              Found in conans/client/conan_api.py and 1 other location - About 4 hrs to fix
                              conans/client/conan_api.py on lines 1059..1064

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 77.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 2 locations. Consider refactoring.
                              Open

                                  @api_method
                                  def remote_add_ref(self, reference, remote_name):
                                      ref = ConanFileReference.loads(reference, validate=True)
                                      remote = self.app.cache.registry.load_remotes()[remote_name]
                                      with self.app.cache.package_layout(ref).update_metadata() as metadata:
                              Severity: Major
                              Found in conans/client/conan_api.py and 1 other location - About 4 hrs to fix
                              conans/client/conan_api.py on lines 1072..1077

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 77.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 2 locations. Consider refactoring.
                              Open

                                  @api_method
                                  def lock_bundle_clean_modified(self, lock_bundle_path, cwd=None):
                                      cwd = cwd or os.getcwd()
                                      lock_bundle_path = _make_abs_path(lock_bundle_path, cwd)
                                      revisions_enabled = self.app.cache.config.revisions_enabled
                              Severity: Major
                              Found in conans/client/conan_api.py and 1 other location - About 2 hrs to fix
                              conans/client/conan_api.py on lines 1438..1443

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 59.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 2 locations. Consider refactoring.
                              Open

                                  @api_method
                                  def lock_bundle_update(self, lock_bundle_path, cwd=None):
                                      cwd = cwd or os.getcwd()
                                      lock_bundle_path = _make_abs_path(lock_bundle_path, cwd)
                                      revisions_enabled = self.app.cache.config.revisions_enabled
                              Severity: Major
                              Found in conans/client/conan_api.py and 1 other location - About 2 hrs to fix
                              conans/client/conan_api.py on lines 1445..1450

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 59.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 2 locations. Consider refactoring.
                              Open

                                          deps_install(self.app, ref_or_path=reference, install_folder=install_folder,
                              Severity: Major
                              Found in conans/client/conan_api.py and 1 other location - About 1 hr to fix
                              conans/client/cmd/create.py on lines 84..84

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 49.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 2 locations. Consider refactoring.
                              Open

                                      with self.app.cache.package_layout(pref.ref).update_metadata() as metadata:
                                          m = metadata.packages.get(pref.id)
                                          if m:
                                              m.remote = remote_name
                              Severity: Major
                              Found in conans/client/conan_api.py and 1 other location - About 1 hr to fix
                              conans/client/conan_api.py on lines 1111..1114

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 48.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 2 locations. Consider refactoring.
                              Open

                                      with self.app.cache.package_layout(pref.ref).update_metadata() as metadata:
                                          m = metadata.packages.get(pref.id)
                                          if m:
                                              m.remote = None
                              Severity: Major
                              Found in conans/client/conan_api.py and 1 other location - About 1 hr to fix
                              conans/client/conan_api.py on lines 1120..1123

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 48.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 3 locations. Consider refactoring.
                              Open

                                      if hasattr(conanfile, "layout"):
                                          raise ConanException("The usage of the 'conan package' local method is disabled when "
                                                               "using layout(). Use 'export-pkg' to test if the recipe is "
                                                               "packaging the files correctly or use the cpp.info.local object "
                                                               "if you are going to use this package as editable package.")
                              Severity: Major
                              Found in conans/client/conan_api.py and 2 other locations - About 1 hr to fix
                              conans/client/cmd/export_pkg.py on lines 60..68
                              conans/client/installer.py on lines 478..484

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 45.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 2 locations. Consider refactoring.
                              Open

                                  @api_method
                                  def new(self, name, header=False, pure_c=False, test=False, exports_sources=False, bare=False,
                                          cwd=None, visual_versions=None, linux_gcc_versions=None, linux_clang_versions=None,
                                          osx_clang_versions=None, shared=None, upload_url=None, gitignore=None,
                                          gitlab_gcc_versions=None, gitlab_clang_versions=None,
                              Severity: Major
                              Found in conans/client/conan_api.py and 1 other location - About 1 hr to fix
                              conans/client/conan_api.py on lines 536..543

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 45.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 2 locations. Consider refactoring.
                              Open

                                  @api_method
                                  def install_reference(self, reference, settings=None, options=None, env=None,
                                                        remote_name=None, verify=None, manifests=None,
                                                        manifests_interactive=None, build=None, profile_names=None,
                                                        update=False, generators=None, install_folder=None, cwd=None,
                              Severity: Major
                              Found in conans/client/conan_api.py and 1 other location - About 1 hr to fix
                              conans/client/conan_api.py on lines 247..253

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 45.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Identical blocks of code found in 5 locations. Consider refactoring.
                              Open

                                          if lockfile_out:
                                              lockfile_out = _make_abs_path(lockfile_out, cwd)
                                              graph_lock_file = GraphLockFile(graph_info.profile_host, graph_info.profile_build,
                                                                              graph_info.graph_lock)
                                              graph_lock_file.save(lockfile_out)
                              Severity: Major
                              Found in conans/client/conan_api.py and 4 other locations - About 1 hr to fix
                              conans/client/conan_api.py on lines 393..397
                              conans/client/conan_api.py on lines 459..463
                              conans/client/conan_api.py on lines 629..633
                              conans/client/conan_api.py on lines 1416..1420

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 40.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Identical blocks of code found in 5 locations. Consider refactoring.
                              Open

                                      if lockfile_out:
                                          lockfile_out = _make_abs_path(lockfile_out, cwd)
                                          graph_lock_file = GraphLockFile(graph_info.profile_host, graph_info.profile_build,
                                                                          graph_info.graph_lock)
                                          graph_lock_file.save(lockfile_out)
                              Severity: Major
                              Found in conans/client/conan_api.py and 4 other locations - About 1 hr to fix
                              conans/client/conan_api.py on lines 393..397
                              conans/client/conan_api.py on lines 459..463
                              conans/client/conan_api.py on lines 571..575
                              conans/client/conan_api.py on lines 629..633

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 40.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Identical blocks of code found in 5 locations. Consider refactoring.
                              Open

                                          if lockfile_out:
                                              lockfile_out = _make_abs_path(lockfile_out, cwd)
                                              graph_lock_file = GraphLockFile(graph_info.profile_host, graph_info.profile_build,
                                                                              graph_info.graph_lock)
                                              graph_lock_file.save(lockfile_out)
                              Severity: Major
                              Found in conans/client/conan_api.py and 4 other locations - About 1 hr to fix
                              conans/client/conan_api.py on lines 459..463
                              conans/client/conan_api.py on lines 571..575
                              conans/client/conan_api.py on lines 629..633
                              conans/client/conan_api.py on lines 1416..1420

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 40.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Identical blocks of code found in 5 locations. Consider refactoring.
                              Open

                                          if lockfile_out:
                                              lockfile_out = _make_abs_path(lockfile_out, cwd)
                                              graph_lock_file = GraphLockFile(graph_info.profile_host, graph_info.profile_build,
                                                                              graph_info.graph_lock)
                                              graph_lock_file.save(lockfile_out)
                              Severity: Major
                              Found in conans/client/conan_api.py and 4 other locations - About 1 hr to fix
                              conans/client/conan_api.py on lines 393..397
                              conans/client/conan_api.py on lines 459..463
                              conans/client/conan_api.py on lines 571..575
                              conans/client/conan_api.py on lines 1416..1420

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 40.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Identical blocks of code found in 5 locations. Consider refactoring.
                              Open

                                          if lockfile_out:
                                              lockfile_out = _make_abs_path(lockfile_out, cwd)
                                              graph_lock_file = GraphLockFile(graph_info.profile_host, graph_info.profile_build,
                                                                              graph_info.graph_lock)
                                              graph_lock_file.save(lockfile_out)
                              Severity: Major
                              Found in conans/client/conan_api.py and 4 other locations - About 1 hr to fix
                              conans/client/conan_api.py on lines 393..397
                              conans/client/conan_api.py on lines 571..575
                              conans/client/conan_api.py on lines 629..633
                              conans/client/conan_api.py on lines 1416..1420

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 40.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 2 locations. Consider refactoring.
                              Open

                                      try:
                                          configs.pop(index)
                                      except Exception as e:
                                          raise ConanException("Config %s can't be removed: %s" % (index, str(e)))
                              Severity: Major
                              Found in conans/client/conan_api.py and 1 other location - About 1 hr to fix
                              conans/model/workspace.py on lines 57..60

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 38.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 2 locations. Consider refactoring.
                              Open

                                              if self.app.config.revisions_enabled and not pref.revision:
                                                  pref = self.app.remote_manager.get_latest_package_revision(pref, remote)
                              Severity: Minor
                              Found in conans/client/conan_api.py and 1 other location - About 55 mins to fix
                              conans/client/conan_api.py on lines 1185..1186

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 37.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 2 locations. Consider refactoring.
                              Open

                                          if self.app.config.revisions_enabled and not ref.revision:
                                              ref = self.app.remote_manager.get_latest_recipe_revision(ref, remote)
                              Severity: Minor
                              Found in conans/client/conan_api.py and 1 other location - About 55 mins to fix
                              conans/client/conan_api.py on lines 1189..1190

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 37.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 2 locations. Consider refactoring.
                              Open

                                      cmd_build(self.app, conanfile_path, base_path=cwd,
                              Severity: Minor
                              Found in conans/client/conan_api.py and 1 other location - About 40 mins to fix
                              conans/client/tools/net.py on lines 22..22

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 34.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Identical blocks of code found in 4 locations. Consider refactoring.
                              Open

                                      try:
                                          conanfile_path = _get_conanfile_path(conanfile_path, cwd, py=True)
                              
                                          if package_folder:
                                              if build_folder or source_folder:
                              Severity: Major
                              Found in conans/client/conan_api.py and 3 other locations - About 35 mins to fix
                              conans/client/conan_api.py on lines 358..403
                              conans/client/conan_api.py on lines 548..580
                              conans/client/conan_api.py on lines 595..638

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 33.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Identical blocks of code found in 4 locations. Consider refactoring.
                              Open

                                      try:
                                          manifests = _parse_manifests_arguments(verify, manifests, manifests_interactive, cwd)
                                          manifest_folder, manifest_interactive, manifest_verify = manifests
                              
                                          lockfile = _make_abs_path(lockfile, cwd) if lockfile else None
                              Severity: Major
                              Found in conans/client/conan_api.py and 3 other locations - About 35 mins to fix
                              conans/client/conan_api.py on lines 358..403
                              conans/client/conan_api.py on lines 417..468
                              conans/client/conan_api.py on lines 595..638

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 33.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Identical blocks of code found in 4 locations. Consider refactoring.
                              Open

                                      try:
                                          conanfile_path = _get_conanfile_path(conanfile_path, cwd, py=True)
                              
                                          remotes = self.app.load_remotes(remote_name=remote_name, update=update)
                                          lockfile = _make_abs_path(lockfile, cwd) if lockfile else None
                              Severity: Major
                              Found in conans/client/conan_api.py and 3 other locations - About 35 mins to fix
                              conans/client/conan_api.py on lines 417..468
                              conans/client/conan_api.py on lines 548..580
                              conans/client/conan_api.py on lines 595..638

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 33.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Identical blocks of code found in 4 locations. Consider refactoring.
                              Open

                                      try:
                                          manifests = _parse_manifests_arguments(verify, manifests, manifests_interactive, cwd)
                                          manifest_folder, manifest_interactive, manifest_verify = manifests
                              
                                          lockfile = _make_abs_path(lockfile, cwd) if lockfile else None
                              Severity: Major
                              Found in conans/client/conan_api.py and 3 other locations - About 35 mins to fix
                              conans/client/conan_api.py on lines 358..403
                              conans/client/conan_api.py on lines 417..468
                              conans/client/conan_api.py on lines 548..580

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 33.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Line too long (101 > 100 characters)
                              Open

                                                layout_source_folder=layout_source_folder, layout_build_folder=layout_build_folder)
                              Severity: Minor
                              Found in conans/client/conan_api.py by pep8

                              Limit all lines to a maximum of 79 characters.

                              There are still many devices around that are limited to 80 character
                              lines; plus, limiting windows to 80 characters makes it possible to
                              have several windows side-by-side.  The default wrapping on such
                              devices looks ugly.  Therefore, please limit all lines to a maximum
                              of 79 characters. For flowing long blocks of text (docstrings or
                              comments), limiting the length to 72 characters is recommended.
                              
                              Reports error E501.

                              Line too long (101 > 100 characters)
                              Open

                                      phost = profile_from_args(profile_host.profiles, profile_host.settings, profile_host.options,
                              Severity: Minor
                              Found in conans/client/conan_api.py by pep8

                              Limit all lines to a maximum of 79 characters.

                              There are still many devices around that are limited to 80 character
                              lines; plus, limiting windows to 80 characters makes it possible to
                              have several windows side-by-side.  The default wrapping on such
                              devices looks ugly.  Therefore, please limit all lines to a maximum
                              of 79 characters. For flowing long blocks of text (docstrings or
                              comments), limiting the length to 72 characters is recommended.
                              
                              Reports error E501.

                              Line too long (101 > 100 characters)
                              Open

                                      self.pyreq_loader.enable_remotes(update=update, check_updates=check_updates, remotes=remotes)
                              Severity: Minor
                              Found in conans/client/conan_api.py by pep8

                              Limit all lines to a maximum of 79 characters.

                              There are still many devices around that are limited to 80 character
                              lines; plus, limiting windows to 80 characters makes it possible to
                              have several windows side-by-side.  The default wrapping on such
                              devices looks ugly.  Therefore, please limit all lines to a maximum
                              of 79 characters. For flowing long blocks of text (docstrings or
                              comments), limiting the length to 72 characters is recommended.
                              
                              Reports error E501.

                              Line too long (101 > 100 characters)
                              Open

                                                  profile_host=None, profile_build=None, remote_name=None, update=None, build=None,
                              Severity: Minor
                              Found in conans/client/conan_api.py by pep8

                              Limit all lines to a maximum of 79 characters.

                              There are still many devices around that are limited to 80 character
                              lines; plus, limiting windows to 80 characters makes it possible to
                              have several windows side-by-side.  The default wrapping on such
                              devices looks ugly.  Therefore, please limit all lines to a maximum
                              of 79 characters. For flowing long blocks of text (docstrings or
                              comments), limiting the length to 72 characters is recommended.
                              
                              Reports error E501.

                              Line too long (101 > 100 characters)
                              Open

                                          new_ref = cmd_export(self.app, conanfile_path, name, version, user, channel, keep_source,
                              Severity: Minor
                              Found in conans/client/conan_api.py by pep8

                              Limit all lines to a maximum of 79 characters.

                              There are still many devices around that are limited to 80 character
                              lines; plus, limiting windows to 80 characters makes it possible to
                              have several windows side-by-side.  The default wrapping on such
                              devices looks ugly.  Therefore, please limit all lines to a maximum
                              of 79 characters. For flowing long blocks of text (docstrings or
                              comments), limiting the length to 72 characters is recommended.
                              
                              Reports error E501.

                              There are no issues that match your filters.

                              Category
                              Status