mine.models._bases   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 18
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A NameMixin.__ne__() 0 2 1
A NameMixin.__lt__() 0 2 1
A NameMixin.__str__() 0 2 1
A NameMixin.__eq__() 0 2 1
1
"""Shared base classes and mixins."""
2
3
4 1
class NameMixin:
5
    """Mixin class for objects identified by their name."""
6
7 1
    def __str__(self):
8 1
        return str(self.name)
9
10 1
    def __eq__(self, other):
11 1
        return str(self).lower() == str(other).lower()
12
13 1
    def __ne__(self, other):
14 1
        return not self.__eq__(other)
15
16 1
    def __lt__(self, other):
17
        return str(self).lower() < str(other).lower()
18