memegen.routes.api_legacy   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Test Coverage

Coverage 84.62%

Importance

Changes 0
Metric Value
eloc 18
dl 0
loc 29
rs 10
c 0
b 0
f 0
ccs 11
cts 13
cp 0.8462
wmc 4

4 Functions

Rating   Name   Duplication   Size   Complexity  
A legacy_templates_index() 0 3 1
A legacy_links_detail() 0 3 1
A legacy_links_detail_encoded() 0 4 1
A legacy_templates_detail() 0 4 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