build.graph.weights   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 50%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 17
ccs 3
cts 6
cp 0.5
rs 10
c 0
b 0
f 0
wmc 3

3 Functions

Rating   Name   Duplication   Size   Complexity  
A nx_edge_data_delay() 0 3 1
A nx_edge_data_priority() 0 3 1
A nx_edge_data_weight() 0 3 1
1
"""Weight functions for use in pathfinding."""
2
# pylint: disable=unused-argument
3
4 1
def nx_edge_data_weight(edge_u, edge_v, edge_data: dict):
5
    """Return custom edge data value to be used as a callback by nx."""
6
    return edge_data.get("hop", 1)
7
8
9 1
def nx_edge_data_delay(edge_u, edge_v, edge_data: dict):
10
    """Return custom edge data value to be used as a callback by nx."""
11
    return edge_data.get("delay", 1)
12
13
14 1
def nx_edge_data_priority(edge_u, edge_v, edge_data: dict):
15
    """Return custom edge data value to be used as a callback by nx."""
16
    return edge_data.get("priority", 1)
17