conans/model/lock_bundle.py
Function update_bundle
has a Cognitive Complexity of 29 (exceeds 20 allowed). Consider refactoring. Open
Open
def update_bundle(bundle_path, revisions_enabled):
""" Update both the bundle information as well as every individual lockfile, from the
information that was modified in the individual lockfile. At the end, all lockfiles will
have the same PREV for the binary of same package_id
"""
- 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 create
has a Cognitive Complexity of 24 (exceeds 20 allowed). Consider refactoring. Open
Open
def create(lockfiles, revisions_enabled, cwd):
def ref_convert(r):
# Necessary so "build-order" output is usable by install
if "@" not in r:
if "#" in r:
- 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
if graph_lock.nodes[node_id].prev is None:
graph_lock.nodes[node_id].prev = prev
graph_lock_conf.save(lockfile)