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
- 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 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)
- 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 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)
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,
Function upload
has 12 arguments (exceeds 10 allowed). Consider refactoring. Open
def upload(self, reference_or_pattern, remotes, upload_recorder, package_id=None,
Function __init__
has 12 arguments (exceeds 10 allowed). Consider refactoring. Open
def __init__(self, conanfile, generator=None, cmake_system_name=True,
Avoid deeply nested control flow statements. Open
if metadata.recipe.remote == renamed:
metadata.recipe.remote = remote_name
for pkg_metadata in metadata.packages.values():
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.
- 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
with open(abs_path, 'rb') as file_handler:
tgz.addfile(tarinfo=info, fileobj=file_handler)
tgz.close()
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.
- 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 pkg_metadata.remote == remote_name:
pkg_metadata.remote = None
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":
- 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 _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)
- 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 self._print_commands_to_output:
log_handler.write(call_message)
return self._pipe_os_call(command, stream_output, log_handler, cwd, user_output)
Avoid deeply nested control flow statements. Open
if pkg_metadata.remote == remote_name:
pkg_metadata.remote = new_remote_name
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))
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()))
- 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 workspace_install
has 12 arguments (exceeds 10 allowed). Consider refactoring. Open
def workspace_install(self, path, settings=None, options=None, env=None,
Avoid deeply nested control flow statements. Open
if isinstance(src_dirs, list): # it can return a "config" CppInfo item!
src_dirs += src_dir