LucaCappelletti94/tinycrawler

View on GitHub
tinycrawler/proxy/proxy.py

Summary

Maintainability
A
0 mins
Test Coverage

Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
Invalid

    def __init__(self, data: Dict, proxy_timeout: float, domains_timeout: float, custom_domains_timeout: Callable[[str], float], follow_robots_txt: bool, robots: Robots):
Severity: Minor
Found in tinycrawler/proxy/proxy.py - About 45 mins to fix

    Line too long (170 > 79 characters)
    Open

        def __init__(self, data: Dict, proxy_timeout: float, domains_timeout: float, custom_domains_timeout: Callable[[str], float], follow_robots_txt: bool, robots: Robots):
    Severity: Minor
    Found in tinycrawler/proxy/proxy.py by pep8

    Limit all lines to a maximum of 79 characters.

    There are still many devices around that are limited to 80 character
    lines; plus, limiting windows to 80 characters makes it possible to
    have several windows side-by-side.  The default wrapping on such
    devices looks ugly.  Therefore, please limit all lines to a maximum
    of 79 characters. For flowing long blocks of text (docstrings or
    comments), limiting the length to 72 characters is recommended.
    
    Reports error E501.

    Missing whitespace around operator
    Open

        def failure_rate(self)->float:
    Severity: Minor
    Found in tinycrawler/proxy/proxy.py by pep8

    Surround operators with a single space on either side.

    - Always surround these binary operators with a single space on
      either side: assignment (=), augmented assignment (+=, -= etc.),
      comparisons (==, <, >, !=, <=, >=, in, not in, is, is not),
      Booleans (and, or, not).
    
    - If operators with different priorities are used, consider adding
      whitespace around the operators with the lowest priorities.
    
    Okay: i = i + 1
    Okay: submitted += 1
    Okay: x = x * 2 - 1
    Okay: hypot2 = x * x + y * y
    Okay: c = (a + b) * (a - b)
    Okay: foo(bar, key='word', *args, **kwargs)
    Okay: alpha[:-i]
    
    E225: i=i+1
    E225: submitted +=1
    E225: x = x /2 - 1
    E225: z = x **y
    E225: z = 1and 1
    E226: c = (a+b) * (a-b)
    E226: hypot2 = x*x + y*y
    E227: c = a|b
    E228: msg = fmt%(errno, errmsg)

    Line too long (136 > 79 characters)
    Open

            return {protocol:  "{protocol}://{ip}:{port}".format(protocol=protocol, ip=data["ip"], port=data["port"]) for key, protocol in {
    Severity: Minor
    Found in tinycrawler/proxy/proxy.py by pep8

    Limit all lines to a maximum of 79 characters.

    There are still many devices around that are limited to 80 character
    lines; plus, limiting windows to 80 characters makes it possible to
    have several windows side-by-side.  The default wrapping on such
    devices looks ugly.  Therefore, please limit all lines to a maximum
    of 79 characters. For flowing long blocks of text (docstrings or
    comments), limiting the length to 72 characters is recommended.
    
    Reports error E501.

    There are no issues that match your filters.

    Category
    Status