aiogremlin.structure.graph   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 14
dl 0
loc 19
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A Graph.__init__() 0 4 2
A Graph.traversal() 0 5 2
1
from aiogremlin.process import graph_traversal
2
from aiogremlin.process.traversal import AsyncTraversalStrategies
3
4
from gremlin_python.structure import graph
5
6
7
class Graph(graph.Graph):
8
9
    def __init__(self):
10
        if self.__class__ not in AsyncTraversalStrategies.global_cache:
11
            AsyncTraversalStrategies.global_cache[
12
                self.__class__] = AsyncTraversalStrategies()
13
14
    def traversal(self, traversal_source_class=None):
15
        if not traversal_source_class:
16
            traversal_source_class = graph_traversal.AsyncGraphTraversalSource
17
        return traversal_source_class(
18
            self, AsyncTraversalStrategies.global_cache[self.__class__])
19