Login
paramsUsed rule
Login

The rule to check the parameters of routines. Checked things:

The syntax in a configuration file is:

[ruleType] ?not? params [checkType] [declarationType]

Disabling the rule

It is possible to disable the rule for a selected part of the checked code by using pragma ruleOff: "params" in the declaration from which the rule should be disabled. For example, if the rule should be disabled for procedure main(), the full declaration of it should be:

proc main() {.ruleOff: "params".}

To enable the rule again, the pragma ruleOn: "params" should be added in the element which should be checked. For example, if the rule should be re-enabled for function myFunc(a: int), the full declaration should be:

func myFunc(a: int) {.ruleOn: "params".}

Examples

  1. Check if all procedures in module uses their parameters:

    check params used procedures

  2. Search for all declarations which don't use their all parameters:

    search not params used all