Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added default nosec_lines
  • Loading branch information
omergunal authored Apr 26, 2018
commit 9c4dea6e511f76abca8feb396ecf1e6f2e1565fb
4 changes: 2 additions & 2 deletions pyt/vulnerabilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def append_node_if_reassigned(
def find_triggers(
nodes,
trigger_words,
nosec_lines
nosec_lines = set()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please do nosec_lines=set() instead of nosec_lines = set()? I thought find_vulnerabilities was the only function that needed this, but you're right since we do call find_triggers once from a test here

l = vulnerabilities.find_triggers(XSS1.nodes, trigger_words)
maybe since we just call it once from tests we can pass in the set in that test.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can see some of these in the https://codeclimate.com/github/python-security/pyt/pull/121 output.

):
"""Find triggers from the trigger_word_list in the nodes.

Expand Down Expand Up @@ -470,7 +470,7 @@ def find_vulnerabilities_in_cfg(
ui_mode,
blackbox_mapping,
vulnerabilities_list,
nosec_lines
nosec_lines = set()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this shouldn't be necessary, (to make it default to empty set), we can just leave it as nosec_lines. This is b/c we only call find_vulnerabilities from tests, not this function.

):
"""Find vulnerabilities in a cfg.

Expand Down