mangroveorg/datawinners

View on GitHub
datawinners/custom_reports/crs/migrations/0006_auto__add_field_waybillsent_q10.py

Summary

Maintainability
C
1 day
Test Coverage

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

        'crs.waybillsent': {
            'Meta': {'object_name': 'WayBillSent'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'q1': ('django.db.models.fields.TextField', [], {'db_column': "'pl_code'"}),
            'q10': ('django.db.models.fields.TextField', [], {'db_column': "'receiver_code'"}),
datawinners/custom_reports/crs/migrations/0007_auto__add_field_waybillreceived_q9.py on lines 83..95
datawinners/custom_reports/crs/migrations/0008_auto__del_field_distribution_q10__del_field_distribution_q12__del_fiel.py on lines 97..109
datawinners/custom_reports/crs/migrations/0009_auto__add_billoflading.py on lines 98..110
datawinners/custom_reports/crs/migrations/0010_auto__add_breakbulksent.py on lines 104..116
datawinners/custom_reports/crs/migrations/0011_auto__add_waybillreceivedport.py on lines 112..124
datawinners/custom_reports/crs/migrations/0012_auto__add_containersent.py on lines 118..130
datawinners/custom_reports/crs/migrations/0013_auto__add_field_waybillreceivedport_q5.py on lines 113..125
datawinners/custom_reports/crs/migrations/0014_auto__add_bav.py on lines 134..146
datawinners/custom_reports/crs/migrations/0015_auto__add_numberofrecipientserved.py on lines 143..155
datawinners/custom_reports/crs/migrations/0016_auto__add_distributionatcps.py on lines 153..165

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

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 forwards(self, orm):
        
        # Adding field 'WayBillSent.q10'
        db.add_column('crs_waybillsent', 'q10', self.gf('django.db.models.fields.TextField')(default='', db_column='receiver_code'), keep_default=False)
datawinners/custom_reports/crs/migrations/0018_auto__add_field_breakbulksent_q5.py on lines 9..12
datawinners/custom_reports/crs/migrations/0022_auto__add_field_waybillreceivedport_q6.py on lines 9..12

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

There are no issues that match your filters.

Category
Status