Problem 964. McCabe Complexity

Solution 152627

Submitted on 21 Oct 2012 by Khaled Hamed
  • Size: 15
  • This is the leading solution.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
assert(isequal(McCabe('polyval.m'),19)); % polyval %message: 'The McCabe complexity of 'polyval' is 19.'

2   Pass
%% assert(isequal(McCabe('residue.m'),21)); %2x1 struct array with fields:

3   Pass
%% assert(isequal(McCabe('polyeig.m'),18));

4   Pass
%% assert(isequal(McCabe('roots.m'),7)); % message: 'The McCabe complexity of 'roots' is 7.'

5   Pass
%% assert(isequal(McCabe('decic.m'),14)); %3x1 struct array with fields:

Suggested Problems

More from this Author241

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!