Completed
Branch master (db5e7a)
by Osma
09:07 queued 05:09
created

DummyBackend.analyze()   A

Complexity

Conditions 1

Size

Total Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
dl 0
loc 2
rs 10
1
"""Dummy backend for testing basic interaction of projects and backends"""
2
3
4
from annif.hit import AnalysisHit
5
from . import backend
6
7
8
class DummyBackend(backend.AnnifBackend):
1 ignored issue
show
Coding Style introduced by
This class should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
Unused Code introduced by
The variable __class__ seems to be unused.
Loading history...
9
    name = "dummy"
10
11
    def _analyze(self, text, params):
12
        score = float(params.get('score', 1.0))
13
        return [AnalysisHit('http://example.org/dummy', 'dummy', score)]
14