renalreg/radar

View on GitHub
radar/exporter/nurture_validator.py

Summary

Maintainability
F
1 wk
Test Coverage

File nurture_validator.py has 786 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""
Script to do simple validations on nurture export.
"""

from collections import defaultdict, OrderedDict
Severity: Major
Found in radar/exporter/nurture_validator.py - About 1 day to fix

    Function export has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

        def export(self, sheet, errorfmt=None, warningfmt=None):
            medications = self.patient.medications
            if medications:
                for instance in medications:
                    data = [getattr(instance, field) for field in self.fields]
    Severity: Minor
    Found in radar/exporter/nurture_validator.py - About 2 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 export has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

        def export(self, sheet, errorfmt, warningfmt):
            entries = [entry for entry in self.patient.entries if entry.form.slug == 'socio-economic']
            if entries:
                for entry in entries:
                    data = get_form_data(entry, slice(1, -4), self.fields)
    Severity: Minor
    Found in radar/exporter/nurture_validator.py - About 2 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 export has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

        def export(self, sheet, errorfmt, warningfmt):
            entries = [entry for entry in self.patient.entries if entry.form.slug == 'anthropometrics']
            if entries:
                for entry in entries:
    
    
    Severity: Minor
    Found in radar/exporter/nurture_validator.py - About 2 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 export has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        def export(self, sheet, errorfmt=None, warningfmt=None):
            recorded = False
            for diagnosis in self.diagnoses:
                if diagnosis.diagnosis not in self.primary_diagnoses:
                    continue
    Severity: Minor
    Found in radar/exporter/nurture_validator.py - About 2 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 export has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        def export(self, sheet, errorfmt=None, warningfmt=None):
            visit_dates = [i.data.get('date') for i in self.patient.entries if i.form.slug == 'nurtureckd']
            visit_dates = [datetime.datetime.strptime(i, '%Y-%m-%d').date() for i in visit_dates]
    
            # TODO: clean this stuff up.
    Severity: Minor
    Found in radar/exporter/nurture_validator.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 export has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        def export(self, sheet, errorfmt=None, warningfmt=None):
            progressions = self.patient.renal_progressions
            if progressions:
                for instance in progressions:
                    data = [getattr(instance, field) for field in self.fields]
    Severity: Minor
    Found in radar/exporter/nurture_validator.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 export has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def export(self, sheet, errorfmt=None, warningfmt=None):
            data = OrderedDict()
            visit_dates = [i.data.get('date') for i in self.patient.entries if i.form.slug == 'nurtureckd']
    
            within_range = False
    Severity: Minor
    Found in radar/exporter/nurture_validator.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 export_validate has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    def export_validate():
        primary = GROUP_DIAGNOSIS_TYPE.PRIMARY
    
        nurtureins = Group.query.filter_by(code='NURTUREINS').first()
        nurtureins_primary_diagnoses = [
    Severity: Minor
    Found in radar/exporter/nurture_validator.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 export has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def export(self):
            try:
                patient = self.data[0]
            except IndexError:
                print('No {} patients found in {}'.format(self.kind.upper(), self.hospital.name))
    Severity: Minor
    Found in radar/exporter/nurture_validator.py - About 1 hr to fix

      Function export has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def export(self):
              try:
                  patient = self.data[0]
              except IndexError:
                  print('No {} patients found in {}'.format(self.kind.upper(), self.hospital.name))
      Severity: Minor
      Found in radar/exporter/nurture_validator.py - About 55 mins to fix

      Cognitive Complexity

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

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

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

      Further reading

      Avoid too many return statements within this function.
      Open

          return None
      Severity: Major
      Found in radar/exporter/nurture_validator.py - About 30 mins to fix

        Function export has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            def export(self, sheet, errorfmt=None, warningfmt=None):
                recorded = False
                for diagnosis in self.diagnoses:
                    if diagnosis.diagnosis in self.primary_diagnoses:
                        continue
        Severity: Minor
        Found in radar/exporter/nurture_validator.py - About 25 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

        Function in_range has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        def in_range(values):
            for first, second in itertools.combinations(values, 2):
                if first is None or second is None:
                    return False
                if abs(first - second) > BLOOD_PRESSURE_DELTA:
        Severity: Minor
        Found in radar/exporter/nurture_validator.py - About 25 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

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

            def export(self, sheet, errorfmt, warningfmt):
                entries = [entry for entry in self.patient.entries if entry.form.slug == 'family-history']
                if entries:
                    for entry in entries:
                        data = get_form_data(entry, slice(1, -4), self.fields)
        Severity: Major
        Found in radar/exporter/nurture_validator.py and 2 other locations - About 5 hrs to fix
        radar/exporter/nurture_validator.py on lines 373..382
        radar/exporter/nurture_validator.py on lines 738..753

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

        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

            def export(self, sheet, errorfmt, warningfmt):
                # everything is validated on form submit, technically it is impossible
                # to have missing fields
                entries = [entry for entry in self.patient.entries if entry.form.slug == 'nurtureckd']
                if entries:
        Severity: Major
        Found in radar/exporter/nurture_validator.py and 2 other locations - About 5 hrs to fix
        radar/exporter/nurture_validator.py on lines 410..417
        radar/exporter/nurture_validator.py on lines 738..753

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

        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

            def export(self, sheet, errorfmt, warningfmt):
                entries = [entry for entry in self.patient.entries if entry.form.slug == 'samples']
                if entries:
                    for entry in entries:
                        data = get_form_data(entry, slice(1, -4), self.fields)
        Severity: Major
        Found in radar/exporter/nurture_validator.py and 2 other locations - About 5 hrs to fix
        radar/exporter/nurture_validator.py on lines 373..382
        radar/exporter/nurture_validator.py on lines 410..417

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

        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 not in_range(data[10:13]):
                            sheet.write(10, data[10], errorfmt)
                            sheet.write(11, data[11], errorfmt)
                            sheet.write(12, data[12], errorfmt)
        Severity: Major
        Found in radar/exporter/nurture_validator.py and 1 other location - About 3 hrs to fix
        radar/exporter/nurture_validator.py on lines 509..512

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

        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 not in_range(data[14:17]):
                            sheet.write(14, data[14], errorfmt)
                            sheet.write(15, data[15], errorfmt)
                            sheet.write(16, data[16], errorfmt)
        Severity: Major
        Found in radar/exporter/nurture_validator.py and 1 other location - About 3 hrs to fix
        radar/exporter/nurture_validator.py on lines 504..507

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

        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

        def get_hospitals():
            select_stmt = text('''
                SELECT DISTINCT created_group_id FROM group_patients
                WHERE group_id IN (
                    SELECT id FROM groups
        Severity: Major
        Found in radar/exporter/nurture_validator.py and 1 other location - About 1 hr to fix
        radar/exporter/revisit.py on lines 10..19

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

        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

            def __init__(self, patient):
                self.patient = patient
                self.fields = (
                    'patient_id',
                    'chd',
        Severity: Major
        Found in radar/exporter/nurture_validator.py and 1 other location - About 1 hr to fix
        radar/exporter/nurture_validator.py on lines 302..321

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

        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

            def __init__(self, patient):
                self.patient = patient
                self.fields = (
                    'patient_id',
                    'maritalStatus',
        Severity: Major
        Found in radar/exporter/nurture_validator.py and 1 other location - About 1 hr to fix
        radar/exporter/nurture_validator.py on lines 388..407

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

        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 data[7] and data[8] is None:
                            sheet.write(8, '', warningfmt)
        Severity: Major
        Found in radar/exporter/nurture_validator.py and 1 other location - About 1 hr to fix
        radar/exporter/nurture_validator.py on lines 335..336

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

        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 data[9] and data[10] is None:
                            sheet.write(10, '', warningfmt)
        Severity: Major
        Found in radar/exporter/nurture_validator.py and 1 other location - About 1 hr to fix
        radar/exporter/nurture_validator.py on lines 333..334

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

        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

                visit_dates = [i.data.get('date') for i in self.patient.entries if i.form.slug == 'nurtureckd']
        Severity: Minor
        Found in radar/exporter/nurture_validator.py and 1 other location - About 55 mins to fix
        radar/exporter/nurture_validator.py on lines 639..639

        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

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

                visit_dates = [i.data.get('date') for i in self.patient.entries if i.form.slug == 'nurtureckd']
        Severity: Minor
        Found in radar/exporter/nurture_validator.py and 1 other location - About 55 mins to fix
        radar/exporter/nurture_validator.py on lines 587..587

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

            def __init__(self, patient):
                self.patient = patient
                self.fields = (
                    'patient_id',
                    'laser',
        Severity: Minor
        Found in radar/exporter/nurture_validator.py and 1 other location - About 35 mins to fix
        radar/exporter/nurture_validator.py on lines 677..690

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

        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

            def __init__(self, patient):
                self.patient = patient
                self.fields = (
                    'patient_id',
                    'onset_date',
        Severity: Minor
        Found in radar/exporter/nurture_validator.py and 1 other location - About 35 mins to fix
        radar/exporter/nurture_validator.py on lines 423..436

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

        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

        There are no issues that match your filters.

        Category
        Status