Completed
Push — master ( b5dda9...e3d08a )
by Piotr
01:09
created

test_version_data_exists()   C

Complexity

Conditions 10

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 10
c 1
b 0
f 0
dl 0
loc 10
rs 6

2 Methods

Rating   Name   Duplication   Size   Complexity  
A test_version_contains_url() 0 2 2
A test_version_contains_description() 0 2 2

How to fix   Complexity   

Complexity

Complex classes like test_version_data_exists() often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.

Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.

1
from mountapi import version
2
3
4
def test_version_contains_name():
5
    assert hasattr(version, '__name__')
6
7
8
def test_version_contains_description():
9
    assert hasattr(version, '__description__')
10
11
12
def test_version_contains_url():
13
    assert hasattr(version, '__url__')
14
15
16
def test_version_contains_version():
17
    assert hasattr(version, '__version__')
18
19
20
def test_version_contains_build():
21
    assert hasattr(version, '__build__')
22
23
24
def test_version_contains_author():
25
    assert hasattr(version, '__author__')
26
27
28
def test_version_contains_author_email():
29
    assert hasattr(version, '__author_email__')
30
31
32
def test_version_contains_license():
33
    assert hasattr(version, '__license__')
34
35
36
def test_version_contains_copyright():
37
    assert hasattr(version, '__copyright__')
38