-
Notifications
You must be signed in to change notification settings - Fork 534
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
Refactor: monitor to tidy & use more functions for readability and maintanability #852
Conversation
@@ -1,6 +1,5 @@ | |||
import * as _ from 'lodash'; | |||
import chalk from 'chalk'; | |||
import * as wrap from 'wrap-ansi'; |
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.
not used
@@ -9,7 +8,6 @@ import { | |||
GroupedVuln, | |||
AnnotatedIssue, | |||
DockerIssue, | |||
LegalInstruction, |
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.
not used
package: scannedProject.depTree, | ||
}), | ||
); | ||
perProjectResult = convertMultiPluginResultToSingle(inspectResult); |
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.
extracted code into a function
@@ -218,7 +201,7 @@ async function monitor(...args0: MethodArgs): Promise<any> { | |||
manageUrl, | |||
options, | |||
projectName, | |||
advertiseSubprojectsCount, | |||
foundProjectCount, |
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.
renamed
'"' + path + '" is not a valid path for "snyk monitor"', | ||
); | ||
} | ||
await validateMonitorPath(path, options.docker); |
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.
extracted code into a function
advertiseSubprojectsCount = | ||
inspectResult.plugin.meta.allSubProjectNames.length; | ||
} | ||
foundProjectCount = getSubProjectCount(inspectResult); |
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.
extracted code into a function
853f034
to
782d4a7
Compare
782d4a7
to
5dccb99
Compare
🎉 This PR is included in version 1.242.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
What does this PR do?
Refactor to use more functions for easier to read & understand code
Added more types