bundlewrap / bundlewrap

Function with cyclomatic complexity higher than threshold PY-R1000
Anti-pattern
Minor
2 months ago6 months old
NodeMetadataProxy.get has a cyclomatic complexity of 16 with "high" risk
140        else:
141            return self._metastack
142
143    def get(self, path, default=NO_DEFAULT, _backwards_compatibility_default=True):144        if (
145            default == NO_DEFAULT and
146            _backwards_compatibility_default and
File.validate_attributes has a cyclomatic complexity of 25 with "high" risk
583            return 0, p.decode()
584
585    @classmethod
586    def validate_attributes(cls, bundle, item_id, attributes):587        if attributes.get('delete', False):
588            for attr in attributes.keys():
589                if attr not in ['delete'] + list(BUILTIN_ITEM_ATTRIBUTES.keys()):
run_local has a cyclomatic complexity of 16 with "high" risk
105        return ret
106
107
108def run_local(109    command,
110    data_stdin=None,
111    log_function=None,
_inject_concurrency_blockers has a cyclomatic complexity of 18 with "high" risk
223                items.add(TagFillerItem(bundle, tag, {'tags': {tag}}))
224
225
226def _inject_concurrency_blockers(items, node_os, node_os_version):227    """
228    Looks for items with BLOCK_CONCURRENT set and inserts daisy-chain
229    dependencies to force a sequential apply.
bw_metadata has a cyclomatic complexity of 30 with "very-high" risk
 90
 91
 92@exit_on_keyboardinterrupt
 93def bw_metadata(repo, args): 94    target_nodes = get_target_nodes(repo, args['targets'])
 95    key_paths = sorted([
 96        tuple(path.strip().split("/")) for path in args['keys'] if path