Total Lines | 20 |
Duplicated Lines | 100 % |
Changes | 1 | ||
Bugs | 0 | Features | 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 |
||
6 | View Code Duplication | class Pushbullet(Services): |
|
|
|||
7 | |||
8 | """ |
||
9 | todoist model to be adapted for the new service |
||
10 | """ |
||
11 | type = models.CharField(max_length=4, default='note') |
||
12 | device = models.CharField(max_length=80, blank=True) |
||
13 | email = models.EmailField(max_length=255, blank=True) |
||
14 | channel_tag = models.CharField(max_length=80, blank=True) |
||
15 | trigger = models.ForeignKey('TriggerService') |
||
16 | |||
17 | class Meta: |
||
18 | app_label = 'django_th' |
||
19 | db_table = 'django_th_pushbullet' |
||
20 | |||
21 | def __str__(self): |
||
22 | return self.name |
||
23 | |||
24 | def show(self): |
||
25 | return "My Pushbullet %s" % self.name |
||
26 |