| Total Complexity | 6 |
| Total Lines | 14 |
| Duplicated Lines | 0 % |
| 1 | import math |
||
| 4 | class PrimeChecker(object): |
||
| 5 | |||
| 6 | def __init__(self, config=None): |
||
| 7 | pass |
||
| 8 | |||
| 9 | def run(self, value=0): |
||
| 10 | if math.floor(value) != value: |
||
| 11 | raise ValueError('%s should be an integer.' % value) |
||
| 12 | if value < 2: |
||
| 13 | return False |
||
| 14 | for test in range(2, int(math.floor(math.sqrt(value)))+1): |
||
| 15 | if value % test == 0: |
||
| 16 | return False |
||
| 17 | return True |
||
| 18 | |||
| 23 |