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

mandos.model.apis._QueryMixin._query()   A

Complexity

Conditions 1

Size

Total Lines 7
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 7
nop 2
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
from pocketutils.core.query_utils import QueryExecutor
0 ignored issues
show
introduced by
Missing module docstring
Loading history...
introduced by
Unable to import 'pocketutils.core.query_utils'
Loading history...
2
3
from mandos.model.utils import logger
4
5
6
class _QueryMixin:
7
    @property
8
    def executor(self) -> QueryExecutor:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
9
        raise NotImplementedError()
10
11
    def _query(self, url: str) -> str:
12
        data = self.executor(url)
13
        tt = self.executor.last_time_taken
0 ignored issues
show
Coding Style Naming introduced by
Variable name "tt" 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
        wt, qt = tt.wait.total_seconds(), tt.query.total_seconds()
0 ignored issues
show
Coding Style Naming introduced by
Variable name "wt" 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...
Coding Style Naming introduced by
Variable name "qt" 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...
15
        bts = int(len(data) * 8 / 1024)
16
        logger.trace(f"Queried {bts} kb from {url} in {qt:.1} s with {wt:.1} s of wait")
17
        return data
18
19
20
__all__ = ["QueryExecutor"]
21