Completed
Push — master ( 3c108b...266306 )
by Oleksandr
03:35
created

verboselib.cli.command_base   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 8
eloc 36
dl 0
loc 50
rs 10
c 0
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A BaseCommand.name() 0 3 1
A BaseCommandExecutor.__init__() 0 3 1
A BaseCommand.make_parser() 0 4 1
A BaseCommand.executor_class() 0 3 1
A BaseCommand.make_executor() 0 3 1
A BaseCommandExecutor.__call__() 0 3 1
A BaseCommand.aliases() 0 3 1
A BaseCommandExecutor._print_input_args() 0 3 1
1
import abc
0 ignored issues
show
introduced by
Missing module docstring
Loading history...
2
import argparse
3
4
from typing import Callable
0 ignored issues
show
Unused Code introduced by
Unused Callable imported from typing
Loading history...
5
from typing import List
6
from typing import Text
7
from typing import Type
8
9
from .lang import classproperty_readonly
10
from .utils import print_out
11
12
13
class BaseCommandExecutor(abc.ABC):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
14
15
  @abc.abstractmethod
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 4 spaces were expected, but 2 were found.
Loading history...
16
  def __init__(self, args: argparse.Namespace) -> None:
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 4 spaces were expected, but 2 were found.
Loading history...
17
    ...
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 8 spaces were expected, but 4 were found.
Loading history...
18
19
  @abc.abstractmethod
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 4 spaces were expected, but 2 were found.
Loading history...
20
  def __call__(self) -> None:
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 4 spaces were expected, but 2 were found.
Loading history...
21
    ...
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 8 spaces were expected, but 4 were found.
Loading history...
22
23
  @staticmethod
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 4 spaces were expected, but 2 were found.
Loading history...
24
  def _print_input_args(**kwargs) -> None:
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 4 spaces were expected, but 2 were found.
Loading history...
25
    print_out(f"input args: {kwargs}")
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 8 spaces were expected, but 4 were found.
Loading history...
26
27
28
class BaseCommand(abc.ABC):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
29
30
  @classproperty_readonly
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 4 spaces were expected, but 2 were found.
Loading history...
31
  def name(self) -> Text:
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 4 spaces were expected, but 2 were found.
Loading history...
introduced by
Missing function or method docstring
Loading history...
32
    raise NotImplementedError
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 8 spaces were expected, but 4 were found.
Loading history...
33
34
  @classproperty_readonly
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 4 spaces were expected, but 2 were found.
Loading history...
35
  def aliases(self) -> List[Text]:
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 4 spaces were expected, but 2 were found.
Loading history...
introduced by
Missing function or method docstring
Loading history...
36
    return []
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 8 spaces were expected, but 4 were found.
Loading history...
37
38
  @classproperty_readonly
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 4 spaces were expected, but 2 were found.
Loading history...
39
  def executor_class(self) -> Type[BaseCommandExecutor]:
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 4 spaces were expected, but 2 were found.
Loading history...
introduced by
Missing function or method docstring
Loading history...
40
    raise NotImplementedError
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 8 spaces were expected, but 4 were found.
Loading history...
41
42
  @classmethod
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 4 spaces were expected, but 2 were found.
Loading history...
43
  def make_executor(cls, args=argparse.Namespace) -> BaseCommandExecutor:
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 4 spaces were expected, but 2 were found.
Loading history...
introduced by
Missing function or method docstring
Loading history...
44
    return cls.executor_class(args)
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 8 spaces were expected, but 4 were found.
Loading history...
45
46
  @classmethod
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 4 spaces were expected, but 2 were found.
Loading history...
47
  @abc.abstractmethod
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 4 spaces were expected, but 2 were found.
Loading history...
48
  def make_parser(cls, factory=argparse.ArgumentParser) -> argparse.ArgumentParser:
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 4 spaces were expected, but 2 were found.
Loading history...
introduced by
Missing function or method docstring
Loading history...
49
    ...
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 8 spaces were expected, but 4 were found.
Loading history...
50