Showing 1,422 of 1,425 total issues

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

            elif elem.endswith("_notin"):
                column = elem[:-6]
                wh = '('
                for item in self.__dict__[elem]:
                    wh += '"' + item + '",'
Severity: Major
Found in apel/db/apeldb.py and 1 other location - About 5 hrs to fix
apel/db/apeldb.py on lines 126..134

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

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 elem.endswith("_in"):
                column = elem[:-3]
                wh = '('
                for item in self.__dict__[elem]:
                    wh += '"' + item + '",'
Severity: Major
Found in apel/db/apeldb.py and 1 other location - About 5 hrs to fix
apel/db/apeldb.py on lines 135..143

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

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('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

Function fetch_specint has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

def fetch_specint(site, host='lcg-bdii.egi.eu', port=2170):
    '''
    Imports benchmark data from LDAP. Current implementation
    is able to fetch data according to way described here:

Severity: Minor
Found in apel/ldap/query.py - About 4 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

Function handle_parsing has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

def handle_parsing(log_type, apel_db, cp):
    '''
    Create the appropriate parser, and scan the configured directory
    for log files, parsing them.

Severity: Minor
Found in bin/parser.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

File parser.py has 316 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#!/usr/bin/env python

#   Copyright (C) 2012 STFC
#
#   Licensed under the Apache License, Version 2.0 (the "License");
Severity: Minor
Found in bin/parser.py - About 3 hrs to fix

    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/summary.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/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 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('Role') is not None:
                role_attr = doc.createElement('sr:GroupAttribute')
                role_attr.setAttribute('sr:attributeType', 'role')
                role_attr.appendChild(doc.createTextNode(self.get_field('Role')))
                s_identity.appendChild(role_attr)
    Severity: Major
    Found in apel/db/records/storage.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/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/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

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

            if self.get_field('urf:GlobalUserName') is not None:
                global_user_name = doc.createElement('urf:GlobalUserName')
                global_user_name.appendChild(doc.createTextNode(self.get_field('GlobalUserName')))
                global_user_name.setAttribute('urf:type', 'opensslCompat')
                user_id.appendChild(global_user_name)
    Severity: Major
    Found in apel/db/records/summary.py and 1 other location - About 3 hrs to fix
    apel/db/records/normalised_summary.py on lines 160..164

    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('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

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

            if self.get_field('urf:GlobalUserName') is not None:
                global_user_name = doc.createElement('urf:GlobalUserName')
                global_user_name.appendChild(doc.createTextNode(self.get_field('GlobalUserName')))
                global_user_name.setAttribute('urf:type', 'opensslCompat')
                user_id.appendChild(global_user_name)
    Severity: Major
    Found in apel/db/records/normalised_summary.py and 1 other location - About 3 hrs to fix
    apel/db/records/summary.py on lines 154..158

    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('SubGroup') is not None:
                sub_attr = doc.createElement('sr:GroupAttribute')
                sub_attr.setAttribute('sr:attributeType', 'subgroup')
                sub_attr.appendChild(doc.createTextNode(self.get_field('SubGroup')))
                s_identity.appendChild(sub_attr)
    Severity: Major
    Found in apel/db/records/storage.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/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 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('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/summary.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/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

    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 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/normalised_summary.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/job.py on lines 225..229
    apel/db/records/normalised_summary.py on lines 171..175
    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/normalised_summary.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/job.py on lines 225..229
    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 3 locations. Consider refactoring.
    Open

            if self.get_field('LogicalCapacityUsed') is not None:
                logical_capacity_used = self.get_field('LogicalCapacityUsed')
                l_capacity_used = doc.createElement('sr:LogicalCapacityUsed')
                l_capacity_used.appendChild(doc.createTextNode(str(logical_capacity_used)))
                ur.appendChild(l_capacity_used)
    Severity: Major
    Found in apel/db/records/storage.py and 2 other locations - About 3 hrs to fix
    apel/db/records/storage.py on lines 140..144
    apel/db/records/storage.py on lines 215..219

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

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

            if self.get_field('ResourceCapacityAllocated') is not None:
                resource_capacity_allocated = self.get_field('ResourceCapacityAllocated')
                r_capacity_allocated = doc.createElement('sr:ResourceCapacityAllocated')
                r_capacity_allocated.appendChild(doc.createTextNode(str(resource_capacity_allocated)))
                ur.appendChild(r_capacity_allocated)
    Severity: Major
    Found in apel/db/records/storage.py and 2 other locations - About 3 hrs to fix
    apel/db/records/storage.py on lines 140..144
    apel/db/records/storage.py on lines 209..213

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

    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

    Severity
    Category
    Status
    Source
    Language