apel/db/records/record.py

Summary

Maintainability
F
4 days
Test Coverage

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Open

        assert len(tup) == len(self._db_fields), 'Different length of tuple and fields list'
Severity: Info
Found in apel/db/records/record.py by bandit

Function _check_fields has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
Open

    def _check_fields(self):

        # shorthand
        contents = self._record_content

Severity: Minor
Found in apel/db/records/record.py - About 6 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Cyclomatic complexity is too high in method _check_fields. (27)
Open

    def _check_fields(self):

        # shorthand
        contents = self._record_content

Severity: Minor
Found in apel/db/records/record.py by radon

Cyclomatic Complexity

Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

Construct Effect on CC Reasoning
if +1 An if statement is a single decision.
elif +1 The elif statement adds another decision.
else +0 The else statement does not cause a new decision. The decision is at the if.
for +1 There is a decision at the start of the loop.
while +1 There is a decision at the while statement.
except +1 Each except branch adds a new conditional path of execution.
finally +0 The finally block is unconditionally executed.
with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
assert +1 The assert statement internally roughly equals a conditional statement.
Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

Source: http://radon.readthedocs.org/en/latest/intro.html

Cyclomatic complexity is too high in method checked. (15)
Open

    def checked(self, name, value):
        '''
        Returns value converted to correct type if this is possible.
        Otherwise it raises an error.
        '''
Severity: Minor
Found in apel/db/records/record.py by radon

Cyclomatic Complexity

Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

Construct Effect on CC Reasoning
if +1 An if statement is a single decision.
elif +1 The elif statement adds another decision.
else +0 The else statement does not cause a new decision. The decision is at the if.
for +1 There is a decision at the start of the loop.
while +1 There is a decision at the while statement.
except +1 Each except branch adds a new conditional path of execution.
finally +0 The finally block is unconditionally executed.
with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
assert +1 The assert statement internally roughly equals a conditional statement.
Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

Source: http://radon.readthedocs.org/en/latest/intro.html

Function checked has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    def checked(self, name, value):
        '''
        Returns value converted to correct type if this is possible.
        Otherwise it raises an error.
        '''
Severity: Minor
Found in apel/db/records/record.py - About 3 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Cyclomatic complexity is too high in method get_msg. (10)
Open

    def get_msg(self, withhold_dns=False):
        '''
        Get the information about the record as a string in the format used
        for APEL's messages.  self._record_content holds the appropriate
        keys and values.
Severity: Minor
Found in apel/db/records/record.py by radon

Cyclomatic Complexity

Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

Construct Effect on CC Reasoning
if +1 An if statement is a single decision.
elif +1 The elif statement adds another decision.
else +0 The else statement does not cause a new decision. The decision is at the if.
for +1 There is a decision at the start of the loop.
while +1 There is a decision at the while statement.
except +1 Each except branch adds a new conditional path of execution.
finally +0 The finally block is unconditionally executed.
with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
assert +1 The assert statement internally roughly equals a conditional statement.
Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

Source: http://radon.readthedocs.org/en/latest/intro.html

File record.py has 265 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'''
   Copyright (C) 2011, 2012 STFC

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
Severity: Minor
Found in apel/db/records/record.py - About 2 hrs to fix

    Cyclomatic complexity is too high in class Record. (7)
    Open

    class Record(object):
        '''
        Represents one APEL database row or record.
    
        The class is designed so that each record type should inherit from this
    Severity: Minor
    Found in apel/db/records/record.py by radon

    Cyclomatic Complexity

    Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

    Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

    Construct Effect on CC Reasoning
    if +1 An if statement is a single decision.
    elif +1 The elif statement adds another decision.
    else +0 The else statement does not cause a new decision. The decision is at the if.
    for +1 There is a decision at the start of the loop.
    while +1 There is a decision at the while statement.
    except +1 Each except branch adds a new conditional path of execution.
    finally +0 The finally block is unconditionally executed.
    with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
    assert +1 The assert statement internally roughly equals a conditional statement.
    Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
    Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    Cyclomatic complexity is too high in method load_from_msg. (6)
    Open

        def load_from_msg(self, text):
            '''
            Given text extracted from a message, load fields.
            This uses the lists defined as part of any subclass to know
            how to deal with any part of a message.
    Severity: Minor
    Found in apel/db/records/record.py by radon

    Cyclomatic Complexity

    Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

    Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

    Construct Effect on CC Reasoning
    if +1 An if statement is a single decision.
    elif +1 The elif statement adds another decision.
    else +0 The else statement does not cause a new decision. The decision is at the if.
    for +1 There is a decision at the start of the loop.
    while +1 There is a decision at the while statement.
    except +1 Each except branch adds a new conditional path of execution.
    finally +0 The finally block is unconditionally executed.
    with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
    assert +1 The assert statement internally roughly equals a conditional statement.
    Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
    Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    Function get_msg has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        def get_msg(self, withhold_dns=False):
            '''
            Get the information about the record as a string in the format used
            for APEL's messages.  self._record_content holds the appropriate
            keys and values.
    Severity: Minor
    Found in apel/db/records/record.py - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function get_db_tuple has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def get_db_tuple(self, source=None):
            '''
            Returns record content as a tuple. Appends the source of the record
            (i.e. the sender's DN) if this is supplied.  Includes exactly the
            fields used in the DB by using the self._db_fields list.
    Severity: Minor
    Found in apel/db/records/record.py - About 45 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Avoid too many return statements within this function.
    Open

                        return datetime.utcfromtimestamp(value)
    Severity: Major
    Found in apel/db/records/record.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                      return value
      Severity: Major
      Found in apel/db/records/record.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                                return dt
        Severity: Major
        Found in apel/db/records/record.py - About 30 mins to fix

          Unnecessary elif after raise
          Open

                          if key in self._mandatory_fields:
          Severity: Info
          Found in apel/db/records/record.py by pylint

          Used in order to highlight an unnecessary block of code following an if containing a raise statement. As such, it will warn when it encounters an else following a chain of ifs, all of them containing a raise statement.

          Unnecessary elif after raise
          Open

                          if key in self._mandatory_fields:
          Severity: Info
          Found in apel/db/records/record.py by pylint

          Used in order to highlight an unnecessary block of code following an if containing a raise statement. As such, it will warn when it encounters an else following a chain of ifs, all of them containing a raise statement.

          Too many return statements (7/6)
          Open

              def checked(self, name, value):
          Severity: Info
          Found in apel/db/records/record.py by pylint

          Used when a function or method has too many return statement, making it hard to follow.

          Class 'Record' inherits from object, can be safely removed from bases in python3
          Open

          class Record(object):
          Severity: Info
          Found in apel/db/records/record.py by pylint

          Used when a class inherit from object, which under python3 is implicit, hence can be safely removed from bases.

          Too many branches (14/12)
          Open

              def checked(self, name, value):
          Severity: Info
          Found in apel/db/records/record.py by pylint

          Used when a function or method has too many branches, making it hard to follow.

          Too many instance attributes (9/7)
          Open

          class Record(object):
          Severity: Info
          Found in apel/db/records/record.py by pylint

          Used when class has too many instance attributes, try to reduce this to get a simpler (and so easier to use) class.

          Unnecessary else after raise
          Open

                      if name in self._mandatory_fields:
          Severity: Info
          Found in apel/db/records/record.py by pylint

          Used in order to highlight an unnecessary block of code following an if containing a raise statement. As such, it will warn when it encounters an else following a chain of ifs, all of them containing a raise statement.

          Unnecessary elif after raise
          Open

                          if key in self._mandatory_fields:
          Severity: Info
          Found in apel/db/records/record.py by pylint

          Used in order to highlight an unnecessary block of code following an if containing a raise statement. As such, it will warn when it encounters an else following a chain of ifs, all of them containing a raise statement.

          Unnecessary elif after raise
          Open

                      if value is None and name in self._mandatory_fields:
          Severity: Info
          Found in apel/db/records/record.py by pylint

          Used in order to highlight an unnecessary block of code following an if containing a raise statement. As such, it will warn when it encounters an else following a chain of ifs, all of them containing a raise statement.

          Unnecessary else after raise
          Open

                          if key in self._mandatory_fields:
          Severity: Info
          Found in apel/db/records/record.py by pylint

          Used in order to highlight an unnecessary block of code following an if containing a raise statement. As such, it will warn when it encounters an else following a chain of ifs, all of them containing a raise statement.

          Too many branches (26/12)
          Open

              def _check_fields(self):
          Severity: Info
          Found in apel/db/records/record.py by pylint

          Used when a function or method has too many branches, making it hard to follow.

          Too many statements (51/50)
          Open

              def _check_fields(self):
          Severity: Info
          Found in apel/db/records/record.py by pylint

          Used when a function or method has too many statements. You should then split it in smaller functions / methods.

          Refactor this function to reduce its Cognitive Complexity from 22 to the 15 allowed.
          Open

              def checked(self, name, value):
          Severity: Critical
          Found in apel/db/records/record.py by sonar-python

          Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

          See

          Refactor this function to reduce its Cognitive Complexity from 43 to the 15 allowed.
          Open

              def _check_fields(self):
          Severity: Critical
          Found in apel/db/records/record.py by sonar-python

          Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

          See

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                  for key in self._float_fields:
                      try:
                          value = contents[key]
                      except KeyError:
                          value = None
          Severity: Major
          Found in apel/db/records/record.py and 1 other location - About 1 day to fix
          apel/db/records/record.py on lines 324..340

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 131.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                  for key in self._int_fields:
                      try:
                          value = contents[key]
                      except KeyError:
                          value = None
          Severity: Major
          Found in apel/db/records/record.py and 1 other location - About 1 day to fix
          apel/db/records/record.py on lines 344..360

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 131.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Line too long (87 > 79 characters)
          Open

                          raise InvalidRecordException('NULL in mandatory field: %s' % str(name))
          Severity: Minor
          Found in apel/db/records/record.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

                              raise InvalidRecordException("Mandatory datetime field " + key +
          Severity: Minor
          Found in apel/db/records/record.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.

          Too many blank lines (2)
          Open

              def checked(self, name, value):
          Severity: Minor
          Found in apel/db/records/record.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

          Too many blank lines (2)
          Open

                  # Change the null values for integers to None (not 'None'!) -> NULL in the DB.
          Severity: Minor
          Found in apel/db/records/record.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 (101 > 79 characters)
          Open

                              # A trailing Z in the ISO format denotes UTC.  We make this explicit for parsing.
          Severity: Minor
          Found in apel/db/records/record.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

                              raise InvalidRecordException('No mandatory key: %s found' % key)
          Severity: Minor
          Found in apel/db/records/record.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

                          raise InvalidRecordException("Unexpected field " + key + " in message.")
          Severity: Minor
          Found in apel/db/records/record.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.

          Too many blank lines (2)
          Open

              def get_field(self, name):
          Severity: Minor
          Found in apel/db/records/record.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

                          raise InvalidRecordException('Missing mandatory field: %s' % name)
          Severity: Minor
          Found in apel/db/records/record.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.

          At least two spaces before inline comment
          Open

                      if key not in current_keys: # key not already in the dictionary
          Severity: Minor
          Found in apel/db/records/record.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

          Line too long (100 > 79 characters)
          Open

                              raise InvalidRecordException('Invalid int value %s in field %s' % (value, name))
          Severity: Minor
          Found in apel/db/records/record.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 (102 > 79 characters)
          Open

                              raise InvalidRecordException('Invalid float value %s in field %s' % (value, name))
          Severity: Minor
          Found in apel/db/records/record.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.

          At least two spaces before inline comment
          Open

                              isofmt = '%Y-%m-%dT%H:%M:%S%Z' # %Z denotes timezone
          Severity: Minor
          Found in apel/db/records/record.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

          Line too long (92 > 79 characters)
          Open

                  assert len(tup) == len(self._db_fields), 'Different length of tuple and fields list'
          Severity: Minor
          Found in apel/db/records/record.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.

          Too many blank lines (2)
          Open

              def get_db_tuple(self, source=None):
          Severity: Minor
          Found in apel/db/records/record.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 (91 > 79 characters)
          Open

                              raise InvalidRecordException('Mandatory field: %s was not found' % key)
          Severity: Minor
          Found in apel/db/records/record.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.

          Continuation line under-indented for visual indent
          Open

                                              " doesn't contain an integer.")
          Severity: Minor
          Found in apel/db/records/record.py by pep8

          Continuation lines indentation.

          Continuation lines should align wrapped elements either vertically
          using Python's implicit line joining inside parentheses, brackets
          and braces, or using a hanging indent.
          
          When using a hanging indent these considerations should be applied:
          - there should be no arguments on the first line, and
          - further indentation should be used to clearly distinguish itself
            as a continuation line.
          
          Okay: a = (\n)
          E123: a = (\n    )
          
          Okay: a = (\n    42)
          E121: a = (\n   42)
          E122: a = (\n42)
          E123: a = (\n    42\n    )
          E124: a = (24,\n     42\n)
          E125: if (\n    b):\n    pass
          E126: a = (\n        42)
          E127: a = (24,\n      42)
          E128: a = (24,\n    42)
          E129: if (a or\n    b):\n    pass
          E131: a = (\n    42\n 24)

          Line too long (83 > 79 characters)
          Open

                              raise InvalidRecordException("Mandatory decimal field " + key +
          Severity: Minor
          Found in apel/db/records/record.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.

          Continuation line under-indented for visual indent
          Open

                                              " doesn't contain a float.")
          Severity: Minor
          Found in apel/db/records/record.py by pep8

          Continuation lines indentation.

          Continuation lines should align wrapped elements either vertically
          using Python's implicit line joining inside parentheses, brackets
          and braces, or using a hanging indent.
          
          When using a hanging indent these considerations should be applied:
          - there should be no arguments on the first line, and
          - further indentation should be used to clearly distinguish itself
            as a continuation line.
          
          Okay: a = (\n)
          E123: a = (\n    )
          
          Okay: a = (\n    42)
          E121: a = (\n   42)
          E122: a = (\n42)
          E123: a = (\n    42\n    )
          E124: a = (24,\n     42\n)
          E125: if (\n    b):\n    pass
          E126: a = (\n        42)
          E127: a = (24,\n      42)
          E128: a = (24,\n    42)
          E129: if (a or\n    b):\n    pass
          E131: a = (\n    42\n 24)

          Line too long (92 > 79 characters)
          Open

                                  raise InvalidRecordException('Unknown datetime format!: %s' % value)
          Severity: Minor
          Found in apel/db/records/record.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.

          At least two spaces before inline comment
          Open

                              except ValueError: # Failed to parse timestamp
          Severity: Minor
          Found in apel/db/records/record.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

          Line too long (87 > 79 characters)
          Open

                              value = str(self._record_content[key]) # make sure we have a string
          Severity: Minor
          Found in apel/db/records/record.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.

          Ambiguous variable name 'l'
          Open

                  l = []
          Severity: Minor
          Found in apel/db/records/record.py by pep8

          Never use the characters 'l', 'O', or 'I' as variable names.

          In some fonts, these characters are indistinguishable from the
          numerals one and zero. When tempted to use 'l', use 'L' instead.
          
          Okay: L = 0
          Okay: o = 123
          Okay: i = 42
          E741: l = 0
          E741: O = 123
          E741: I = 42
          
          Variables can be bound in several other contexts, including class
          and function definitions, 'global' and 'nonlocal' statements,
          exception handlers, and 'with' and 'for' statements.
          In addition, we have a special handling for function parameters.
          
          Okay: except AttributeError as o:
          Okay: with lock as L:
          Okay: foo(l=12)
          Okay: for a in foo(l=12):
          E741: except AttributeError as O:
          E741: with lock as l:
          E741: global I
          E741: nonlocal l
          E741: def foo(l):
          E741: def foo(l=12):
          E741: l = foo(l=12)
          E741: for l in range(10):
          E742: class I(object):
          E743: def l(x):

          Continuation line under-indented for visual indent
          Open

                                              " doesn't contain an datetime.")
          Severity: Minor
          Found in apel/db/records/record.py by pep8

          Continuation lines indentation.

          Continuation lines should align wrapped elements either vertically
          using Python's implicit line joining inside parentheses, brackets
          and braces, or using a hanging indent.
          
          When using a hanging indent these considerations should be applied:
          - there should be no arguments on the first line, and
          - further indentation should be used to clearly distinguish itself
            as a continuation line.
          
          Okay: a = (\n)
          E123: a = (\n    )
          
          Okay: a = (\n    42)
          E121: a = (\n   42)
          E122: a = (\n42)
          E123: a = (\n    42\n    )
          E124: a = (24,\n     42\n)
          E125: if (\n    b):\n    pass
          E126: a = (\n        42)
          E127: a = (24,\n      42)
          E128: a = (24,\n    42)
          E129: if (a or\n    b):\n    pass
          E131: a = (\n    42\n 24)

          Expected 2 blank lines, found 1
          Open

          class InvalidRecordException(Exception):
          Severity: Minor
          Found in apel/db/records/record.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 (99 > 79 characters)
          Open

                      raise InvalidRecordException('Invalid content for field: %s (%s)' % (name, str(value)))
          Severity: Minor
          Found in apel/db/records/record.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

                          raise InvalidRecordException("Mandatory field " + key + " not specified.")
          Severity: Minor
          Found in apel/db/records/record.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 (80 > 79 characters)
          Open

                  # Change null values for Datetimes to the null object -> NULL in the DB.
          Severity: Minor
          Found in apel/db/records/record.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

                              # Not a datetime or an int, so it has to be a string representation.
          Severity: Minor
          Found in apel/db/records/record.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.

          Too many blank lines (2)
          Open

              def get_msg(self, withhold_dns=False):
          Severity: Minor
          Found in apel/db/records/record.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 get_unix_time(py_date):
          Severity: Minor
          Found in apel/db/records/record.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

          At least two spaces before inline comment
          Open

                      if name in self._int_fields: # integer values
          Severity: Minor
          Found in apel/db/records/record.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

          Line too long (97 > 79 characters)
          Open

                                  dt = datetime.utcfromtimestamp(time.mktime(time.strptime(dtval, isofmt)))
          Severity: Minor
          Found in apel/db/records/record.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.

          At least two spaces before inline comment
          Open

                              value = str(self._record_content[key]) # make sure we have a string
          Severity: Minor
          Found in apel/db/records/record.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

          Too many blank lines (2)
          Open

              def set_field(self, key, value):
          Severity: Minor
          Found in apel/db/records/record.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 (83 > 79 characters)
          Open

                                                       "without a key-value pair: %s" % line)
          Severity: Minor
          Found in apel/db/records/record.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.

          At least two spaces before inline comment
          Open

                      elif name in self._float_fields: # float values
          Severity: Minor
          Found in apel/db/records/record.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

          Line too long (86 > 79 characters)
          Open

                  # Change the null values for integers to None (not 'None'!) -> NULL in the DB.
          Severity: Minor
          Found in apel/db/records/record.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 check_for_null(value):
          Severity: Minor
          Found in apel/db/records/record.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

                  # The string values are getting 'None' (not None!) instead of going into the
          Severity: Minor
          Found in apel/db/records/record.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.

          Continuation line under-indented for visual indent
          Open

                                              " doesn't contain a float.")
          Severity: Minor
          Found in apel/db/records/record.py by pep8

          Continuation lines indentation.

          Continuation lines should align wrapped elements either vertically
          using Python's implicit line joining inside parentheses, brackets
          and braces, or using a hanging indent.
          
          When using a hanging indent these considerations should be applied:
          - there should be no arguments on the first line, and
          - further indentation should be used to clearly distinguish itself
            as a continuation line.
          
          Okay: a = (\n)
          E123: a = (\n    )
          
          Okay: a = (\n    42)
          E121: a = (\n   42)
          E122: a = (\n42)
          E123: a = (\n    42\n    )
          E124: a = (24,\n     42\n)
          E125: if (\n    b):\n    pass
          E126: a = (\n        42)
          E127: a = (24,\n      42)
          E128: a = (24,\n    42)
          E129: if (a or\n    b):\n    pass
          E131: a = (\n    42\n 24)

          Expected 2 blank lines, found 1
          Open

          class Record(object):
          Severity: Minor
          Found in apel/db/records/record.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 (90 > 79 characters)
          Open

                          raise InvalidRecordException("Mandatory field " + key + " not specified.")
          Severity: Minor
          Found in apel/db/records/record.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.

          Continuation line under-indented for visual indent
          Open

                                              " doesn't contain an integer.")
          Severity: Minor
          Found in apel/db/records/record.py by pep8

          Continuation lines indentation.

          Continuation lines should align wrapped elements either vertically
          using Python's implicit line joining inside parentheses, brackets
          and braces, or using a hanging indent.
          
          When using a hanging indent these considerations should be applied:
          - there should be no arguments on the first line, and
          - further indentation should be used to clearly distinguish itself
            as a continuation line.
          
          Okay: a = (\n)
          E123: a = (\n    )
          
          Okay: a = (\n    42)
          E121: a = (\n   42)
          E122: a = (\n42)
          E123: a = (\n    42\n    )
          E124: a = (24,\n     42\n)
          E125: if (\n    b):\n    pass
          E126: a = (\n        42)
          E127: a = (24,\n      42)
          E128: a = (24,\n    42)
          E129: if (a or\n    b):\n    pass
          E131: a = (\n    42\n 24)

          Continuation line under-indented for visual indent
          Open

                                             " doesn't contain a datetime.")
          Severity: Minor
          Found in apel/db/records/record.py by pep8

          Continuation lines indentation.

          Continuation lines should align wrapped elements either vertically
          using Python's implicit line joining inside parentheses, brackets
          and braces, or using a hanging indent.
          
          When using a hanging indent these considerations should be applied:
          - there should be no arguments on the first line, and
          - further indentation should be used to clearly distinguish itself
            as a continuation line.
          
          Okay: a = (\n)
          E123: a = (\n    )
          
          Okay: a = (\n    42)
          E121: a = (\n   42)
          E122: a = (\n42)
          E123: a = (\n    42\n    )
          E124: a = (24,\n     42\n)
          E125: if (\n    b):\n    pass
          E126: a = (\n        42)
          E127: a = (24,\n      42)
          E128: a = (24,\n    42)
          E129: if (a or\n    b):\n    pass
          E131: a = (\n    42\n 24)

          Line too long (101/100)
          Open

                              # A trailing Z in the ISO format denotes UTC.  We make this explicit for parsing.
          Severity: Info
          Found in apel/db/records/record.py by pylint

          Used when a line is longer than a given number of characters.

          Wrong continued indentation (add 13 spaces).
          Open

                                              " doesn't contain a float.")
          Severity: Info
          Found in apel/db/records/record.py by pylint

          TODO doesn't contain a float.) ^ |

          Wrong continued indentation (add 13 spaces).
          Open

                                              " doesn't contain a float.")
          Severity: Info
          Found in apel/db/records/record.py by pylint

          TODO doesn't contain a float.) ^ |

          Missing class docstring
          Open

          class InvalidRecordException(Exception):
          Severity: Info
          Found in apel/db/records/record.py by pylint

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

          Wrong continued indentation (add 14 spaces).
          Open

                                             " doesn't contain a datetime.")
          Severity: Info
          Found in apel/db/records/record.py by pylint

          TODO doesn't contain a datetime.) ^ |

          Wrong continued indentation (add 13 spaces).
          Open

                                              " doesn't contain an datetime.")
          Severity: Info
          Found in apel/db/records/record.py by pylint

          TODO doesn't contain an datetime.) ^ |

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

          log = logging.getLogger(LOGGER_ID)
          Severity: Info
          Found in apel/db/records/record.py by pylint

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

          Using type() instead of isinstance() for a typecheck.
          Open

                          if type(value) == datetime:
          Severity: Info
          Found in apel/db/records/record.py by pylint

          The idiomatic way to perform an explicit typecheck in Python is to use isinstance(x, Y) rather than type(x) == Y, type(x) is Y. Though there are unusual situations where these give different results.

          Wrong continued indentation (add 13 spaces).
          Open

                                              " doesn't contain an integer.")
          Severity: Info
          Found in apel/db/records/record.py by pylint

          TODO doesn't contain an integer.) ^ |

          Variable name e doesn't conform to snake_case naming style
          Open

                          except ValueError as e:
          Severity: Info
          Found in apel/db/records/record.py by pylint

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

          Wrong continued indentation (add 13 spaces).
          Open

                                              " doesn't contain an integer.")
          Severity: Info
          Found in apel/db/records/record.py by pylint

          TODO doesn't contain an integer.) ^ |

          Consider iterating the dictionary directly instead of calling .keys()
          Open

                  for key in contents.keys():
          Severity: Info
          Found in apel/db/records/record.py by pylint

          Emitted when the keys of a dictionary are iterated through the .keys() method. It is enough to just iterate through the dictionary itself, as in for key in dictionary.

          Line too long (102/100)
          Open

                              raise InvalidRecordException('Invalid float value %s in field %s' % (value, name))
          Severity: Info
          Found in apel/db/records/record.py by pylint

          Used when a line is longer than a given number of characters.

          Variable name l doesn't conform to snake_case naming style
          Open

                  l = []
          Severity: Info
          Found in apel/db/records/record.py by pylint

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

          Variable name dn doesn't conform to snake_case naming style
          Open

                  dn = self.get_field(Record.DN_FIELD)
          Severity: Info
          Found in apel/db/records/record.py by pylint

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

          Variable name dt doesn't conform to snake_case naming style
          Open

                                  dt = datetime.utcfromtimestamp(time.mktime(time.strptime(dtval, isofmt)))
          Severity: Info
          Found in apel/db/records/record.py by pylint

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

          standard import import time should be placed before from apel.db import LOGGER_ID
          Open

          import time
          Severity: Info
          Found in apel/db/records/record.py by pylint

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

          standard import from datetime import datetime should be placed before from apel.db import LOGGER_ID
          Open

          from datetime import datetime
          Severity: Info
          Found in apel/db/records/record.py by pylint

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

          standard import import calendar should be placed before from apel.db import LOGGER_ID
          Open

          import calendar
          Severity: Info
          Found in apel/db/records/record.py by pylint

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

          standard import import logging should be placed before from apel.db import LOGGER_ID
          Open

          import logging
          Severity: Info
          Found in apel/db/records/record.py by pylint

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

          There are no issues that match your filters.

          Category
          Status