Passed
Push — main ( cdf0f7...3de8e8 )
by Douglas
01:40
created

mandos.entries   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 17
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 5

1 Method

Rating   Name   Duplication   Size   Complexity  
A EntryMeta.set_logging() 0 12 5
1
from pathlib import Path
0 ignored issues
show
introduced by
Missing module docstring
Loading history...
2
from typing import Optional
3
4
from mandos import MandosLogging
5
6
7
class EntryMeta:
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
8
    @classmethod
9
    def set_logging(cls, verbose: bool, quiet: bool, log: Optional[Path]) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
10
        if verbose and quiet:
0 ignored issues
show
Unused Code introduced by
Unnecessary "elif" after "raise"
Loading history...
11
            raise ValueError(f"Cannot set both --quiet and --verbose")
0 ignored issues
show
introduced by
Using an f-string that does not have any interpolated variables
Loading history...
12
        elif quiet:
13
            level = "ERROR"
14
        elif verbose:
15
            level = "INFO"
16
        else:
17
            level = "WARNING"
18
        MandosLogging.set_log_level(level, log)
19
        return level
20
21
22
__all__ = ["EntryMeta"]
23