Map   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
c 3
b 0
f 0
dl 0
loc 15
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A remove_object() 0 2 1
A add_object() 0 2 1
A get_object() 0 2 1
A __init__() 0 3 1
1
class Map:
2
3
    def __init__(self):
4
        self._map = {
5
            'objects': {}
6
        }
7
8
    def get_object(self, object_id):
9
        return self._map['objects'][object_id]
10
11
    def add_object(self, obj):
12
        self._map['objects'][obj.get_id()] = obj
13
14
    def remove_object(self, obj):
15
        del(self._map['objects'][obj.get_id()])