apel/db/records/job.py

Summary

Maintainability
F
5 days
Test Coverage

Using Document to parse untrusted XML data is known to be vulnerable to XML attacks. Replace Document with the equivalent defusedxml package, or make sure defusedxml.defuse_stdlib() is called.
Open

from xml.dom.minidom import Document
Severity: Info
Found in apel/db/records/job.py by bandit

Cyclomatic complexity is too high in method get_ur. (13)
Open

    def get_ur(self, withhold_dns=False):
        '''
        Returns the JobRecord in CAR format. See
        https://twiki.cern.ch/twiki/bin/view/EMI/ComputeAccounting

Severity: Minor
Found in apel/db/records/job.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_ur has 63 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def get_ur(self, withhold_dns=False):
        '''
        Returns the JobRecord in CAR format. See
        https://twiki.cern.ch/twiki/bin/view/EMI/ComputeAccounting

Severity: Major
Found in apel/db/records/job.py - About 2 hrs to fix

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

        def get_ur(self, withhold_dns=False):
            '''
            Returns the JobRecord in CAR format. See
            https://twiki.cern.ch/twiki/bin/view/EMI/ComputeAccounting
    
    
    Severity: Minor
    Found in apel/db/records/job.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 _check_factor has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def _check_factor(self, sfu, sf):
            '''
            Check for the validity of the ScalingFactorUnit and ScalingFactor fields.
            We accept neither field included or both.  If only one of the fields is
            included, it doesn't really make sense so we reject it.
    Severity: Minor
    Found in apel/db/records/job.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 _check_fields has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def _check_fields(self):
            '''
            Add extra checks to those made in every record.
            '''
            # First, call the parent's version.
    Severity: Minor
    Found in apel/db/records/job.py - About 35 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

    Unnecessary else after raise
    Open

                if sfu == 'None':
    Severity: Info
    Found in apel/db/records/job.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 statements (107/50)
    Open

        def get_ur(self, withhold_dns=False):
    Severity: Info
    Found in apel/db/records/job.py by pylint

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

    Too many instance attributes (9/7)
    Open

    class JobRecord(Record):
    Severity: Info
    Found in apel/db/records/job.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 sfu != 'None':
    Severity: Info
    Found in apel/db/records/job.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 local variables (34/15)
    Open

        def get_ur(self, withhold_dns=False):
    Severity: Info
    Found in apel/db/records/job.py by pylint

    Used when a function or method has too many local variables.

    Too many branches (13/12)
    Open

        def get_ur(self, withhold_dns=False):
    Severity: Info
    Found in apel/db/records/job.py by pylint

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

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

            if self.get_field('MemoryReal') > 0:
                pmem = doc.createElement('urf:Memory')
                pmem.setAttribute('urf:type', 'Physical')
                pmem.setAttribute('urf:storageUnit', 'KB')
                pmem.appendChild(doc.createTextNode(str(self.get_field('MemoryReal'))))
    Severity: Major
    Found in apel/db/records/job.py and 1 other location - About 4 hrs to fix
    apel/db/records/job.py on lines 267..272

    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 81.

    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

            if self.get_field('MemoryVirtual') > 0:
                vmem = doc.createElement('urf:Memory')
                vmem.setAttribute('urf:type', 'Shared')
                vmem.setAttribute('urf:storageUnit', 'KB')
                vmem.appendChild(doc.createTextNode(str(self.get_field('MemoryVirtual'))))
    Severity: Major
    Found in apel/db/records/job.py and 1 other location - About 4 hrs to fix
    apel/db/records/job.py on lines 260..265

    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 81.

    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 9 locations. Consider refactoring.
    Open

            if self.get_field('VORole') is not None:
                vorole = doc.createElement('urf:GroupAttribute')
                vorole.setAttribute('urf:type', 'vo-role')
                vorole.appendChild(doc.createTextNode(self.get_field('VORole')))
                user_id.appendChild(vorole)
    Severity: Major
    Found in apel/db/records/job.py and 8 other locations - About 3 hrs to fix
    apel/db/records/job.py on lines 213..217
    apel/db/records/job.py on lines 219..223
    apel/db/records/normalised_summary.py on lines 171..175
    apel/db/records/normalised_summary.py on lines 177..181
    apel/db/records/storage.py on lines 179..183
    apel/db/records/storage.py on lines 185..189
    apel/db/records/summary.py on lines 165..169
    apel/db/records/summary.py on lines 171..175

    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 67.

    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 9 locations. Consider refactoring.
    Open

            if self.get_field('FQAN') is not None:
                fqan = doc.createElement('urf:GroupAttribute')
                fqan.setAttribute('urf:type', 'FQAN')
                fqan.appendChild(doc.createTextNode(self.get_field('FQAN')))
                user_id.appendChild(fqan)
    Severity: Major
    Found in apel/db/records/job.py and 8 other locations - About 3 hrs to fix
    apel/db/records/job.py on lines 219..223
    apel/db/records/job.py on lines 225..229
    apel/db/records/normalised_summary.py on lines 171..175
    apel/db/records/normalised_summary.py on lines 177..181
    apel/db/records/storage.py on lines 179..183
    apel/db/records/storage.py on lines 185..189
    apel/db/records/summary.py on lines 165..169
    apel/db/records/summary.py on lines 171..175

    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 67.

    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 9 locations. Consider refactoring.
    Open

            if self.get_field('VOGroup') is not None:
                vogroup = doc.createElement('urf:GroupAttribute')
                vogroup.setAttribute('urf:type', 'vo-group')
                vogroup.appendChild(doc.createTextNode(self.get_field('VOGroup')))
                user_id.appendChild(vogroup)
    Severity: Major
    Found in apel/db/records/job.py and 8 other locations - About 3 hrs to fix
    apel/db/records/job.py on lines 213..217
    apel/db/records/job.py on lines 225..229
    apel/db/records/normalised_summary.py on lines 171..175
    apel/db/records/normalised_summary.py on lines 177..181
    apel/db/records/storage.py on lines 179..183
    apel/db/records/storage.py on lines 185..189
    apel/db/records/summary.py on lines 165..169
    apel/db/records/summary.py on lines 171..175

    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 67.

    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 6 locations. Consider refactoring.
    Open

            if self.get_field('NodeCount') > 0:
                ncount = doc.createElement('urf:NodeCount')
                ncount.appendChild(doc.createTextNode(str(self.get_field('NodeCount'))))
                ur.appendChild(ncount)
    Severity: Major
    Found in apel/db/records/job.py and 5 other locations - About 2 hrs to fix
    apel/db/records/job.py on lines 279..282
    apel/db/records/normalised_summary.py on lines 223..226
    apel/db/records/normalised_summary.py on lines 228..231
    apel/db/records/summary.py on lines 214..217
    apel/db/records/summary.py on lines 219..222

    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 61.

    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 6 locations. Consider refactoring.
    Open

            if self.get_field('Processors') > 0:
                procs = doc.createElement('urf:Processors')
                procs.appendChild(doc.createTextNode(str(self.get_field('Processors'))))
                ur.appendChild(procs)
    Severity: Major
    Found in apel/db/records/job.py and 5 other locations - About 2 hrs to fix
    apel/db/records/job.py on lines 274..277
    apel/db/records/normalised_summary.py on lines 223..226
    apel/db/records/normalised_summary.py on lines 228..231
    apel/db/records/summary.py on lines 214..217
    apel/db/records/summary.py on lines 219..222

    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 61.

    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 5 locations. Consider refactoring.
    Open

            if self.get_field('VO') is not None:
                group = doc.createElement('urf:Group')
                group.appendChild(doc.createTextNode(self.get_field('VO')))
                user_id.appendChild(group)
    Severity: Major
    Found in apel/db/records/job.py and 4 other locations - About 2 hrs to fix
    apel/db/records/job.py on lines 231..234
    apel/db/records/job.py on lines 298..301
    apel/db/records/normalised_summary.py on lines 166..169
    apel/db/records/summary.py on lines 160..163

    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 57.

    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 5 locations. Consider refactoring.
    Open

            if self.get_field('SubmitHost') is not None:
                subhost = doc.createElement('urf:SubmitHost')
                subhost.appendChild(doc.createTextNode(self.get_field('SubmitHost')))
                ur.appendChild(subhost)
    Severity: Major
    Found in apel/db/records/job.py and 4 other locations - About 2 hrs to fix
    apel/db/records/job.py on lines 208..211
    apel/db/records/job.py on lines 231..234
    apel/db/records/normalised_summary.py on lines 166..169
    apel/db/records/summary.py on lines 160..163

    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 57.

    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 5 locations. Consider refactoring.
    Open

            if self.get_field('LocalUserId') is not None:
                local_user_id = doc.createElement('urf:LocalUserId')
                local_user_id.appendChild(doc.createTextNode(self.get_field('LocalUserId')))
                user_id.appendChild(local_user_id)
    Severity: Major
    Found in apel/db/records/job.py and 4 other locations - About 2 hrs to fix
    apel/db/records/job.py on lines 208..211
    apel/db/records/job.py on lines 298..301
    apel/db/records/normalised_summary.py on lines 166..169
    apel/db/records/summary.py on lines 160..163

    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 57.

    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 8 locations. Consider refactoring.
    Open

            cpu.appendChild(doc.createTextNode('PT'+str(self.get_field('CpuDuration'))+'S'))
    Severity: Major
    Found in apel/db/records/job.py and 7 other locations - About 55 mins to fix
    apel/db/records/job.py on lines 247..247
    apel/db/records/normalised_summary.py on lines 204..204
    apel/db/records/normalised_summary.py on lines 208..208
    apel/db/records/normalised_summary.py on lines 212..212
    apel/db/records/normalised_summary.py on lines 216..216
    apel/db/records/summary.py on lines 198..198
    apel/db/records/summary.py on lines 202..202

    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 37.

    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 8 locations. Consider refactoring.
    Open

            wall.appendChild(doc.createTextNode('PT'+str(self.get_field('WallDuration'))+'S'))
    Severity: Major
    Found in apel/db/records/job.py and 7 other locations - About 55 mins to fix
    apel/db/records/job.py on lines 252..252
    apel/db/records/normalised_summary.py on lines 204..204
    apel/db/records/normalised_summary.py on lines 208..208
    apel/db/records/normalised_summary.py on lines 212..212
    apel/db/records/normalised_summary.py on lines 216..216
    apel/db/records/summary.py on lines 198..198
    apel/db/records/summary.py on lines 202..202

    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 37.

    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 (94 > 79 characters)
    Open

                    raise InvalidRecordException('Unit but not value supplied for ScalingFactor.')
    Severity: Minor
    Found in apel/db/records/job.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

            else: # sf is present
    Severity: Minor
    Found in apel/db/records/job.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 (91 > 79 characters)
    Open

                           "GlobalUserName", "FQAN", "VO", "VOGroup", "VORole", "WallDuration",
    Severity: Minor
    Found in apel/db/records/job.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

                           "VOGroup", "VORole", "WallDuration", "CpuDuration", "Processors",
    Severity: Minor
    Found in apel/db/records/job.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 (93 > 79 characters)
    Open

                    raise InvalidRecordException("Epoch time " + str(end) + " is in the future.")
    Severity: Minor
    Found in apel/db/records/job.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

                                    ' not valid.')
    Severity: Minor
    Found in apel/db/records/job.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 (84 > 79 characters)
    Open

                procs.appendChild(doc.createTextNode(str(self.get_field('Processors'))))
    Severity: Minor
    Found in apel/db/records/job.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

                subhost.appendChild(doc.createTextNode(self.get_field('SubmitHost')))
    Severity: Minor
    Found in apel/db/records/job.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 (101 > 79 characters)
    Open

            self._db_fields = ["Site", "SubmitHost", "MachineName", "Queue", "LocalJobId", "LocalUserId",
    Severity: Minor
    Found in apel/db/records/job.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

            Check for the validity of the ScalingFactorUnit and ScalingFactor fields.
    Severity: Minor
    Found in apel/db/records/job.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

                           "NodeCount", "StartTime", "EndTime", "InfrastructureDescription", "InfrastructureType", "MemoryReal",
    Severity: Minor
    Found in apel/db/records/job.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 (84 > 79 characters)
    Open

                ncount.appendChild(doc.createTextNode(str(self.get_field('NodeCount'))))
    Severity: Minor
    Found in apel/db/records/job.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

            # This list allows us to specify the order of lines when we construct records.
    Severity: Minor
    Found in apel/db/records/job.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

                           "CpuDuration", "Processors", "NodeCount", "StartTime", "EndTime", "InfrastructureDescription", "InfrastructureType",
    Severity: Minor
    Found in apel/db/records/job.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 (125 > 79 characters)
    Open

            record_id = self.get_field('MachineName') + ' ' + self.get_field('LocalJobId') + ' ' + str(self.get_field('EndTime'))
    Severity: Minor
    Found in apel/db/records/job.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 (97 > 79 characters)
    Open

            start_text = time.strftime('%Y-%m-%dT%H:%M:%SZ', self.get_field('StartTime').timetuple())
    Severity: Minor
    Found in apel/db/records/job.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 (139 > 79 characters)
    Open

                           "CpuDuration", "Processors", "NodeCount", "StartTime", "EndTime", "InfrastructureDescription", "InfrastructureType",
    Severity: Minor
    Found in apel/db/records/job.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

                           "ServiceLevel"]
    Severity: Minor
    Found in apel/db/records/job.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 (93 > 79 characters)
    Open

            end_text = time.strftime('%Y-%m-%dT%H:%M:%SZ', self.get_field('EndTime').timetuple())
    Severity: Minor
    Found in apel/db/records/job.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 (94 > 79 characters)
    Open

                raise InvalidRecordException("Cannot parse an integer from StartTime or EndTime.")
    Severity: Minor
    Found in apel/db/records/job.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

                           "GlobalUserName", "FQAN", "VO", "VOGroup", "VORole", "WallDuration",
    Severity: Minor
    Found in apel/db/records/job.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 (88 > 79 characters)
    Open

                           "VOGroup", "VORole", "WallDuration", "CpuDuration", "Processors",
    Severity: Minor
    Found in apel/db/records/job.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

                local_user_id.appendChild(doc.createTextNode(self.get_field('LocalUserId')))
    Severity: Minor
    Found in apel/db/records/job.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

            cpu.appendChild(doc.createTextNode('PT'+str(self.get_field('CpuDuration'))+'S'))
    Severity: Minor
    Found in apel/db/records/job.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

            service_level.setAttribute('urf:type', self.get_field('ServiceLevelType'))
    Severity: Minor
    Found in apel/db/records/job.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

                           "MemoryVirtual", "ServiceLevelType", "ServiceLevel"]
    Severity: Minor
    Found in apel/db/records/job.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

                pmem.appendChild(doc.createTextNode(str(self.get_field('MemoryReal'))))
    Severity: Minor
    Found in apel/db/records/job.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

                           "MemoryReal", "MemoryVirtual", "ServiceLevelType",
    Severity: Minor
    Found in apel/db/records/job.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 (124 > 79 characters)
    Open

                           "NodeCount", "StartTime", "EndTime", "InfrastructureDescription", "InfrastructureType", "MemoryReal",
    Severity: Minor
    Found in apel/db/records/job.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 (103 > 79 characters)
    Open

            self._msg_fields  = ["Site", "SubmitHost", "MachineName", "Queue", "LocalJobId", "LocalUserId",
    Severity: Minor
    Found in apel/db/records/job.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 _check_start_end_times(self):
    Severity: Minor
    Found in apel/db/records/job.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

    Multiple spaces before operator
    Open

            self._msg_fields  = ["Site", "SubmitHost", "MachineName", "Queue", "LocalJobId", "LocalUserId",
    Severity: Minor
    Found in apel/db/records/job.py by pep8

    Avoid extraneous whitespace around an operator.

    Okay: a = 12 + 3
    E221: a = 4  + 5
    E222: a = 4 +  5
    E223: a = 4\t+ 5
    E224: a = 4 +\t5

    Line too long (94 > 79 characters)
    Open

                    raise InvalidRecordException('Unit but not value supplied for ScalingFactor.')
    Severity: Minor
    Found in apel/db/records/job.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

                vmem.appendChild(doc.createTextNode(str(self.get_field('MemoryVirtual'))))
    Severity: Minor
    Found in apel/db/records/job.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

                           "GlobalUserName", "FQAN", "VO",
    Severity: Minor
    Found in apel/db/records/job.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)

    Too many blank lines (2)
    Open

            # Check the ScalingFactor.
    Severity: Minor
    Found in apel/db/records/job.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

        def _check_factor(self, sfu, sf):
    Severity: Minor
    Found in apel/db/records/job.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

            rec_id.setAttribute('urf:createTime', datetime.now().strftime('%Y-%m-%dT%H:%M:%S'))
    Severity: Minor
    Found in apel/db/records/job.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

            wall.appendChild(doc.createTextNode('PT'+str(self.get_field('WallDuration'))+'S'))
    Severity: Minor
    Found in apel/db/records/job.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

            service_level.appendChild(doc.createTextNode(str(self.get_field('ServiceLevel'))))
    Severity: Minor
    Found in apel/db/records/job.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.

    Wrong continued indentation (add 4 spaces).
    Open

                           "GlobalUserName", "FQAN", "VO",
    Severity: Info
    Found in apel/db/records/job.py by pylint

    TODO GlobalUserName, FQAN, VO, ^ |

    Line too long (124/100)
    Open

                           "NodeCount", "StartTime", "EndTime", "InfrastructureDescription", "InfrastructureType", "MemoryReal",
    Severity: Info
    Found in apel/db/records/job.py by pylint

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

    Line too long (125/100)
    Open

            record_id = self.get_field('MachineName') + ' ' + self.get_field('LocalJobId') + ' ' + str(self.get_field('EndTime'))
    Severity: Info
    Found in apel/db/records/job.py by pylint

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

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

            ur = doc.createElement('urf:UsageRecord')
    Severity: Info
    Found in apel/db/records/job.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('GlobalUserName')
    Severity: Info
    Found in apel/db/records/job.py by pylint

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

    Line too long (103/100)
    Open

            self._msg_fields  = ["Site", "SubmitHost", "MachineName", "Queue", "LocalJobId", "LocalUserId",
    Severity: Info
    Found in apel/db/records/job.py by pylint

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

    Wrong continued indentation (add 6 spaces).
    Open

                           "GlobalUserName", "FQAN", "VO", "VOGroup", "VORole", "WallDuration",
    Severity: Info
    Found in apel/db/records/job.py by pylint

    TODO GlobalUserName, FQAN, VO, VOGroup, VORole, WallDuration, ^ |

    Line too long (139/100)
    Open

                           "CpuDuration", "Processors", "NodeCount", "StartTime", "EndTime", "InfrastructureDescription", "InfrastructureType",
    Severity: Info
    Found in apel/db/records/job.py by pylint

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

    standard import from datetime import datetime, timedelta should be placed before from apel.db.records import Record, InvalidRecordException
    Open

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

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

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

                role, group, vo = parse_fqan(self._record_content['FQAN'])
    Severity: Info
    Found in apel/db/records/job.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 = WITHHELD_DN
    Severity: Info
    Found in apel/db/records/job.py by pylint

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

    standard import from xml.dom.minidom import Document should be placed before from apel.db.records import Record, InvalidRecordException
    Open

    from xml.dom.minidom import Document
    Severity: Info
    Found in apel/db/records/job.py by pylint

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

    Wrong continued indentation (add 4 spaces).
    Open

                           "MemoryVirtual", "ServiceLevelType", "ServiceLevel"]
    Severity: Info
    Found in apel/db/records/job.py by pylint

    TODO MemoryVirtual, ServiceLevelType, ServiceLevel] ^ |

    Argument name sf doesn't conform to snake_case naming style
    Open

        def _check_factor(self, sfu, sf):
    Severity: Info
    Found in apel/db/records/job.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.records import Record, InvalidRecordException
    Open

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

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

    Exactly one space required before assignment
    Open

            self._msg_fields  = ["Site", "SubmitHost", "MachineName", "Queue", "LocalJobId", "LocalUserId",
    Severity: Info
    Found in apel/db/records/job.py by pylint

    Used when a wrong number of spaces is used around an operator, bracket or block opener. self.msgfields = [Site, SubmitHost, MachineName, Queue, LocalJobId, LocalUserId, ^

    Wrong continued indentation (add 4 spaces).
    Open

                           "NodeCount", "StartTime", "EndTime", "InfrastructureDescription", "InfrastructureType", "MemoryReal",
    Severity: Info
    Found in apel/db/records/job.py by pylint

    TODO NodeCount, StartTime, EndTime, InfrastructureDescription, InfrastructureType, MemoryReal, ^ |

    Wrong continued indentation (add 6 spaces).
    Open

                           "CpuDuration", "Processors", "NodeCount", "StartTime", "EndTime", "InfrastructureDescription", "InfrastructureType",
    Severity: Info
    Found in apel/db/records/job.py by pylint

    TODO CpuDuration, Processors, NodeCount, StartTime, EndTime, InfrastructureDescription, InfrastructureType, ^ |

    Wrong continued indentation (add 4 spaces).
    Open

                           "VOGroup", "VORole", "WallDuration", "CpuDuration", "Processors",
    Severity: Info
    Found in apel/db/records/job.py by pylint

    TODO VOGroup, VORole, WallDuration, CpuDuration, Processors, ^ |

    Wrong continued indentation (add 6 spaces).
    Open

                           "ServiceLevel"]
    Severity: Info
    Found in apel/db/records/job.py by pylint

    TODO ServiceLevel] ^ |

    Wrong continued indentation (add 17 spaces).
    Open

                                    ' not valid.')
    Severity: Info
    Found in apel/db/records/job.py by pylint

    TODO ' not valid.') ^ |

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

            sl = self._record_content['ServiceLevel']
    Severity: Info
    Found in apel/db/records/job.py by pylint

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

    Wrong continued indentation (add 6 spaces).
    Open

                           "MemoryReal", "MemoryVirtual", "ServiceLevelType",
    Severity: Info
    Found in apel/db/records/job.py by pylint

    TODO MemoryReal, MemoryVirtual, ServiceLevelType, ^ |

    Line too long (101/100)
    Open

            self._db_fields = ["Site", "SubmitHost", "MachineName", "Queue", "LocalJobId", "LocalUserId",
    Severity: Info
    Found in apel/db/records/job.py by pylint

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

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

                    vo = 'None'
    Severity: Info
    Found in apel/db/records/job.py by pylint

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

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

            (slt, sl) = self._check_factor(slt, sl)
    Severity: Info
    Found in apel/db/records/job.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