-
Notifications
You must be signed in to change notification settings - Fork 0
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
Distributed scan report #63
Conversation
throw new FileNotFoundException("Temp file not found"); | ||
} | ||
|
||
this.htmlReport = status[1]; |
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.
add check status is having size 2 else return No output generated.
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.
Line 46 in ac528bd
String[] ret = {this.processExitValue, this.htmlReport}; |
In the GenerateReport
FileCallable, I am explicitly making an array of size 2. Is the size 2 check necessary then? I can check for null value.
@@ -12,6 +12,10 @@ | |||
import hudson.util.Secret; | |||
import io.jenkins.plugins.traceable.ast.scan.helper.Assets; | |||
import io.jenkins.plugins.traceable.ast.scan.helper.TrafficType; | |||
import java.io.*; |
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.
can we import specific package
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.
Done.
throw new FileNotFoundException("Temp file not found"); | ||
} | ||
|
||
this.htmlReport = status[1]; |
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.
put in else.
if (reportCmdExitValue == 4) { | ||
String[] status = this.workspace.act(new GenerateReport(scriptPath, args, run.getId())); | ||
|
||
if (status[0].equals("FAILURE")) { |
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.
check if status is having size >0
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.
Line 46 in ac528bd
String[] ret = {this.processExitValue, this.htmlReport}; |
Same as before, we are explicitly declaring an array of size 2. Also the value of processExitValue
is SUCCESS
by default. So it will never be null. It will either be SUCCESS
or FAILURE
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.
yes, it's always better to put the check if we are not having unit tests.
Summary:
GenerateScanReportAction
.<pre>
tag to maintain the formatting of the text.