Passed
Push — dependabot/pip/selenium-4.0.0 ( 3d45c5...314fb9 )
by
unknown
11:30 queued 09:22
created

mandos.model.apis.pubchem_support._patterns   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 15
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 1

1 Function

Rating   Name   Duplication   Size   Complexity  
A _compile() 0 2 1
1
import regex
0 ignored issues
show
introduced by
Unable to import 'regex'
Loading history...
introduced by
Missing module docstring
Loading history...
2
3
4
def _compile(p: str) -> regex.Pattern:
0 ignored issues
show
Coding Style Naming introduced by
Argument name "p" 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...
5
    return regex.compile(p, flags=regex.V1)
6
7
8
class Patterns:
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
9
    ghs_code = _compile(r"((?:H\d+)(?:\+H\d+)*)")
10
    ghs_code_singles = _compile(r"(H\d+)")
11
    pubchem_compound_url = _compile(r"^https:\/\/pubchem\.ncbi\.nlm\.nih\.gov\/compound\/(.+)$")
12
    atc_codes = _compile(r"([A-Z])([0-9]{2})?([A-Z])?([A-Z])?([A-Z])?")
13
    mesh_codes = _compile(r"[A-Z]")
14
    # "gm" means gram
15
    mg_per_kg_pattern = _compile(r"([0-9.]+)\s*((?:[munp]g)|(?:gm?))/kg")
16
    atc_parts_pattern = pat = _compile(r"([A-Z])([0-9]{2})?([A-Z])?([A-Z])?([A-Z])?")
17
    target_name_abbrev_species_pattern_1 = _compile(r"^(.+?)\(([^)]+)\)+$")
18
    target_name_abbrev_species_pattern_2 = _compile(r"^ *([^ ]+) +- +(.+)$")
19
20
21
__all__ = ["Patterns"]
22