GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Failed Conditions
Pull Request — master (#17)
by Yngve
03:33
created

paytext.paytext.PaymentText.__repr__()   A

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 2
rs 10
c 0
b 0
f 0
cc 1
nop 1
1
# pyre-strict
0 ignored issues
show
Coding Style introduced by
This module should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
2
3
from pprint import pprint
0 ignored issues
show
Unused Code introduced by
Unused pprint imported from pprint
Loading history...
4
from re import sub, compile
0 ignored issues
show
Bug Best Practice introduced by
This seems to re-define the built-in compile.

It is generally discouraged to redefine built-ins as this makes code very hard to read.

Loading history...
Unused Code introduced by
Unused sub imported from re
Loading history...
5
from typing import List, Any
6
7
import iso4217parse
0 ignored issues
show
introduced by
Unable to import 'iso4217parse'
Loading history...
8
9
10
class PaymentText:
1 ignored issue
show
Coding Style introduced by
This class should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
Unused Code introduced by
The variable __class__ seems to be unused.
Loading history...
11
    text: str = ''
1 ignored issue
show
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
12
13
    def __init__(self, text: str) -> None:
1 ignored issue
show
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
14
        self.text = text
1 ignored issue
show
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
15
16
    def __repr__(self) -> str:
1 ignored issue
show
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
17
        return self.text
1 ignored issue
show
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
18
19
    def clean(self) -> None:
1 ignored issue
show
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
20
        parts: List[str] = self.text.split()
1 ignored issue
show
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
21
22
        # pprint(parts)
23
24
        pattern = compile('\*\d{4}')
1 ignored issue
show
Bug introduced by
A suspicious escape sequence \* was found. Did you maybe forget to add an r prefix?

Escape sequences in Python are generally interpreted according to rules similar to standard C. Only if strings are prefixed with r or R are they interpreted as regular expressions.

The escape sequence that was used indicates that you might have intended to write a regular expression.

Learn more about the available escape sequences. in the Python documentation.

Loading history...
Bug introduced by
A suspicious escape sequence \d was found. Did you maybe forget to add an r prefix?

Escape sequences in Python are generally interpreted according to rules similar to standard C. Only if strings are prefixed with r or R are they interpreted as regular expressions.

The escape sequence that was used indicates that you might have intended to write a regular expression.

Learn more about the available escape sequences. in the Python documentation.

Loading history...
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
25
26
        try:
1 ignored issue
show
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
27
            if pattern.match(parts[0]):
2 ignored issues
show
Comprehensibility Best Practice introduced by
The variable parts does not seem to be defined.
Loading history...
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
28
                del parts[0]
1 ignored issue
show
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
29
        except IndexError:
1 ignored issue
show
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
30
            return
1 ignored issue
show
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
31
32
        pattern = compile('\d{2}\.\d{2}')
1 ignored issue
show
Bug introduced by
A suspicious escape sequence \d was found. Did you maybe forget to add an r prefix?

Escape sequences in Python are generally interpreted according to rules similar to standard C. Only if strings are prefixed with r or R are they interpreted as regular expressions.

The escape sequence that was used indicates that you might have intended to write a regular expression.

Learn more about the available escape sequences. in the Python documentation.

Loading history...
Bug introduced by
A suspicious escape sequence \. was found. Did you maybe forget to add an r prefix?

Escape sequences in Python are generally interpreted according to rules similar to standard C. Only if strings are prefixed with r or R are they interpreted as regular expressions.

The escape sequence that was used indicates that you might have intended to write a regular expression.

Learn more about the available escape sequences. in the Python documentation.

Loading history...
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
33
34
        if pattern.match(parts[0]):
1 ignored issue
show
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
35
            del parts[0]
1 ignored issue
show
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
36
37
        currency: Any = iso4217parse.by_alpha3(parts[0])
1 ignored issue
show
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
38
39
        if isinstance(currency, iso4217parse.Currency):
2 ignored issues
show
Comprehensibility Best Practice introduced by
The variable currency does not seem to be defined.
Loading history...
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
40
            del parts[0]
1 ignored issue
show
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
41
            del parts[0]
1 ignored issue
show
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
42
43
        pattern = compile('\d{1}\.\d{4}')
1 ignored issue
show
Bug introduced by
A suspicious escape sequence \d was found. Did you maybe forget to add an r prefix?

Escape sequences in Python are generally interpreted according to rules similar to standard C. Only if strings are prefixed with r or R are they interpreted as regular expressions.

The escape sequence that was used indicates that you might have intended to write a regular expression.

Learn more about the available escape sequences. in the Python documentation.

Loading history...
Bug introduced by
A suspicious escape sequence \. was found. Did you maybe forget to add an r prefix?

Escape sequences in Python are generally interpreted according to rules similar to standard C. Only if strings are prefixed with r or R are they interpreted as regular expressions.

The escape sequence that was used indicates that you might have intended to write a regular expression.

Learn more about the available escape sequences. in the Python documentation.

Loading history...
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
44
45
        if pattern.match(parts[-1]):
1 ignored issue
show
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
46
            del parts[-1]
1 ignored issue
show
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
47
            del parts[-1]
1 ignored issue
show
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
48
49
        pattern = compile('\d{2}\.\d{2}\.\d{2}')
1 ignored issue
show
Bug introduced by
A suspicious escape sequence \d was found. Did you maybe forget to add an r prefix?

Escape sequences in Python are generally interpreted according to rules similar to standard C. Only if strings are prefixed with r or R are they interpreted as regular expressions.

The escape sequence that was used indicates that you might have intended to write a regular expression.

Learn more about the available escape sequences. in the Python documentation.

Loading history...
Bug introduced by
A suspicious escape sequence \. was found. Did you maybe forget to add an r prefix?

Escape sequences in Python are generally interpreted according to rules similar to standard C. Only if strings are prefixed with r or R are they interpreted as regular expressions.

The escape sequence that was used indicates that you might have intended to write a regular expression.

Learn more about the available escape sequences. in the Python documentation.

Loading history...
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
50
51
        if pattern.match(parts[-1]):
1 ignored issue
show
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
52
            del parts[-1]
1 ignored issue
show
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
53
54
            pattern = compile('.+:')
1 ignored issue
show
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
55
56
            if pattern.match(parts[-1]):
1 ignored issue
show
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
57
                del parts[-1]
1 ignored issue
show
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
58
59
        pattern = compile('\d+,\d{2}')
1 ignored issue
show
Bug introduced by
A suspicious escape sequence \d was found. Did you maybe forget to add an r prefix?

Escape sequences in Python are generally interpreted according to rules similar to standard C. Only if strings are prefixed with r or R are they interpreted as regular expressions.

The escape sequence that was used indicates that you might have intended to write a regular expression.

Learn more about the available escape sequences. in the Python documentation.

Loading history...
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
60
61
        if pattern.match(parts[-1]):
1 ignored issue
show
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
62
            del parts[-1]
1 ignored issue
show
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
63
64
            currency: Any = iso4217parse.by_alpha3(parts[-1])
1 ignored issue
show
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
65
            if isinstance(currency, iso4217parse.Currency):
1 ignored issue
show
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
66
                del parts[-1]
1 ignored issue
show
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
67
68
        text = ' '.join(parts)
1 ignored issue
show
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
69
70
        self.text = text
1 ignored issue
show
Coding Style introduced by
Found indentation with spaces instead of tabs
Loading history...
71