-
Notifications
You must be signed in to change notification settings - Fork 1.8k
update AddDBotScoreToContext script #40864
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Coverage Report
|
|
Validate summary Verdict: PR can be force merged from validate perspective? ✅ |
|
||
command_results=CommandResults(outputs_prefix = "DBotScore" , outputs = dbotscore) | ||
sleep(10000000) | ||
return_results( command_results ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use of sleep
is not permitted in XSOAR scripts. Please remove the sleep(10000000)
call on this line and the corresponding import from time import sleep
on line 1.
SCORE = int( demisto.args().get("score") ) | ||
vendor=demisto.args().get( "vendor") | ||
Reliability=demisto.args().get("reliability",None) | ||
LOG( "Got all arguments" ) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The LOG()
function is deprecated and should not be used. Please replace it with a standard logging function like demisto.debug()
.
indicator=demisto.args().get("indicator") | ||
indicatorType=demisto.args().get("indicatorType") | ||
SCORE = int( demisto.args().get("score") ) | ||
vendor=demisto.args().get( "vendor") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable names should follow PEP 8 conventions (snake_case). Please rename SCORE
to score
and Reliability
(on line 12) to reliability
for consistency.
vendor = demisto.args().get("vendor") | ||
reliability = demisto.args().get("reliability", None) | ||
indicator=demisto.args().get("indicator") | ||
indicatorType=demisto.args().get("indicatorType") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code exhibits inconsistent spacing around operators and in function calls, which harms readability. Please apply consistent formatting (e.g., indicator = demisto.args().get('indicator')
).
vendor = demisto.args().get("vendor") | ||
reliability = demisto.args().get("reliability", None) | ||
indicator=demisto.args().get("indicator") | ||
indicatorType=demisto.args().get("indicatorType") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This block of code has multiple PEP 8 spacing violations. Please run a linter or auto-formatter to correct them.
indicator=demisto.args().get("indicator") | ||
indicatorType=demisto.args().get("indicatorType") | ||
SCORE = int( demisto.args().get("score") ) | ||
vendor=demisto.args().get( "vendor") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please adhere to PEP 8 naming conventions by using snake_case
for variables.
SCORE = int( demisto.args().get("score") ) | ||
vendor=demisto.args().get( "vendor") | ||
Reliability=demisto.args().get("reliability",None) | ||
LOG( "Got all arguments" ) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the extra spacing inside the function call. Also, consider if this generic log message is necessary for the final script.
|
||
command_results=CommandResults(outputs_prefix = "DBotScore" , outputs = dbotscore) | ||
sleep(10000000) | ||
return_results( command_results ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sleep
call will cause the script to hang for over 100 days and must be removed.
@@ -11,6 +8,9 @@ args: | |||
- description: The vendor to assign to this DBotScoreEntry | |||
name: vendor | |||
required: true | |||
- description: The vendor nick name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This new argument has a structural issue and does not follow naming conventions. Please correct the indentation and rename the argument to use snake_case.
removed indicator argument in AddDBotScoreToContext script.
Status