Test Setup Failed
Push — master ( 9fdcd8...5b10e8 )
by -
01:16
created

get_latest_sid()   A

Complexity

Conditions 2

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 2
dl 0
loc 6
rs 9.4285
1
from flask.ext.sqlalchemy import SQLAlchemy
2
3
db = SQLAlchemy()
4
5
from naxsi_rules import NaxsiRules, NaxsiRuleSets
6
7
8
def check_constraint(ctype, value):
9
    if ctype == "ruleset":
10
        cres = NaxsiRuleSets.query.filter(NaxsiRuleSets.file == value).first()
11
    else:
12
        cres = 1
13
14
    if not cres:
15
        return 0
16
    return cres
0 ignored issues
show
Coding Style introduced by
Final newline missing
Loading history...