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

Update xProcess resource to fix PSSA and style Issues #206

Merged
merged 3 commits into from
Sep 6, 2016

Conversation

Dan1el42
Copy link
Contributor

Hello everyone,

Another PR to fix #132 PSSA and style issues. Please review at your earliest convenience.

Thanks very much,
Daniel

@Dan1el42
Copy link
Contributor Author

Script Analyzer:

  • Before
    image
  • After
    image

@Dan1el42 Dan1el42 changed the title Update MSFT_xProcessResource to fix PSSA and style Issues Update xProcess resource to fix PSSA and style Issues Aug 28, 2016
@kwirkykat kwirkykat added the needs review The pull request needs a code review. label Aug 29, 2016
@Dan1el42 Dan1el42 force-pushed the issue-132 branch 2 times, most recently from a083836 to a0e33a3 Compare September 4, 2016 04:46
@kwirkykat
Copy link
Contributor

Reviewed 1 of 2 files at r1.
Review status: 0 of 2 files reviewed at latest revision, 13 unresolved discussions.


DSCResources/MSFT_xProcessResource/MSFT_xProcessResource.psm1, line 140 [r1] (raw file):

If this the
If this is the


DSCResources/MSFT_xProcessResource/MSFT_xProcessResource.psm1, line 224 [r1] (raw file):

If this the
If this is the


DSCResources/MSFT_xProcessResource/MSFT_xProcessResource.psm1, line 296 [r1] (raw file):

    if ($null -ne $PsDscContext.RunAsUser)
    {
        $params = @{

$params should have a more descriptive name. (ex: $exceptionParams, $invalidArgParams, $newInvalidArgumentExceptionParams)


DSCResources/MSFT_xProcessResource/MSFT_xProcessResource.psm1, line 320 [r1] (raw file):

    if ($Ensure -eq 'Absent')
    {
        $params = @{

$params should have a more descriptive name. (ex: $assertHashtableParams, $assertArgsParams)


DSCResources/MSFT_xProcessResource/MSFT_xProcessResource.psm1, line 373 [r1] (raw file):

            if (-not [String]::IsNullOrEmpty($PSBoundParameters[$shouldBeRootedPathArgument]))
            {
                $params = @{

$params needs a more descriptive name


DSCResources/MSFT_xProcessResource/MSFT_xProcessResource.psm1, line 387 [r1] (raw file):

            if (-not [String]::IsNullOrEmpty($PSBoundParameters[$shouldExistPathArgument]))
            {
                $params = @{

$params needs a more descriptive name


DSCResources/MSFT_xProcessResource/MSFT_xProcessResource.psm1, line 412 [r1] (raw file):

            {
                $parameterKey = $startProcessOptionalArgumentMap[$startProcessOptionalArgumentName]
                $value = $PSBoundParameters[$parameterKey]

$value needs a more descriptive name (ex: $parameterValue, $startProcessArugmentValue, etc...)


DSCResources/MSFT_xProcessResource/MSFT_xProcessResource.psm1, line 440 [r1] (raw file):

                    foreach ($key in @('StandardOutputPath','StandardInputPath','WorkingDirectory'))
                    {
                        $params = {

$params needs a more descriptive name


DSCResources/MSFT_xProcessResource/MSFT_xProcessResource.psm1, line 507 [r1] (raw file):

If this the
If this is the


DSCResources/MSFT_xProcessResource/MSFT_xProcessResource.psm1, line 521 [r1] (raw file):

Set this property to "Present" to ensure that the process
exists. Otherwise, set it to "Absent".

Set this property to "Present" to return true if the process exisits.
Otherwise, set it to "Absent" to return true if the process does not exist.

Test-TargetResource will not change the state of the process.


DSCResources/MSFT_xProcessResource/MSFT_xProcessResource.psm1, line 524 [r1] (raw file):

        exists. Otherwise, set it to "Absent". The default is "Present".

    .PARAMETER StandardOutputPath

Only the Path, Arguments, Credential, and Ensure parameters are actually used for this function.
Can you please change the descriptions of the other parameters accordingly?


DSCResources/MSFT_xProcessResource/MSFT_xProcessResource.psm1, line 580 [r1] (raw file):

    if ($null -ne $PsDscContext.RunAsUser)
    {
        $params = @{

$params needs a more descriptive name


DSCResources/MSFT_xProcessResource/MSFT_xProcessResource.psm1, line 748 [r1] (raw file):

            {
                Write-Verbose -Message ($LocalizedData.VerboseInProcessHandle -f $process.Id)
                $params = @{

$params needs a more descriptive name


Comments from Reviewable

@kwirkykat kwirkykat added waiting for author response The pull request is waiting for the author to respond to comments in the pull request. and removed needs review The pull request needs a code review. labels Sep 4, 2016
@Dan1el42
Copy link
Contributor Author

Dan1el42 commented Sep 5, 2016

@kwirkykat , thanks so much for your thorough review on a Sunday 👍 . I've pushed a new commit to my branch which should fix everything you've highlighted with your comments.

@kwirkykat kwirkykat added needs review The pull request needs a code review. and removed waiting for author response The pull request is waiting for the author to respond to comments in the pull request. labels Sep 6, 2016
@kwirkykat
Copy link
Contributor

:lgtm:


Reviewed 2 of 2 files at r2.
Review status: all files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

@kwirkykat kwirkykat merged commit aaab83b into dsccommunity:dev Sep 6, 2016
@kwirkykat kwirkykat removed the needs review The pull request needs a code review. label Sep 6, 2016
@Dan1el42 Dan1el42 deleted the issue-132 branch September 17, 2016 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MSFT_xProcessResource: Fix PSSA Issues
3 participants