Measures the code complexity.
Measure-FunctionComplexity [-FunctionDefinition] <FunctionDefinitionAst> [<CommonParameters>]
Measures the code complexity, in the specified function definition. This complexity is measured according to the Cyclomatic complexity. Cyclomatic complexity counts the number of possible paths through a given section of code. The number of possible paths depends on the number of conditional logic constructs, because conditional logic constructs are where the flow of execution branches out to one or more different path(s).
Measure-FunctionComplexity -FunctionDefinition $MyFunctionAst
Gets the number of additional code paths due to While statements in the specified function definition.
To specify the function definition to analyze.
Type: FunctionDefinitionAst Parameter Sets: (All) Aliases: Required: True Position: 1 Default value: None Accept pipeline input: False Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
For more information on Cyclomatic complexity, please refer to the following article https://en.wikipedia.org/wiki/Cyclomatic_complexity
A simple example of measuring the Cyclomatic complexity of a piece od code can be found here : https://www.tutorialspoint.com/software_testing_dictionary/cyclomatic_complexity.htm