| Total Complexity | 4 | 
| Total Lines | 69 | 
| Duplicated Lines | 81.16 % | 
| Coverage | 93.33% | 
| 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 | """  | 
            ||
| 2 | ETLT  | 
            ||
| 3 | |||
| 4 | Copyright 2016 Set Based IT Consultancy  | 
            ||
| 5 | |||
| 6 | Licence MIT  | 
            ||
| 7 | """  | 
            ||
| 8 | 1 | import abc  | 
            |
| 9 | |||
| 10 | 1 | from etlt.condition.Condition import Condition  | 
            |
| 11 | |||
| 12 | |||
| 13 | 1 | View Code Duplication | class SimpleCondition(Condition):  | 
            
| 
                                                                                                    
                        
                         | 
                |||
| 14 | """  | 
            ||
| 15 | A simple condition matches a single field in the row against an expression.  | 
            ||
| 16 | """  | 
            ||
| 17 | |||
| 18 | # ------------------------------------------------------------------------------------------------------------------  | 
            ||
| 19 | 1 | def __init__(self, field, expression):  | 
            |
| 20 | """  | 
            ||
| 21 | Object contructor.  | 
            ||
| 22 | |||
| 23 | :param str field: The name of the field in the row that must be match against the expression.  | 
            ||
| 24 | :param str expression: The expression.  | 
            ||
| 25 | """  | 
            ||
| 26 | 1 | self._field = field  | 
            |
| 27 | """  | 
            ||
| 28 | The name of the field in the row that must be match against the expression.  | 
            ||
| 29 | |||
| 30 | :type: str  | 
            ||
| 31 | """  | 
            ||
| 32 | |||
| 33 | 1 | self._expression = expression  | 
            |
| 34 | 1 | """  | 
            |
| 35 | The expression.  | 
            ||
| 36 | |||
| 37 | :type: str  | 
            ||
| 38 | """  | 
            ||
| 39 | |||
| 40 | # ------------------------------------------------------------------------------------------------------------------  | 
            ||
| 41 | 1 | @property  | 
            |
| 42 | 1 | def expression(self):  | 
            |
| 43 | """  | 
            ||
| 44 | Returns the expression.  | 
            ||
| 45 | |||
| 46 | :rtype: str  | 
            ||
| 47 | """  | 
            ||
| 48 | 1 | return self._expression  | 
            |
| 49 | |||
| 50 | # ------------------------------------------------------------------------------------------------------------------  | 
            ||
| 51 | 1 | @property  | 
            |
| 52 | 1 | def field(self):  | 
            |
| 53 | """  | 
            ||
| 54 | Returns the name of the field in the row that must be match against the expression.  | 
            ||
| 55 | |||
| 56 | :rtype: str  | 
            ||
| 57 | """  | 
            ||
| 58 | return self._field  | 
            ||
| 59 | |||
| 60 | # ------------------------------------------------------------------------------------------------------------------  | 
            ||
| 61 | 1 | @abc.abstractproperty  | 
            |
| 62 | 1 | def scheme(self):  | 
            |
| 63 | """  | 
            ||
| 64 | Returns the scheme of the simple condition.  | 
            ||
| 65 | |||
| 66 | :rtype: str  | 
            ||
| 67 | """  | 
            ||
| 68 | raise NotImplementedError()  | 
            ||
| 69 | |||
| 71 |