Showing 365 of 2,578 total issues
Avoid deeply nested control flow statements. Open
with conan_v2_property(conanfile, 'options',
"'self.options' access in source() method is deprecated"):
conanfile.source()
Avoid deeply nested control flow statements. Open
if node.binary == BINARY_MISSING:
self._raise_missing([node])
if node.binary == BINARY_EDITABLE:
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 isinstance(attr, dict): # options, settings
attr = OrderedDict(sorted(attr.items()))
for key, value in attr.items():
self._print_colored_line(key, value=value, indent=3)
elif isinstance(attr, list): # full requires
Avoid deeply nested control flow statements. Open
if "@" not in ref:
ref += "@"
else:
Avoid deeply nested control flow statements. Open
if name in libs:
_save_lib_path(name, full_path)
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
Avoid deeply nested control flow statements. Open
if node.prev is None:
node.prev = prev
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 start:
break
start = True
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
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 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 __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
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
for file_doc in down_module["files"]:
module.dependencies.append(_get_dependency(file_doc, mod_dep_id))
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:
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,
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_build_order
has 11 arguments (exceeds 10 allowed). Consider refactoring. Open
def info_build_order(self, reference, settings=None, options=None, env=None,