diff --git a/app/templates/report.html b/app/templates/report.html index 894a98ac..cbda50d0 100644 --- a/app/templates/report.html +++ b/app/templates/report.html @@ -133,8 +133,12 @@

{{ vulnerability.vul_type }}

{{ each_vul.level }} {{ each_vul.rule }} - {{ each_vul.file }}:{{ each_vul.line }} -
{{ each_vul.code }}
+ {% if each_vul.line == 0 %} + {{ each_vul.file }} + {% else %} + {{ each_vul.file }}:{{ each_vul.line }} +
{{ each_vul.code }}
+ {% endif %} {{ each_vul.repair }} diff --git a/engine/static.py b/engine/static.py index 5b5763b7..104c3788 100644 --- a/engine/static.py +++ b/engine/static.py @@ -197,6 +197,7 @@ def analyse(self, directory=None, task_id=None, project_id=None): # 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() + m_line = 0 else: r_content = CobraResults.query.filter_by(task_id=task_id, rule_id=rule_id, file=m_file,