memegen.routes.api_legacy.legacy_templates_index()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 3
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
ccs 2
cts 2
cp 1
crap 1
1 1
from flask import Blueprint, current_app as app, redirect
0 ignored issues
show
introduced by
Unable to import 'flask'
Loading history...
2
3 1
from ._utils import route
4
5
6 1
blueprint = Blueprint('legacy', __name__)
7
8
9 1
@blueprint.route("/templates/")
10
def legacy_templates_index():
11 1
    return redirect(route('templates.get'))
12
13
14 1
@blueprint.route("/<key>")
15
def legacy_templates_detail(key):
16
    template = app.template_service.find(key)
17
    return redirect(route('templates.create', key=template.key))
18
19
20 1
@blueprint.route("/<key>/<path:path>")
21
def legacy_links_detail(**kwargs):
22 1
    return redirect(route('links.get', **kwargs))
23
24
25 1
@blueprint.route("/_<code>")
26
def legacy_links_detail_encoded(code):
27 1
    key, path = app.link_service.decode(code)
28
    return redirect(route('links.get', key=key, path=path))
29