Showing 364 of 2,550 total issues
Avoid deeply nested control flow statements. 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
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
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))
Avoid deeply nested control flow statements. Open
if member.linkpath.startswith(common_folder):
# https://github.com/conan-io/conan/issues/11065
linkpath = member.linkpath.replace("\\", "/")
member.linkpath = linkpath.split("/", 1)[1]
member.linkname = member.linkpath
Avoid deeply nested control flow statements. Open
if (temp_value.isnumeric() or
temp_value in ['true', 'false', 'undefined']):
value = temp_value
config[key] = value
Avoid deeply nested control flow statements. Open
if "@" not in ref:
ref += "@"
else:
Avoid deeply nested control flow statements. Open
if start:
break
start = True
Avoid deeply nested control flow statements. Open
if name in libs:
_save_lib_path(name, full_path)
Avoid deeply nested control flow statements. Open
if node.prev is None:
node.prev = prev
Avoid deeply nested control flow statements. Open
for comp_name, comp_cpp_info in sorted_components:
public_deps.append((_format_name(d.ref.name), _format_name(comp_name)))
else:
Avoid deeply nested control flow statements. Open
for file_doc in down_module["files"]:
module.dependencies.append(_get_dependency(file_doc, mod_dep_id))
Avoid deeply nested control flow statements. Open
for comp_name, comp in components.items():
for dep_name, dep in components.items():
for require in self._filter_component_requires(dep.requires):
if require == comp_name:
dset.add(" {} requires {}".format(dep_name, comp_name))
Function context
has a Cognitive Complexity of 23 (exceeds 20 allowed). Consider refactoring. Open
def context(self):
# Parsing existing toolchain file to get existing configured runtimes
settings = self._conanfile.settings
if settings.get_safe("os") != "Windows":
return
- 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
Function __init__
has a Cognitive Complexity of 23 (exceeds 20 allowed). Consider refactoring. Open
def __init__(self, conanfile, backend=None):
self._conanfile = conanfile
self._os = self._conanfile.settings.get_safe("os")
self._is_apple_system = is_apple_os(self._conanfile)
- 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
Function infix_to_postfix
has a Cognitive Complexity of 23 (exceeds 20 allowed). Consider refactoring. Open
def infix_to_postfix(exp):
"""
Translates an infix expression to postfix using an standard algorithm
with little hacks for parse complex expressions like "compiler.version=4"
instead of just numbers and without taking in account the operands priority
- 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
if "@" not in ref:
ref = ref.replace("#", "@#")
if (ref, locked_node.package_id, locked_node.context) not in total_prefs:
Avoid deeply nested control flow statements. Open
if member.linkpath.startswith(common_folder):
# https://github.com/conan-io/conan/issues/11065
linkpath = member.linkpath.replace("\\", "/")
member.linkpath = linkpath.split("/", 1)[1]
member.linkname = member.linkpath
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,
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,
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,