Passed
Push — main ( 4b9dc0...1b55d1 )
by Douglas
06:16 queued 02:32
created

mandos.entry.entry()   A

Complexity

Conditions 1

Size

Total Lines 13
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 11
nop 0
dl 0
loc 13
rs 9.85
c 0
b 0
f 0
1
import time
0 ignored issues
show
introduced by
Missing module docstring
Loading history...
2
from functools import wraps
3
4
from pocketutils.tools.unit_tools import UnitTools
0 ignored issues
show
introduced by
Unable to import 'pocketutils.tools.unit_tools'
Loading history...
5
6
from mandos.model.utils.setup import logger
7
8
9
def entry():
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
10
    @wraps(entry)
11
    def dec(func):
12
        def my_fn(*args, **kwargs):
13
            t0 = time.monotonic()
0 ignored issues
show
Coding Style Naming introduced by
Variable name "t0" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
14
            results = func(*args, **kwargs)
15
            delta = UnitTools.delta_time_to_str(time.monotonic() - t0)
16
            logger.debug(f"Command took {delta}")
17
            return results
18
19
        return wraps(func)(my_fn)
20
21
    return dec
22
23
24
__all__ = ["entry"]
25