Total Complexity | 0 |
Total Lines | 28 |
Duplicated Lines | 64.29 % |
Changes | 0 |
Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
1 | # -*- coding: utf-8 -*- |
||
2 | # Generated by Django 1.11.20 on 2019-06-13 08:44 |
||
3 | from __future__ import unicode_literals |
||
4 | |||
5 | import django.contrib.postgres.fields |
||
6 | from django.db import migrations, models |
||
7 | import django.db.models.deletion |
||
8 | |||
9 | |||
10 | View Code Duplication | class Migration(migrations.Migration): |
|
1 ignored issue
–
show
|
|||
11 | |||
12 | dependencies = [ |
||
13 | ('image_app', '0020_auto_20190527_1729'), |
||
14 | ] |
||
15 | |||
16 | operations = [ |
||
17 | migrations.CreateModel( |
||
18 | name='ValidationSummary', |
||
19 | fields=[ |
||
20 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
||
21 | ('pass_count', models.PositiveIntegerField(default=0)), |
||
22 | ('warning_count', models.PositiveIntegerField(default=0)), |
||
23 | ('error_count', models.PositiveIntegerField(default=0)), |
||
24 | ('json_count', models.PositiveIntegerField(default=0)), |
||
25 | ('type', models.CharField(blank=True, max_length=6, null=True)), |
||
26 | ('messages', django.contrib.postgres.fields.ArrayField(base_field=models.TextField(blank=True, max_length=255), default=list, size=None)), |
||
27 | ('submission', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='image_app.Submission')), |
||
28 | ], |
||
31 |