Passed
Branch master (0fb205)
by Oleksandr
03:17
created

commons.spatial   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
eloc 17
dl 0
loc 25
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A Point2D.__repr__() 0 2 1
A Point3D.__init__() 0 4 1
A Point2D.__init__() 0 3 1
A Point3D.__repr__() 0 2 1
1 1
from .structures import BaseStructure
2
3
4 1
class Point2D(BaseStructure):
5 1
  __slots__ = ['x', 'y', ]
6
7 1
  def __init__(self, x, y):
8 1
    self.x = float(x)
9 1
    self.y = float(y)
10
11
  def __repr__(self):
12
    return "<Point2D '{0};{1}'>".format(self.x, self.y)
13
14
15 1
class Point3D(BaseStructure):
16 1
  __slots__ = ['x', 'y', 'z', ]
17
18 1
  def __init__(self, x, y, z):
19 1
    self.x = float(x)
20 1
    self.y = float(y)
21 1
    self.z = float(z)
22
23
  def __repr__(self):
24
    return "<Point3D '{0};{1};{2}'>".format(self.x, self.y, self.z)
25