Showing 365 of 2,578 total issues
Function build_sln_command
has 12 arguments (exceeds 10 allowed). Consider refactoring. Open
Open
def build_sln_command(settings, sln_path, targets=None, upgrade_project=True, build_type=None,
Avoid deeply nested control flow statements. Open
Open
if isinstance(value, list):
updates[prop_name] = [os.path.join(folder, v) for v in value]
else:
updates[prop_name] = os.path.join(folder, value)
component._generator_properties.update(updates)
Avoid deeply nested control flow statements. Open
Open
if getattr(component, n):
dest = result.get_init(n, [])
dest.extend([i for i in getattr(component, n) if i not in dest])
# NOTE: The properties are not aggregated because they might refer only to the
Avoid deeply nested control flow statements. Open
Open
if os.path.isfile(windows_h):
return sdk_version
return None
Function _evaluate_remote_pkg
has a Cognitive Complexity of 23 (exceeds 20 allowed). Consider refactoring. Open
Open
def _evaluate_remote_pkg(self, node, pref, remote, remotes, remote_selected):
remote_info = None
# If the remote is pinned (remote_selected) we won't iterate the remotes.
# The "remote" can come from -r or from the registry (associated ref)
if remote_selected or remote:
- Read upRead up
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
Open
if package_id == node.package_id:
node.conanfile.output.info("Compatible package ID %s equal to the "
"default package ID" % package_id)
continue
pref = PackageReference(node.ref, package_id)
Avoid deeply nested control flow statements. Open
Open
if not is_editable:
# IMPORTANT: Need to go first, otherwise fill_old_cppinfo() destroys
# component information
conanfile.layouts.package.set_relative_base_folder(conanfile.package_folder)
conanfile.buildenv_info.compose_env(conanfile.layouts.package.buildenv_info)
Avoid deeply nested control flow statements. Open
Open
if not is_editable and not hasattr(conanfile, "layout"):
# FIXME: The default for the cppinfo from build are not the same
# so this check fails when editable
# FIXME: Remove when new cppinfo model. If using the layout method
# the cppinfo object is filled from self.cpp.package new
Avoid deeply nested control flow statements. Open
Open
if comp_name not in [require for dep in components.values() for require in
self._filter_component_requires(dep.requires)]:
ordered[comp_name] = comp
del components[comp_name]
break
Function load_graph
has 12 arguments (exceeds 10 allowed). Consider refactoring. Open
Open
def load_graph(self, reference, create_reference, graph_info, build_mode, check_updates, update,
Avoid deeply nested control flow statements. Open
Open
if isinstance(value, list):
value = copy.copy(value) # Aware of copying by reference the list
self.add(name, value, package_name)
Avoid deeply nested control flow statements. Open
Open
if verify(trick_path):
return trick_path
Function aggregated_components
has a Cognitive Complexity of 23 (exceeds 20 allowed). Consider refactoring. Open
Open
def aggregated_components(self):
"""Aggregates all the components as global values, returning a new NewCppInfo"""
if self._aggregated is None:
if self.has_components:
result = _NewComponent()
- Read upRead up
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
Open
if prev is None:
prev = lock_prev
prev_lockfile = lockfile
modified = graph_lock.nodes[node_id].modified
elif lock_prev is not None and prev != lock_prev:
Avoid deeply nested control flow statements. Open
Open
for cur_name, _ in self.settings.items():
if cur_name.startswith("%s." % name):
del res[cur_name]
# Now merge the new values
res.update(new_settings)
Avoid deeply nested control flow statements. Open
Open
if ctxt == CONTEXT_BUILD:
br_build.append((it, ctxt))
else:
br_host.append((it, ctxt))
if br_build:
Avoid deeply nested control flow statements. Open
Open
if product_type in product["productId"]:
vs_paths.append(product["installationPath"])
# Append products without "productId" (Legacy installations)
for product in seen_products:
Avoid deeply nested control flow statements. Open
Open
if br_key in package_build_requires: # Override defined
# this is a way to have only one package Name for all versions
# (no conflicts)
# but the dict key is not used at all
package_build_requires[br_key] = build_require
Avoid deeply nested control flow statements. Open
Open
if graph_lock.nodes[node_id].prev is None:
graph_lock.nodes[node_id].prev = prev
graph_lock_conf.save(lockfile)
Avoid deeply nested control flow statements. Open
Open
if node.binary not in (BINARY_MISSING, ):
node.conanfile.output.info("Main binary package '%s' missing. Using "
"compatible package '%s'"
% (node.package_id, package_id))