Skip to content

Commit

Permalink
Small tweaks to CustomizeComplianceRules doc page
Browse files Browse the repository at this point in the history
  • Loading branch information
MathieuBuisson committed Jul 19, 2017
1 parent e1e52dd commit 59539b7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docs/HowDoI/CustomizeComplianceRules.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ NestingDepthHighest OverallMetrics 8 16

The default compliance rules built into **PSCodeHealth** are stored in the file **PSCodeHealthSettings.json** in the module root. To customize the thresholds for some metrics, it is strongly **NOT** recommended to modify this file, but to create a new JSON file containing the rules you need to override.

For example, you may have a specific project which require `Switch` statements containing large numbers of clauses.
This has a high impact on the **Complexity** metric, even though in this specific case, the code is still readable and fairly easy to maintain. In other words, the **Complexity** metric (based on Cyclomatic Complexity) doesn't properly reflect complexity for your particular project.
For example, you may have a specific project which requires `Switch` statements containing large numbers of clauses.
This has a high impact on the **Complexity** metric, even though in this particular case the code is still fairly easy to read and maintain.
In other words, the **Complexity** metric (based on Cyclomatic Complexity) doesn't properly reflect the complexity of your particular project.
So you decide to increase all the complexity-related thresholds by 10.

To view the default compliance rules for all complexity-related metrics, run the following command :
Expand Down Expand Up @@ -140,7 +141,7 @@ ComplexityHighest OverallMetrics 40 70
```

## checking if your code meets your customized compliance rules
## Checking if your code meets your customized compliance rules

Now, that you have compliance rules matching the metrics goals for your particular project/needs, you can use **PSCodeHealth** to verify how your PowerShell code is doing against these goals, like so :

Expand Down

0 comments on commit 59539b7

Please sign in to comment.