benedict.core.move   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 8
dl 0
loc 9
rs 10
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A move() 0 8 4
1
def move(d, key_src, key_dest, overwrite=True):
2
    if key_dest == key_src:
3
        return
4
    if key_dest in d and not overwrite:
5
        raise KeyError(
6
            f"Invalid key: '{key_dest}', key already in target dict and 'overwrite' is disabled."
7
        )
8
    d[key_dest] = d.pop(key_src)
9