memegen.routes.api_fonts   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 20
rs 10
c 0
b 0
f 0
ccs 7
cts 7
cp 1
wmc 2

2 Functions

Rating   Name   Duplication   Size   Complexity  
A create_font() 0 3 1
A get() 0 5 1
1 1
from flask import Blueprint, current_app
0 ignored issues
show
introduced by
Unable to import 'flask'
Loading history...
2 1
from flask_api import exceptions
0 ignored issues
show
introduced by
Unable to import 'flask_api'
Loading history...
3
4
from ..extensions import cache
5 1
6
7
blueprint = Blueprint('fonts', __name__, url_prefix="/api/fonts/")
8 1
9
10
@blueprint.route("")
11 1
@cache.cached()
12
def get():
13
    """Get a list of all available fonts."""
14 1
    return sorted(current_app.font_service.all())
15
16 1
17
@blueprint.route("", methods=['POST'])
18
def create_font():
19
    raise exceptions.PermissionDenied(current_app.config['CONTRIBUTING_URL'])
20