| Conditions | 7 |
| Total Lines | 19 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 14 |
| CRAP Score | 7 |
| Changes | 0 | ||
| 1 | 1 | import yorm |
|
| 44 | 1 | def _skip_cache(self, kwargs): |
|
| 45 | if self.disabled: |
||
| 46 | 1 | log.debug("Caching disabled") |
|
| 47 | return True |
||
| 48 | 1 | ||
| 49 | 1 | if kwargs in self.items: |
|
| 50 | 1 | log.debug("Already cached: %s", kwargs) |
|
| 51 | 1 | return True |
|
| 52 | |||
| 53 | 1 | if self.filtered: |
|
| 54 | 1 | ||
| 55 | 1 | if kwargs['key'] == 'custom' or kwargs.get('alt'): |
|
| 56 | log.debug("Skipped caching of custom background: %s", kwargs) |
||
| 57 | 1 | return True |
|
| 58 | if profanityfilter.is_profane(kwargs['path']): |
||
| 59 | 1 | log.debug("Skipped caching of profane content: %s", kwargs) |
|
| 60 | 1 | return True |
|
| 61 | 1 | ||
| 62 | return False |
||
| 63 |