Passed
Push — master ( fb2dae...e99931 )
by -
01:28
created

download()   A

Complexity

Conditions 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1
Metric Value
cc 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1 1
from flask import Blueprint, redirect, Response, current_app, send_from_directory
1 ignored issue
show
Configuration introduced by
The import flask could not be resolved.

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.

# .scrutinizer.yml
before_commands:
    - sudo pip install abc # Python2
    - sudo pip3 install abc # Python3
Tip: We are currently not using virtualenv to run pylint, when installing your modules make sure to use the command for the correct version.

2. Missing __init__.py files

This error could also result from missing __init__.py files in your module folders. Make sure that you place one file in each sub-folder.

Loading history...
2
3 1
default = Blueprint('default', __name__)
0 ignored issues
show
Coding Style Naming introduced by
The name default does not conform to the constant naming conventions ((([A-Z_][A-Z0-9_]*)|(__.*__))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
4
5
6 1
@default.route("/")
7
def index():
8 1
    return redirect("/rules")
9
10
11 1
@default.route("/download")
12
def download():
13 1
    return send_from_directory(directory=current_app.root_path, filename='rules.db', as_attachment=True)
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (104/90).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
14
15
16 1
@default.route("/robots.txt")
17
def robots():
18
    return Response('User-agent: *\n Disallow: /', mimetype='text/plain')
19