Passed
Pull Request — master (#206)
by Grega
02:08
created

NiaPy.Runner.run()   D

Complexity

Conditions 12

Size

Total Lines 48
Code Lines 29

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 12
eloc 29
nop 3
dl 0
loc 48
rs 4.8
c 0
b 0
f 0

How to fix   Complexity   

Complexity

Complex classes like NiaPy.Runner.run() 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
# encoding=utf8
2
3
"""Python micro framework for building nature-inspired algorithms."""
4
5
from __future__ import print_function
6
7
8
from NiaPy import util, algorithms, benchmarks, task
9
from NiaPy.runner import Runner
10
11
__all__ = ["algorithms", "benchmarks", "util", "task", "Runner"]
12
__project__ = "NiaPy"
13
__version__ = "2.0.0rc4"
14
15
VERSION = "{0} v{1}".format(__project__, __version__)
16