Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

Commit

Permalink
improves rules
Browse files Browse the repository at this point in the history
  • Loading branch information
zhijie committed Jun 8, 2016
1 parent eca388d commit 4a9d6d1
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions engine/static.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,14 @@ def analyse(self, directory=None, task_id=None, project_id=None):
print("In Annotation")
else:
print('In Insert')
r_content = CobraResults.query.filter_by(task_id=task_id, rule_id=rule_id,
file=m_file,
line=m_line).first()
if rule.regex == "":
# Didn't filter line when regex is empty
r_content = CobraResults.query.filter_by(task_id=task_id, rule_id=rule_id,
file=m_file).first()
else:
r_content = CobraResults.query.filter_by(task_id=task_id, rule_id=rule_id,
file=m_file,
line=m_line).first()
if r_content is not None:
print("Exists Result")
else:
Expand Down

0 comments on commit 4a9d6d1

Please sign in to comment.