Showing 349 of 349 total issues

Function sort has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def sort(query, key, model, aliases=None, join_columns=None, clear=False,
         hide_null=False, index_column=None):
    """Sort query using string-formatted columns.

    :param query: Original query
Severity: Minor
Found in webservices/sorting.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 getSelectedValue has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  getSelectedValue: function(select) {
    if (!select.multiple) {
      return select.value;
    } else {
      var options = [];
Severity: Minor
Found in swagger-ui/js/view/OperationView.js - 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

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

    filter_range_fields = [
        (('min_date', 'max_date'), models.ScheduleF.expenditure_date),
        (('min_amount', 'max_amount'), models.ScheduleF.expenditure_amount),
        (('min_image_number', 'max_image_number'), models.ScheduleF.image_number),
Severity: Major
Found in webservices/resources/sched_f.py and 6 other locations - About 1 hr to fix
webservices/resources/costs.py on lines 43..46
webservices/resources/dates.py on lines 42..45
webservices/resources/sched_a.py on lines 45..48
webservices/resources/sched_a.py on lines 105..108
webservices/resources/sched_b.py on lines 45..48
webservices/resources/sched_e.py on lines 53..56

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

    @property
    def args(self):
        return {"no": fields.Str(required=True, description='Document number to fetch.'),
                "doc_type": fields.Str(required=True, description='Document type to fetch.')}
Severity: Major
Found in webservices/resources/legal.py and 1 other location - About 1 hr to fix
webservices/resources/legal.py on lines 31..34

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

    filter_range_fields = [
        (('min_date', 'max_date'), models.ScheduleE.expenditure_date),
        (('min_amount', 'max_amount'), models.ScheduleE.expenditure_amount),
        (('min_image_number', 'max_image_number'), models.ScheduleE.image_number),
Severity: Major
Found in webservices/resources/sched_e.py and 6 other locations - About 1 hr to fix
webservices/resources/costs.py on lines 43..46
webservices/resources/dates.py on lines 42..45
webservices/resources/sched_a.py on lines 45..48
webservices/resources/sched_a.py on lines 105..108
webservices/resources/sched_b.py on lines 45..48
webservices/resources/sched_f.py on lines 32..35

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

    filter_range_fields = [
        (('min_date', 'max_date'), models.ScheduleB.disbursement_date),
        (('min_amount', 'max_amount'), models.ScheduleB.disbursement_amount),
        (('min_image_number', 'max_image_number'), models.ScheduleB.image_number),
Severity: Major
Found in webservices/resources/sched_b.py and 6 other locations - About 1 hr to fix
webservices/resources/costs.py on lines 43..46
webservices/resources/dates.py on lines 42..45
webservices/resources/sched_a.py on lines 45..48
webservices/resources/sched_a.py on lines 105..108
webservices/resources/sched_e.py on lines 53..56
webservices/resources/sched_f.py on lines 32..35

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

    filter_range_fields = [
        (('min_due_date', 'max_due_date'), models.ReportDate.due_date),
        (('min_create_date', 'max_create_date'), models.ReportDate.create_date),
        (('min_update_date', 'max_update_date'), models.ReportDate.update_date),
Severity: Major
Found in webservices/resources/dates.py and 6 other locations - About 1 hr to fix
webservices/resources/costs.py on lines 43..46
webservices/resources/sched_a.py on lines 45..48
webservices/resources/sched_a.py on lines 105..108
webservices/resources/sched_b.py on lines 45..48
webservices/resources/sched_e.py on lines 53..56
webservices/resources/sched_f.py on lines 32..35

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

    filter_range_fields = [
        (('min_date', 'max_date'), models.ScheduleA.contribution_receipt_date),
        (('min_amount', 'max_amount'), models.ScheduleA.contribution_receipt_amount),
        (('min_image_number', 'max_image_number'), models.ScheduleA.image_number),
Severity: Major
Found in webservices/resources/sched_a.py and 6 other locations - About 1 hr to fix
webservices/resources/costs.py on lines 43..46
webservices/resources/dates.py on lines 42..45
webservices/resources/sched_a.py on lines 105..108
webservices/resources/sched_b.py on lines 45..48
webservices/resources/sched_e.py on lines 53..56
webservices/resources/sched_f.py on lines 32..35

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

    filter_range_fields = [
        (('min_date', 'max_date'), models.ScheduleAEfile.contribution_receipt_date),
        (('min_amount', 'max_amount'), models.ScheduleAEfile.contribution_receipt_amount),
        (('min_image_number', 'max_image_number'), models.ScheduleAEfile.image_number),
Severity: Major
Found in webservices/resources/sched_a.py and 6 other locations - About 1 hr to fix
webservices/resources/costs.py on lines 43..46
webservices/resources/dates.py on lines 42..45
webservices/resources/sched_a.py on lines 45..48
webservices/resources/sched_b.py on lines 45..48
webservices/resources/sched_e.py on lines 53..56
webservices/resources/sched_f.py on lines 32..35

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

    @property
    def args(self):
        return {"citation_type": fields.Str(required=True, description="Citation type (regulation or statute)"),
        "citation": fields.Str(required=True, description='Citation to search for.')}
Severity: Major
Found in webservices/resources/legal.py and 1 other location - About 1 hr to fix
webservices/resources/legal.py on lines 53..56

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

    filter_range_fields = [
        (('min_date', 'max_date'), models.CommunicationCost.transaction_date),
        (('min_amount', 'max_amount'), models.CommunicationCost.transaction_amount),
        (('min_image_number', 'max_image_number'), models.CommunicationCost.image_number),
Severity: Major
Found in webservices/resources/costs.py and 6 other locations - About 1 hr to fix
webservices/resources/dates.py on lines 42..45
webservices/resources/sched_a.py on lines 45..48
webservices/resources/sched_a.py on lines 105..108
webservices/resources/sched_b.py on lines 45..48
webservices/resources/sched_e.py on lines 53..56
webservices/resources/sched_f.py on lines 32..35

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

Function mouseEnter has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  mouseEnter: function(e) {
    var elem = $(this.el).find('.content');
    var x = e.pageX;
    var y = e.pageY;
    var scX = $(window).scrollLeft();
Severity: Minor
Found in swagger-ui/js/view/OperationView.js - About 1 hr to fix

    Function sort has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def sort(query, key, model, aliases=None, join_columns=None, clear=False,
    Severity: Major
    Found in webservices/sorting.py - About 1 hr to fix

      Function multi_sort has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def multi_sort(query, keys, model, aliases=None, join_columns=None, clear=False,
      Severity: Major
      Found in webservices/sorting.py - About 1 hr to fix

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

            filter_multi_fields = [
                ('image_number', models.ScheduleEEfile.image_number),
                ('committee_id', models.ScheduleEEfile.committee_id),
                ('candidate_id', models.ScheduleEEfile.candidate_id),
                ('support_oppose_indicator', models.ScheduleEEfile.support_oppose_indicator),
        Severity: Major
        Found in webservices/resources/sched_e.py and 5 other locations - About 1 hr to fix
        webservices/resources/costs.py on lines 37..41
        webservices/resources/costs.py on lines 79..83
        webservices/resources/sched_a.py on lines 97..101
        webservices/resources/sched_b.py on lines 87..91
        webservices/resources/sched_f.py on lines 25..29

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

            filter_multi_fields = [
                ('report_year', models.Electioneering.report_year),
                ('committee_id', models.Electioneering.committee_id),
                ('candidate_id', models.Electioneering.candidate_id),
                ('beginning_image_number', models.Electioneering.beginning_image_number),
        Severity: Major
        Found in webservices/resources/costs.py and 5 other locations - About 1 hr to fix
        webservices/resources/costs.py on lines 37..41
        webservices/resources/sched_a.py on lines 97..101
        webservices/resources/sched_b.py on lines 87..91
        webservices/resources/sched_e.py on lines 107..111
        webservices/resources/sched_f.py on lines 25..29

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

            filter_multi_fields = [
                ('image_number', models.ScheduleF.image_number),
                ('committee_id', models.ScheduleF.committee_id),
                ('candidate_id', models.ScheduleF.candidate_id),
                ('cycle', models.ScheduleF.election_cycle),
        Severity: Major
        Found in webservices/resources/sched_f.py and 5 other locations - About 1 hr to fix
        webservices/resources/costs.py on lines 37..41
        webservices/resources/costs.py on lines 79..83
        webservices/resources/sched_a.py on lines 97..101
        webservices/resources/sched_b.py on lines 87..91
        webservices/resources/sched_e.py on lines 107..111

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

            filter_multi_fields = [
                ('image_number', models.ScheduleBEfile.image_number),
                ('committee_id', models.ScheduleBEfile.committee_id),
                ('recipient_city', models.ScheduleBEfile.recipient_city),
                ('recipient_state', models.ScheduleBEfile.recipient_state),
        Severity: Major
        Found in webservices/resources/sched_b.py and 5 other locations - About 1 hr to fix
        webservices/resources/costs.py on lines 37..41
        webservices/resources/costs.py on lines 79..83
        webservices/resources/sched_a.py on lines 97..101
        webservices/resources/sched_e.py on lines 107..111
        webservices/resources/sched_f.py on lines 25..29

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

            filter_multi_fields = [
                ('image_number', models.ScheduleAEfile.image_number),
                ('committee_id', models.ScheduleAEfile.committee_id),
                ('contributor_city', models.ScheduleAEfile.contributor_city),
                ('contributor_state', models.ScheduleAEfile.contributor_state),
        Severity: Major
        Found in webservices/resources/sched_a.py and 5 other locations - About 1 hr to fix
        webservices/resources/costs.py on lines 37..41
        webservices/resources/costs.py on lines 79..83
        webservices/resources/sched_b.py on lines 87..91
        webservices/resources/sched_e.py on lines 107..111
        webservices/resources/sched_f.py on lines 25..29

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

            filter_multi_fields = [
                ('image_number', models.CommunicationCost.image_number),
                ('committee_id', models.CommunicationCost.committee_id),
                ('candidate_id', models.CommunicationCost.candidate_id),
                ('support_oppose_indicator', models.CommunicationCost.support_oppose_indicator),
        Severity: Major
        Found in webservices/resources/costs.py and 5 other locations - About 1 hr to fix
        webservices/resources/costs.py on lines 79..83
        webservices/resources/sched_a.py on lines 97..101
        webservices/resources/sched_b.py on lines 87..91
        webservices/resources/sched_e.py on lines 107..111
        webservices/resources/sched_f.py on lines 25..29

        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

        Severity
        Category
        Status
        Source
        Language