apel/parsers/parser.py

Summary

Maintainability
A
0 mins
Test Coverage

Try, Except, Pass detected.
Open

        except Exception:  # An exception means we can't parse the file!
Severity: Info
Found in apel/parsers/parser.py by bandit

Catching too general exception Exception
Open

        except Exception:  # An exception means we can't parse the file!
Severity: Minor
Found in apel/parsers/parser.py by pylint

Used when an except catches a too general exception, possibly burying unrelated errors.

Unable to import 'future.builtins'
Open

from future.builtins import object
Severity: Critical
Found in apel/parsers/parser.py by pylint

Used when pylint has been unable to import a module.

Expected 2 blank lines, found 1
Open

class Parser(object):
Severity: Minor
Found in apel/parsers/parser.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

        Method to recognize if the given line of file can be parsed with this parser
Severity: Minor
Found in apel/parsers/parser.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

        log.info('Site: %s; batch system: %s', self.site_name, self.machine_name)
Severity: Minor
Found in apel/parsers/parser.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

class ParserException(Exception):
Severity: Minor
Found in apel/parsers/parser.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 (82 > 79 characters)
Open

            log.info('Parser will retrieve per-processor accounting information.')
Severity: Minor
Found in apel/parsers/parser.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 class docstring
Open

class ParserException(Exception):
Severity: Info
Found in apel/parsers/parser.py by pylint

Used when a class has no docstring.Even an empty class must have a docstring.

standard import import logging should be placed before from future.builtins import object
Open

import logging
Severity: Info
Found in apel/parsers/parser.py by pylint

Used when PEP8 import order is not respected (standard imports first, then third-party libraries, then local imports)

Constant name log doesn't conform to UPPER_CASE naming style
Open

log = logging.getLogger(__name__)
Severity: Info
Found in apel/parsers/parser.py by pylint

Used when the name doesn't conform to naming rules associated to its type (constant, variable, class...).

There are no issues that match your filters.

Category
Status