Total Lines | 17 |
Duplicated Lines | 100 % |
Changes | 4 | ||
Bugs | 0 | Features | 1 |
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 |
||
43 | View Code Duplication | class ExaminationDetails(models.Model): |
|
44 | |||
45 | """ |
||
46 | ExaminationDetails |
||
47 | """ |
||
48 | examination = models.ForeignKey(Examinations, on_delete=models.CASCADE) |
||
49 | title = models.CharField(max_length=255) |
||
50 | value = models.DecimalField(max_digits=15, decimal_places=5) |
||
51 | created = models.DateTimeField(auto_now_add=True) |
||
52 | modified = models.DateTimeField(auto_now=True) |
||
53 | |||
54 | class Meta: |
||
55 | verbose_name = 'Examination Details' |
||
56 | verbose_name_plural = 'Examination Details' |
||
57 | |||
58 | def __str__(self): |
||
59 | return "%s" % self.title |
||
60 |