Total Lines | 25 |
Duplicated Lines | 96 % |
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 |
||
7 | class Pelican(Services): |
||
8 | |||
9 | """ |
||
10 | pelican model |
||
11 | """ |
||
12 | title = models.CharField(max_length=80) |
||
13 | url = models.URLField() |
||
14 | tags = models.CharField(max_length=200, blank=True) |
||
15 | category = models.CharField(max_length=200, blank=True) |
||
16 | path = models.CharField(max_length=255) |
||
17 | trigger = models.ForeignKey(TriggerService) |
||
18 | |||
19 | class Meta: |
||
20 | app_label = 'th_pelican' |
||
21 | db_table = 'django_th_pelican' |
||
22 | |||
23 | def show(self): |
||
24 | """ |
||
25 | |||
26 | :return: string representing object |
||
27 | """ |
||
28 | return "My Pelican %s" % self.name |
||
29 | |||
30 | def __str__(self): |
||
31 | return '%s' % self.name |
||
32 |