Skip to content
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

Merged
merged 5 commits into from
Nov 4, 2019

Conversation

lili2311
Copy link
Contributor

@lili2311 lili2311 commented Nov 1, 2019

  • Ready for review
  • Follows CONTRIBUTING rules
  • Reviewed by Snyk internal team

What does this PR do?

Refactor to use more functions for easier to read & understand code
Added more types

@lili2311 lili2311 requested a review from a team as a code owner November 1, 2019 14:20
@lili2311 lili2311 self-assigned this Nov 1, 2019
@ghost ghost requested review from dkontorovskyy and gitphill November 1, 2019 14:20
@lili2311 lili2311 changed the title Refactor/monitor Refactor: monitor to tidy & use more functions for readability and maintanability Nov 1, 2019
@@ -1,6 +1,5 @@
import * as _ from 'lodash';
import chalk from 'chalk';
import * as wrap from 'wrap-ansi';
Copy link
Contributor Author

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,
Copy link
Contributor Author

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);
Copy link
Contributor Author

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,
Copy link
Contributor Author

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);
Copy link
Contributor Author

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);
Copy link
Contributor Author

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

@lili2311 lili2311 merged commit 131bd2a into master Nov 4, 2019
@lili2311 lili2311 deleted the refactor/monitor branch November 4, 2019 12:48
@snyksec
Copy link

snyksec commented Nov 4, 2019

🎉 This PR is included in version 1.242.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants