motom001/DoorPi

View on GitHub
doorpi/sipphone/pjsua_lib/Config.py

Summary

Maintainability
A
0 mins
Test Coverage

Expected 2 blank lines, found 1
Open

def create_UAConfig():
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.py by pep8

Separate top-level function and class definitions with two blank lines.

Method definitions inside a class are separated by a single blank
line.

Extra blank lines may be used (sparingly) to separate groups of
related functions.  Blank lines may be omitted between a bunch of
related one-liners (e.g. a set of dummy implementations).

Use blank lines in functions, sparingly, to indicate logical
sections.

Okay: def a():\n    pass\n\n\ndef b():\n    pass
Okay: def a():\n    pass\n\n\nasync def b():\n    pass
Okay: def a():\n    pass\n\n\n# Foo\n# Bar\n\ndef b():\n    pass
Okay: default = 1\nfoo = 1
Okay: classify = 1\nfoo = 1

E301: class Foo:\n    b = 0\n    def bar():\n        pass
E302: def a():\n    pass\n\ndef b(n):\n    pass
E302: def a():\n    pass\n\nasync def b(n):\n    pass
E303: def a():\n    pass\n\n\n\ndef b(n):\n    pass
E303: def a():\n\n\n\n    pass
E304: @decorator\n\ndef a():\n    pass
E305: def a():\n    pass\na()
E306: def a():\n    def b():\n        pass\n    def c():\n        pass

Line too long (97 > 79 characters)
Open

    MediaConfig.audio_frame_ptime = conf.get_int(SIPPHONE_SECTION, 'media.audio_frame_ptime', 20)
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.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.

Line too long (88 > 79 characters)
Open

    MediaConfig.channel_count = conf.get_int(SIPPHONE_SECTION, 'media.channel_count', 1)
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.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.

Line too long (82 > 79 characters)
Open

    MediaConfig.ec_options = conf.get_int(SIPPHONE_SECTION, 'media.ec_options', 0)
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.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.

Line too long (86 > 79 characters)
Open

    MediaConfig.enable_ice = conf.get_bool(SIPPHONE_SECTION, 'media.enable_ice', True)
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.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.

Unexpected spaces around keyword / parameter equals
Open

        bound_addr = conf.get(SIPPHONE_SECTION, 'transport.bound_addr', ''),
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.py by pep8

Don't use spaces around the '=' sign in function arguments.

Don't use spaces around the '=' sign when used to indicate a
keyword argument or a default parameter value, except when
using a type annotation.

Okay: def complex(real, imag=0.0):
Okay: return magic(r=real, i=imag)
Okay: boolean(a == b)
Okay: boolean(a != b)
Okay: boolean(a <= b)
Okay: boolean(a >= b)
Okay: def foo(arg: int = 42):
Okay: async def foo(arg: int = 42):

E251: def complex(real, imag = 0.0):
E251: return magic(r = real, i = imag)
E252: def complex(real, image: float=0.0):

Line too long (93 > 79 characters)
Open

    MediaConfig.max_media_ports = conf.get_int(SIPPHONE_SECTION, 'media.max_media_ports', 32)
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.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.

Line too long (109 > 79 characters)
Open

    AccountConfig.allow_contact_rewrite = conf.get_bool(SIPPHONE_SECTION, 'account.allow_contact_rewrite', 0)
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.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.

Expected 2 blank lines, found 1
Open

def pj_log(level, msg, length):
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.py by pep8

Separate top-level function and class definitions with two blank lines.

Method definitions inside a class are separated by a single blank
line.

Extra blank lines may be used (sparingly) to separate groups of
related functions.  Blank lines may be omitted between a bunch of
related one-liners (e.g. a set of dummy implementations).

Use blank lines in functions, sparingly, to indicate logical
sections.

Okay: def a():\n    pass\n\n\ndef b():\n    pass
Okay: def a():\n    pass\n\n\nasync def b():\n    pass
Okay: def a():\n    pass\n\n\n# Foo\n# Bar\n\ndef b():\n    pass
Okay: default = 1\nfoo = 1
Okay: classify = 1\nfoo = 1

E301: class Foo:\n    b = 0\n    def bar():\n        pass
E302: def a():\n    pass\n\ndef b(n):\n    pass
E302: def a():\n    pass\n\nasync def b(n):\n    pass
E303: def a():\n    pass\n\n\n\ndef b(n):\n    pass
E303: def a():\n\n\n\n    pass
E304: @decorator\n\ndef a():\n    pass
E305: def a():\n    pass\na()
E306: def a():\n    def b():\n        pass\n    def c():\n        pass

Line too long (84 > 79 characters)
Open

    MediaConfig.rx_drop_pct = conf.get_int(SIPPHONE_SECTION, 'media.rx_drop_pct', 0)
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.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.

Unexpected spaces around keyword / parameter equals
Open

        port = conf.get_int(SIPPHONE_SECTION, 'transport.port', 0),
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.py by pep8

Don't use spaces around the '=' sign in function arguments.

Don't use spaces around the '=' sign when used to indicate a
keyword argument or a default parameter value, except when
using a type annotation.

Okay: def complex(real, imag=0.0):
Okay: return magic(r=real, i=imag)
Okay: boolean(a == b)
Okay: boolean(a != b)
Okay: boolean(a <= b)
Okay: boolean(a >= b)
Okay: def foo(arg: int = 42):
Okay: async def foo(arg: int = 42):

E251: def complex(real, imag = 0.0):
E251: return magic(r = real, i = imag)
E252: def complex(real, image: float=0.0):

Missing whitespace after ','
Open

    if level == 2: logger.info("PJ: %s",msg)
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.py by pep8

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Line too long (100 > 79 characters)
Open

    MediaConfig.snd_auto_close_time = conf.get_int(SIPPHONE_SECTION, 'media.snd_auto_close_time', 5)
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.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.

Line too long (91 > 79 characters)
Open

    MediaConfig.turn_conn_type = conf.get_int(SIPPHONE_SECTION, 'media.turn_conn_type', 17)
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.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.

Line too long (84 > 79 characters)
Open

    MediaConfig.tx_drop_pct = conf.get_int(SIPPHONE_SECTION, 'media.tx_drop_pct', 0)
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.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.

Expected 2 blank lines, found 1
Open

def create_AccountConfig():
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.py by pep8

Separate top-level function and class definitions with two blank lines.

Method definitions inside a class are separated by a single blank
line.

Extra blank lines may be used (sparingly) to separate groups of
related functions.  Blank lines may be omitted between a bunch of
related one-liners (e.g. a set of dummy implementations).

Use blank lines in functions, sparingly, to indicate logical
sections.

Okay: def a():\n    pass\n\n\ndef b():\n    pass
Okay: def a():\n    pass\n\n\nasync def b():\n    pass
Okay: def a():\n    pass\n\n\n# Foo\n# Bar\n\ndef b():\n    pass
Okay: default = 1\nfoo = 1
Okay: classify = 1\nfoo = 1

E301: class Foo:\n    b = 0\n    def bar():\n        pass
E302: def a():\n    pass\n\ndef b(n):\n    pass
E302: def a():\n    pass\n\nasync def b(n):\n    pass
E303: def a():\n    pass\n\n\n\ndef b(n):\n    pass
E303: def a():\n\n\n\n    pass
E304: @decorator\n\ndef a():\n    pass
E305: def a():\n    pass\na()
E306: def a():\n    def b():\n        pass\n    def c():\n        pass

Unexpected spaces around keyword / parameter equals
Open

        public_addr = conf.get(SIPPHONE_SECTION, 'transport.public_addr', '')
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.py by pep8

Don't use spaces around the '=' sign in function arguments.

Don't use spaces around the '=' sign when used to indicate a
keyword argument or a default parameter value, except when
using a type annotation.

Okay: def complex(real, imag=0.0):
Okay: return magic(r=real, i=imag)
Okay: boolean(a == b)
Okay: boolean(a != b)
Okay: boolean(a <= b)
Okay: boolean(a >= b)
Okay: def foo(arg: int = 42):
Okay: async def foo(arg: int = 42):

E251: def complex(real, imag = 0.0):
E251: return magic(r = real, i = imag)
E252: def complex(real, image: float=0.0):

Line too long (85 > 79 characters)
Open

    MediaConfig.clock_rate = conf.get_int(SIPPHONE_SECTION, 'media.clock_rate', 8000)
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.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.

Multiple statements on one line (colon)
Open

    if level == 3: logger.debug("PJ: %s",msg)
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.py by pep8

Compound statements (on the same line) are generally discouraged.

While sometimes it's okay to put an if/for/while with a small body
on the same line, never do this for multi-clause statements.
Also avoid folding such long lines!

Always use a def statement instead of an assignment statement that
binds a lambda expression directly to a name.

Okay: if foo == 'blah':\n    do_blah_thing()
Okay: do_one()
Okay: do_two()
Okay: do_three()

E701: if foo == 'blah': do_blah_thing()
E701: for x in lst: total += x
E701: while t < 10: t = delay()
E701: if foo == 'blah': do_blah_thing()
E701: else: do_non_blah_thing()
E701: try: something()
E701: finally: cleanup()
E701: if foo == 'blah': one(); two(); three()
E702: do_one(); do_two(); do_three()
E703: do_four();  # useless semicolon
E704: def f(x): return 2*x
E731: f = lambda x: 2*x

Line too long (87 > 79 characters)
Open

    MediaConfig.ec_tail_len = conf.get_int(SIPPHONE_SECTION, 'media.ec_tail_len', 1024)
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.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.

Line too long (81 > 79 characters)
Open

    MediaConfig.ilbc_mode = conf.get_int(SIPPHONE_SECTION, 'media.ilbc_mode', 30)
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.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.

Whitespace before ']'
Open

    AccountConfig.auth_cred = [ pj.AuthCred(realm, username, password) ]
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.py by pep8

Avoid extraneous whitespace.

Avoid extraneous whitespace in these situations:
- Immediately inside parentheses, brackets or braces.
- Immediately before a comma, semicolon, or colon.

Okay: spam(ham[1], {eggs: 2})
E201: spam( ham[1], {eggs: 2})
E201: spam(ham[ 1], {eggs: 2})
E201: spam(ham[1], { eggs: 2})
E202: spam(ham[1], {eggs: 2} )
E202: spam(ham[1 ], {eggs: 2})
E202: spam(ham[1], {eggs: 2 })

E203: if x == 4: print x, y; x, y = y , x
E203: if x == 4: print x, y ; x, y = y, x
E203: if x == 4 : print x, y; x, y = y, x

Multiple statements on one line (colon)
Open

    if level == 2: logger.info("PJ: %s",msg)
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.py by pep8

Compound statements (on the same line) are generally discouraged.

While sometimes it's okay to put an if/for/while with a small body
on the same line, never do this for multi-clause statements.
Also avoid folding such long lines!

Always use a def statement instead of an assignment statement that
binds a lambda expression directly to a name.

Okay: if foo == 'blah':\n    do_blah_thing()
Okay: do_one()
Okay: do_two()
Okay: do_three()

E701: if foo == 'blah': do_blah_thing()
E701: for x in lst: total += x
E701: while t < 10: t = delay()
E701: if foo == 'blah': do_blah_thing()
E701: else: do_non_blah_thing()
E701: try: something()
E701: finally: cleanup()
E701: if foo == 'blah': one(); two(); three()
E702: do_one(); do_two(); do_three()
E703: do_four();  # useless semicolon
E704: def f(x): return 2*x
E731: f = lambda x: 2*x

Unexpected spaces around keyword / parameter equals
Open

        callback = pj_log,
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.py by pep8

Don't use spaces around the '=' sign in function arguments.

Don't use spaces around the '=' sign when used to indicate a
keyword argument or a default parameter value, except when
using a type annotation.

Okay: def complex(real, imag=0.0):
Okay: return magic(r=real, i=imag)
Okay: boolean(a == b)
Okay: boolean(a != b)
Okay: boolean(a <= b)
Okay: boolean(a >= b)
Okay: def foo(arg: int = 42):
Okay: async def foo(arg: int = 42):

E251: def complex(real, imag = 0.0):
E251: return magic(r = real, i = imag)
E252: def complex(real, image: float=0.0):

Multiple statements on one line (colon)
Open

    if level == 4: logger.trace("PJ: %s",msg)
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.py by pep8

Compound statements (on the same line) are generally discouraged.

While sometimes it's okay to put an if/for/while with a small body
on the same line, never do this for multi-clause statements.
Also avoid folding such long lines!

Always use a def statement instead of an assignment statement that
binds a lambda expression directly to a name.

Okay: if foo == 'blah':\n    do_blah_thing()
Okay: do_one()
Okay: do_two()
Okay: do_three()

E701: if foo == 'blah': do_blah_thing()
E701: for x in lst: total += x
E701: while t < 10: t = delay()
E701: if foo == 'blah': do_blah_thing()
E701: else: do_non_blah_thing()
E701: try: something()
E701: finally: cleanup()
E701: if foo == 'blah': one(); two(); three()
E702: do_one(); do_two(); do_three()
E703: do_four();  # useless semicolon
E704: def f(x): return 2*x
E731: f = lambda x: 2*x

Unexpected spaces around keyword / parameter equals
Open

        console_level = conf.get_int(SIPPHONE_SECTION, 'log.console_level', 1)
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.py by pep8

Don't use spaces around the '=' sign in function arguments.

Don't use spaces around the '=' sign when used to indicate a
keyword argument or a default parameter value, except when
using a type annotation.

Okay: def complex(real, imag=0.0):
Okay: return magic(r=real, i=imag)
Okay: boolean(a == b)
Okay: boolean(a != b)
Okay: boolean(a <= b)
Okay: boolean(a >= b)
Okay: def foo(arg: int = 42):
Okay: async def foo(arg: int = 42):

E251: def complex(real, imag = 0.0):
E251: return magic(r = real, i = imag)
E252: def complex(real, image: float=0.0):

Whitespace after '['
Open

    AccountConfig.auth_cred = [ pj.AuthCred(realm, username, password) ]
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.py by pep8

Avoid extraneous whitespace.

Avoid extraneous whitespace in these situations:
- Immediately inside parentheses, brackets or braces.
- Immediately before a comma, semicolon, or colon.

Okay: spam(ham[1], {eggs: 2})
E201: spam( ham[1], {eggs: 2})
E201: spam(ham[ 1], {eggs: 2})
E201: spam(ham[1], { eggs: 2})
E202: spam(ham[1], {eggs: 2} )
E202: spam(ham[1 ], {eggs: 2})
E202: spam(ham[1], {eggs: 2 })

E203: if x == 4: print x, y; x, y = y , x
E203: if x == 4: print x, y ; x, y = y, x
E203: if x == 4 : print x, y; x, y = y, x

Expected 2 blank lines, found 1
Open

def sipphone_server():
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.py by pep8

Separate top-level function and class definitions with two blank lines.

Method definitions inside a class are separated by a single blank
line.

Extra blank lines may be used (sparingly) to separate groups of
related functions.  Blank lines may be omitted between a bunch of
related one-liners (e.g. a set of dummy implementations).

Use blank lines in functions, sparingly, to indicate logical
sections.

Okay: def a():\n    pass\n\n\ndef b():\n    pass
Okay: def a():\n    pass\n\n\nasync def b():\n    pass
Okay: def a():\n    pass\n\n\n# Foo\n# Bar\n\ndef b():\n    pass
Okay: default = 1\nfoo = 1
Okay: classify = 1\nfoo = 1

E301: class Foo:\n    b = 0\n    def bar():\n        pass
E302: def a():\n    pass\n\ndef b(n):\n    pass
E302: def a():\n    pass\n\nasync def b(n):\n    pass
E303: def a():\n    pass\n\n\n\ndef b(n):\n    pass
E303: def a():\n\n\n\n    pass
E304: @decorator\n\ndef a():\n    pass
E305: def a():\n    pass\na()
E306: def a():\n    def b():\n        pass\n    def c():\n        pass

Module level import not at top of file
Open

import pjsua as pj
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.py by pep8

Place imports at the top of the file.

Always put imports at the top of the file, just after any module
comments and docstrings, and before module globals and constants.

Okay: import os
Okay: # this is a comment\nimport os
Okay: '''this is a module docstring'''\nimport os
Okay: r'''this is a module docstring'''\nimport os
Okay:
try:\n\timport x\nexcept ImportError:\n\tpass\nelse:\n\tpass\nimport y
Okay:
try:\n\timport x\nexcept ImportError:\n\tpass\nfinally:\n\tpass\nimport y
E402: a=1\nimport os
E402: 'One string'\n"Two string"\nimport os
E402: a=1\nfrom sys import x

Okay: if x:\n    import os

Expected 2 blank lines, found 1
Open

def call_timeout():
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.py by pep8

Separate top-level function and class definitions with two blank lines.

Method definitions inside a class are separated by a single blank
line.

Extra blank lines may be used (sparingly) to separate groups of
related functions.  Blank lines may be omitted between a bunch of
related one-liners (e.g. a set of dummy implementations).

Use blank lines in functions, sparingly, to indicate logical
sections.

Okay: def a():\n    pass\n\n\ndef b():\n    pass
Okay: def a():\n    pass\n\n\nasync def b():\n    pass
Okay: def a():\n    pass\n\n\n# Foo\n# Bar\n\ndef b():\n    pass
Okay: default = 1\nfoo = 1
Okay: classify = 1\nfoo = 1

E301: class Foo:\n    b = 0\n    def bar():\n        pass
E302: def a():\n    pass\n\ndef b(n):\n    pass
E302: def a():\n    pass\n\nasync def b(n):\n    pass
E303: def a():\n    pass\n\n\n\ndef b(n):\n    pass
E303: def a():\n\n\n\n    pass
E304: @decorator\n\ndef a():\n    pass
E305: def a():\n    pass\na()
E306: def a():\n    def b():\n        pass\n    def c():\n        pass

Line too long (89 > 79 characters)
Open

    AccountConfig.reg_timeout = conf.get_int(SIPPHONE_SECTION, 'account.reg_timeout', 10)
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.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.

Line too long (90 > 79 characters)
Open

    MediaConfig.snd_clock_rate = conf.get_int(SIPPHONE_SECTION, 'media.snd_clock_rate', 0)
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.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.

Block comment should start with '# '
Open

    #TODO: string to http://www.pjsip.org/python/pjsua.htm#AuthCred
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.py by pep8

Separate inline comments by at least two spaces.

An inline comment is a comment on the same line as a statement.
Inline comments should be separated by at least two spaces from the
statement. They should start with a # and a single space.

Each line of a block comment starts with a # and a single space
(unless it is indented text inside the comment).

Okay: x = x + 1  # Increment x
Okay: x = x + 1    # Increment x
Okay: # Block comment
E261: x = x + 1 # Increment x
E262: x = x + 1  #Increment x
E262: x = x + 1  #  Increment x
E265: #Block comment
E266: ### Block comment

Unexpected spaces around keyword / parameter equals
Open

        callback = pj_log,
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.py by pep8

Don't use spaces around the '=' sign in function arguments.

Don't use spaces around the '=' sign when used to indicate a
keyword argument or a default parameter value, except when
using a type annotation.

Okay: def complex(real, imag=0.0):
Okay: return magic(r=real, i=imag)
Okay: boolean(a == b)
Okay: boolean(a != b)
Okay: boolean(a <= b)
Okay: boolean(a >= b)
Okay: def foo(arg: int = 42):
Okay: async def foo(arg: int = 42):

E251: def complex(real, imag = 0.0):
E251: return magic(r = real, i = imag)
E252: def complex(real, image: float=0.0):

Unexpected spaces around keyword / parameter equals
Open

        level = conf.get_int(SIPPHONE_SECTION, 'log.level', 1),
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.py by pep8

Don't use spaces around the '=' sign in function arguments.

Don't use spaces around the '=' sign when used to indicate a
keyword argument or a default parameter value, except when
using a type annotation.

Okay: def complex(real, imag=0.0):
Okay: return magic(r=real, i=imag)
Okay: boolean(a == b)
Okay: boolean(a != b)
Okay: boolean(a <= b)
Okay: boolean(a >= b)
Okay: def foo(arg: int = 42):
Okay: async def foo(arg: int = 42):

E251: def complex(real, imag = 0.0):
E251: return magic(r = real, i = imag)
E252: def complex(real, image: float=0.0):

Unexpected spaces around keyword / parameter equals
Open

        console_level = conf.get_int(SIPPHONE_SECTION, 'log.console_level', 1)
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.py by pep8

Don't use spaces around the '=' sign in function arguments.

Don't use spaces around the '=' sign when used to indicate a
keyword argument or a default parameter value, except when
using a type annotation.

Okay: def complex(real, imag=0.0):
Okay: return magic(r=real, i=imag)
Okay: boolean(a == b)
Okay: boolean(a != b)
Okay: boolean(a <= b)
Okay: boolean(a >= b)
Okay: def foo(arg: int = 42):
Okay: async def foo(arg: int = 42):

E251: def complex(real, imag = 0.0):
E251: return magic(r = real, i = imag)
E252: def complex(real, image: float=0.0):

Unexpected spaces around keyword / parameter equals
Open

        port = conf.get_int(SIPPHONE_SECTION, 'transport.port', 0),
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.py by pep8

Don't use spaces around the '=' sign in function arguments.

Don't use spaces around the '=' sign when used to indicate a
keyword argument or a default parameter value, except when
using a type annotation.

Okay: def complex(real, imag=0.0):
Okay: return magic(r=real, i=imag)
Okay: boolean(a == b)
Okay: boolean(a != b)
Okay: boolean(a <= b)
Okay: boolean(a >= b)
Okay: def foo(arg: int = 42):
Okay: async def foo(arg: int = 42):

E251: def complex(real, imag = 0.0):
E251: return magic(r = real, i = imag)
E252: def complex(real, image: float=0.0):

Unexpected spaces around keyword / parameter equals
Open

        public_addr = conf.get(SIPPHONE_SECTION, 'transport.public_addr', '')
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.py by pep8

Don't use spaces around the '=' sign in function arguments.

Don't use spaces around the '=' sign when used to indicate a
keyword argument or a default parameter value, except when
using a type annotation.

Okay: def complex(real, imag=0.0):
Okay: return magic(r=real, i=imag)
Okay: boolean(a == b)
Okay: boolean(a != b)
Okay: boolean(a <= b)
Okay: boolean(a >= b)
Okay: def foo(arg: int = 42):
Okay: async def foo(arg: int = 42):

E251: def complex(real, imag = 0.0):
E251: return magic(r = real, i = imag)
E252: def complex(real, image: float=0.0):

Missing whitespace after ','
Open

    if level == 3: logger.debug("PJ: %s",msg)
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.py by pep8

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Expected 2 blank lines, found 1
Open

def create_LogConfig():
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.py by pep8

Separate top-level function and class definitions with two blank lines.

Method definitions inside a class are separated by a single blank
line.

Extra blank lines may be used (sparingly) to separate groups of
related functions.  Blank lines may be omitted between a bunch of
related one-liners (e.g. a set of dummy implementations).

Use blank lines in functions, sparingly, to indicate logical
sections.

Okay: def a():\n    pass\n\n\ndef b():\n    pass
Okay: def a():\n    pass\n\n\nasync def b():\n    pass
Okay: def a():\n    pass\n\n\n# Foo\n# Bar\n\ndef b():\n    pass
Okay: default = 1\nfoo = 1
Okay: classify = 1\nfoo = 1

E301: class Foo:\n    b = 0\n    def bar():\n        pass
E302: def a():\n    pass\n\ndef b(n):\n    pass
E302: def a():\n    pass\n\nasync def b(n):\n    pass
E303: def a():\n    pass\n\n\n\ndef b(n):\n    pass
E303: def a():\n\n\n\n    pass
E304: @decorator\n\ndef a():\n    pass
E305: def a():\n    pass\na()
E306: def a():\n    def b():\n        pass\n    def c():\n        pass

Module level import not at top of file
Open

import doorpi
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.py by pep8

Place imports at the top of the file.

Always put imports at the top of the file, just after any module
comments and docstrings, and before module globals and constants.

Okay: import os
Okay: # this is a comment\nimport os
Okay: '''this is a module docstring'''\nimport os
Okay: r'''this is a module docstring'''\nimport os
Okay:
try:\n\timport x\nexcept ImportError:\n\tpass\nelse:\n\tpass\nimport y
Okay:
try:\n\timport x\nexcept ImportError:\n\tpass\nfinally:\n\tpass\nimport y
E402: a=1\nimport os
E402: 'One string'\n"Two string"\nimport os
E402: a=1\nfrom sys import x

Okay: if x:\n    import os

Multiple statements on one line (colon)
Open

    if level == 1: logger.warning("PJ: %s",msg)
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.py by pep8

Compound statements (on the same line) are generally discouraged.

While sometimes it's okay to put an if/for/while with a small body
on the same line, never do this for multi-clause statements.
Also avoid folding such long lines!

Always use a def statement instead of an assignment statement that
binds a lambda expression directly to a name.

Okay: if foo == 'blah':\n    do_blah_thing()
Okay: do_one()
Okay: do_two()
Okay: do_three()

E701: if foo == 'blah': do_blah_thing()
E701: for x in lst: total += x
E701: while t < 10: t = delay()
E701: if foo == 'blah': do_blah_thing()
E701: else: do_non_blah_thing()
E701: try: something()
E701: finally: cleanup()
E701: if foo == 'blah': one(); two(); three()
E702: do_one(); do_two(); do_three()
E703: do_four();  # useless semicolon
E704: def f(x): return 2*x
E731: f = lambda x: 2*x

Missing whitespace after ','
Open

    if level == 1: logger.warning("PJ: %s",msg)
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.py by pep8

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Missing whitespace after ','
Open

    if level == 0: logger.error("PJ: %s",msg)
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.py by pep8

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Line too long (89 > 79 characters)
Open

    MediaConfig.enable_turn = conf.get_bool(SIPPHONE_SECTION, 'media.enable_turn', False)
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.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.

Line too long (81 > 79 characters)
Open

    MediaConfig.turn_server = conf.get(SIPPHONE_SECTION, 'media.turn_server', '')
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.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.

Expected 2 blank lines, found 1
Open

def create_TransportConfig():
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.py by pep8

Separate top-level function and class definitions with two blank lines.

Method definitions inside a class are separated by a single blank
line.

Extra blank lines may be used (sparingly) to separate groups of
related functions.  Blank lines may be omitted between a bunch of
related one-liners (e.g. a set of dummy implementations).

Use blank lines in functions, sparingly, to indicate logical
sections.

Okay: def a():\n    pass\n\n\ndef b():\n    pass
Okay: def a():\n    pass\n\n\nasync def b():\n    pass
Okay: def a():\n    pass\n\n\n# Foo\n# Bar\n\ndef b():\n    pass
Okay: default = 1\nfoo = 1
Okay: classify = 1\nfoo = 1

E301: class Foo:\n    b = 0\n    def bar():\n        pass
E302: def a():\n    pass\n\ndef b(n):\n    pass
E302: def a():\n    pass\n\nasync def b(n):\n    pass
E303: def a():\n    pass\n\n\n\ndef b(n):\n    pass
E303: def a():\n\n\n\n    pass
E304: @decorator\n\ndef a():\n    pass
E305: def a():\n    pass\na()
E306: def a():\n    def b():\n        pass\n    def c():\n        pass

Missing whitespace after ','
Open

    if level == 4: logger.trace("PJ: %s",msg)
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.py by pep8

Each comma, semicolon or colon should be followed by whitespace.

Okay: [a, b]
Okay: (3,)
Okay: a[1:4]
Okay: a[:4]
Okay: a[1:]
Okay: a[1:4:2]
E231: ['a','b']
E231: foo(bar,baz)
E231: [{'a':'b'}]

Multiple statements on one line (colon)
Open

    if level == 0: logger.error("PJ: %s",msg)
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.py by pep8

Compound statements (on the same line) are generally discouraged.

While sometimes it's okay to put an if/for/while with a small body
on the same line, never do this for multi-clause statements.
Also avoid folding such long lines!

Always use a def statement instead of an assignment statement that
binds a lambda expression directly to a name.

Okay: if foo == 'blah':\n    do_blah_thing()
Okay: do_one()
Okay: do_two()
Okay: do_three()

E701: if foo == 'blah': do_blah_thing()
E701: for x in lst: total += x
E701: while t < 10: t = delay()
E701: if foo == 'blah': do_blah_thing()
E701: else: do_non_blah_thing()
E701: try: something()
E701: finally: cleanup()
E701: if foo == 'blah': one(); two(); three()
E702: do_one(); do_two(); do_three()
E703: do_four();  # useless semicolon
E704: def f(x): return 2*x
E731: f = lambda x: 2*x

Unexpected spaces around keyword / parameter equals
Open

        level = conf.get_int(SIPPHONE_SECTION, 'log.level', 1),
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.py by pep8

Don't use spaces around the '=' sign in function arguments.

Don't use spaces around the '=' sign when used to indicate a
keyword argument or a default parameter value, except when
using a type annotation.

Okay: def complex(real, imag=0.0):
Okay: return magic(r=real, i=imag)
Okay: boolean(a == b)
Okay: boolean(a != b)
Okay: boolean(a <= b)
Okay: boolean(a >= b)
Okay: def foo(arg: int = 42):
Okay: async def foo(arg: int = 42):

E251: def complex(real, imag = 0.0):
E251: return magic(r = real, i = imag)
E252: def complex(real, image: float=0.0):

Unexpected spaces around keyword / parameter equals
Open

        bound_addr = conf.get(SIPPHONE_SECTION, 'transport.bound_addr', ''),
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.py by pep8

Don't use spaces around the '=' sign in function arguments.

Don't use spaces around the '=' sign when used to indicate a
keyword argument or a default parameter value, except when
using a type annotation.

Okay: def complex(real, imag=0.0):
Okay: return magic(r=real, i=imag)
Okay: boolean(a == b)
Okay: boolean(a != b)
Okay: boolean(a <= b)
Okay: boolean(a >= b)
Okay: def foo(arg: int = 42):
Okay: async def foo(arg: int = 42):

E251: def complex(real, imag = 0.0):
E251: return magic(r = real, i = imag)
E252: def complex(real, image: float=0.0):

Expected 2 blank lines, found 1
Open

def max_call_time():
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.py by pep8

Separate top-level function and class definitions with two blank lines.

Method definitions inside a class are separated by a single blank
line.

Extra blank lines may be used (sparingly) to separate groups of
related functions.  Blank lines may be omitted between a bunch of
related one-liners (e.g. a set of dummy implementations).

Use blank lines in functions, sparingly, to indicate logical
sections.

Okay: def a():\n    pass\n\n\ndef b():\n    pass
Okay: def a():\n    pass\n\n\nasync def b():\n    pass
Okay: def a():\n    pass\n\n\n# Foo\n# Bar\n\ndef b():\n    pass
Okay: default = 1\nfoo = 1
Okay: classify = 1\nfoo = 1

E301: class Foo:\n    b = 0\n    def bar():\n        pass
E302: def a():\n    pass\n\ndef b(n):\n    pass
E302: def a():\n    pass\n\nasync def b(n):\n    pass
E303: def a():\n    pass\n\n\n\ndef b(n):\n    pass
E303: def a():\n\n\n\n    pass
E304: @decorator\n\ndef a():\n    pass
E305: def a():\n    pass\na()
E306: def a():\n    def b():\n        pass\n    def c():\n        pass

Expected 2 blank lines, found 1
Open

def create_MediaConfig():
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/Config.py by pep8

Separate top-level function and class definitions with two blank lines.

Method definitions inside a class are separated by a single blank
line.

Extra blank lines may be used (sparingly) to separate groups of
related functions.  Blank lines may be omitted between a bunch of
related one-liners (e.g. a set of dummy implementations).

Use blank lines in functions, sparingly, to indicate logical
sections.

Okay: def a():\n    pass\n\n\ndef b():\n    pass
Okay: def a():\n    pass\n\n\nasync def b():\n    pass
Okay: def a():\n    pass\n\n\n# Foo\n# Bar\n\ndef b():\n    pass
Okay: default = 1\nfoo = 1
Okay: classify = 1\nfoo = 1

E301: class Foo:\n    b = 0\n    def bar():\n        pass
E302: def a():\n    pass\n\ndef b(n):\n    pass
E302: def a():\n    pass\n\nasync def b(n):\n    pass
E303: def a():\n    pass\n\n\n\ndef b(n):\n    pass
E303: def a():\n\n\n\n    pass
E304: @decorator\n\ndef a():\n    pass
E305: def a():\n    pass\na()
E306: def a():\n    def b():\n        pass\n    def c():\n        pass

Rename function "create_UAConfig" to match the regular expression ^[a-z_][a-z0-9_]{2,}$.
Open

def create_UAConfig():

Shared coding conventions allow teams to collaborate efficiently. This rule checks that all function names match a provided regular expression.

Noncompliant Code Example

With the default provided regular expression: ^[a-z_][a-z0-9_]{2,30}$

def MyFunction(a,b):
    ...

Compliant Solution

def my_function(a,b):
    ...

Rename function "create_AccountConfig" to match the regular expression ^[a-z_][a-z0-9_]{2,}$.
Open

def create_AccountConfig():

Shared coding conventions allow teams to collaborate efficiently. This rule checks that all function names match a provided regular expression.

Noncompliant Code Example

With the default provided regular expression: ^[a-z_][a-z0-9_]{2,30}$

def MyFunction(a,b):
    ...

Compliant Solution

def my_function(a,b):
    ...

Rename function "create_LogConfig" to match the regular expression ^[a-z_][a-z0-9_]{2,}$.
Open

def create_LogConfig():

Shared coding conventions allow teams to collaborate efficiently. This rule checks that all function names match a provided regular expression.

Noncompliant Code Example

With the default provided regular expression: ^[a-z_][a-z0-9_]{2,30}$

def MyFunction(a,b):
    ...

Compliant Solution

def my_function(a,b):
    ...

Rename function "create_MediaConfig" to match the regular expression ^[a-z_][a-z0-9_]{2,}$.
Open

def create_MediaConfig():

Shared coding conventions allow teams to collaborate efficiently. This rule checks that all function names match a provided regular expression.

Noncompliant Code Example

With the default provided regular expression: ^[a-z_][a-z0-9_]{2,30}$

def MyFunction(a,b):
    ...

Compliant Solution

def my_function(a,b):
    ...

Rename function "create_TransportConfig" to match the regular expression ^[a-z_][a-z0-9_]{2,}$.
Open

def create_TransportConfig():

Shared coding conventions allow teams to collaborate efficiently. This rule checks that all function names match a provided regular expression.

Noncompliant Code Example

With the default provided regular expression: ^[a-z_][a-z0-9_]{2,30}$

def MyFunction(a,b):
    ...

Compliant Solution

def my_function(a,b):
    ...

There are no issues that match your filters.

Category
Status