| Conditions | 4 |
| Total Lines | 23 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 1 |
| CRAP Score | 17.1835 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | 1 | from collections import OrderedDict |
|
| 18 | 1 | def _get_matches(query): |
|
| 19 | items = [] |
||
| 20 | |||
| 21 | for template in app.template_service.all(): |
||
| 22 | count = template.search(query) |
||
| 23 | |||
| 24 | if not count: |
||
| 25 | continue |
||
| 26 | |||
| 27 | data = OrderedDict() |
||
| 28 | data['count'] = count |
||
| 29 | data['template'] = OrderedDict() |
||
| 30 | data['template']['name'] = template.name |
||
| 31 | data['template']['description'] = template.link |
||
| 32 | data['template']['keywords'] = sorted(template.keywords) |
||
| 33 | data['template']['blank'] = route('image.get', key=template.key, |
||
| 34 | path='_', _external=True) |
||
| 35 | data['template']['example'] = route('image.get', key=template.key, |
||
| 36 | path=template.sample_path, |
||
| 37 | _external=True) |
||
| 38 | items.append(data) |
||
| 39 | |||
| 40 | return sorted(items, key=lambda item: item['count'], reverse=True) |
||
| 41 |
This can be caused by one of the following:
1. Missing Dependencies
This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.
2. Missing __init__.py files
This error could also result from missing
__init__.pyfiles in your module folders. Make sure that you place one file in each sub-folder.