| Total Complexity | 1 |
| Total Lines | 14 |
| Duplicated Lines | 100 % |
| Coverage | 100% |
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 | 1 | from spike.model import db |
|
| 4 | 1 | View Code Duplication | class NaxsiWhitelistSets(db.Model): |
|
|
|||
| 5 | 1 | __bind_key__ = 'rules' |
|
| 6 | 1 | __tablename__ = 'naxsi_whitelistsets' |
|
| 7 | |||
| 8 | 1 | id = db.Column(db.Integer, primary_key=True) |
|
| 9 | 1 | name = db.Column(db.String(1024), nullable=False, unique=True) |
|
| 10 | 1 | remarks = db.Column(db.Text, nullable=False) |
|
| 11 | 1 | timestamp = db.Column(db.Integer, nullable=False) |
|
| 12 | 1 | db.UniqueConstraint('name') |
|
| 13 | |||
| 14 | 1 | def __init__(self, name, remarks, timestamp): |
|
| 15 | 1 | self.name = name |
|
| 16 | 1 | self.remarks = remarks |
|
| 17 | self.timestamp = timestamp |
||
| 18 |