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

implement PSScriptAnalyzer suggestions, add PSCodeCode health report to GitHub #45

Open
iricigor opened this issue Jun 4, 2018 · 0 comments
Labels
documentation No code update needed, just examples or md files
Milestone

Comments

@iricigor
Copy link
Owner

iricigor commented Jun 4, 2018

In total there are about 40 warnings, and more than half should be easy to remove.

Invoke-ScriptAnalyzer -path . -Recurse  | group message | Select Count, Name | Sort Count -Descending
Count Name
----- ----
   10 '%' is an alias of 'ForEach-Object'. Alias can introduce possible problems and make scripts hard to maintain. Please consider changing alias to its full content.
    8 'cd' is an alias of 'Set-Location'. Alias can introduce possible problems and make scripts hard to maintain. Please consider changing alias to its full content.
    7 File 'EasyAzureFunction.psm1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or ...
    6 'Select' is an alias of 'Select-Object'. Alias can introduce possible problems and make scripts hard to maintain. Please consider changing alias to its full content.
    4 '?' is an alias of 'Where-Object'. Alias can introduce possible problems and make scripts hard to maintain. Please consider changing alias to its full content.
    1 Function 'New-AzureFunctionCode' has verb that could change system state. Therefore, the function has to support 'ShouldProcess'.
    1 File 'EasyAzureFunction.Module.Tests.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-...
    1 Do not use wildcard or $null in this field. Explicitly specify a list for AliasesToExport.
    1 Invoke-Expression is used. Please remove Invoke-Expression from script and find other options instead.
    1 Do not use wildcard or $null in this field. Explicitly specify a list for FunctionsToExport.
Invoke-ScriptAnalyzer -path . -Recurse  | group scriptname | Select Count, Name | Sort Count -Descending
Count Name
----- ----
   16 run.ps1
    7 EasyAzureFunction.psm1
    3 Convert-ParametersToHTML.ps1
    3 Get-Parameter.ps1
    2 New-AzureFunctionCode.Tests.ps1
    2 Get-Parameter.Tests.ps1
    2 EasyAzureFunction.psd1
    2 Convert-ParametersToRunner.ps1
    1 EasyAzureFunction.Module.Tests.ps1
    1 CreateExamples.ps1
    1 New-AzureFunctionCode.ps1
@iricigor iricigor added this to the 1.0 milestone Jun 4, 2018
@iricigor iricigor added the documentation No code update needed, just examples or md files label Jun 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation No code update needed, just examples or md files
Projects
None yet
Development

No branches or pull requests

1 participant