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

get the wrong Cyclomatic Complexity of a function #125

Open
lmy690043305 opened this issue Sep 18, 2018 · 0 comments
Open

get the wrong Cyclomatic Complexity of a function #125

lmy690043305 opened this issue Sep 18, 2018 · 0 comments

Comments

@lmy690043305
Copy link

  • (void)initMyScrollViewContentView{

    self.myScrollViewContentView = [[UIView alloc] initWithFrame:CGRectZero];
    self.myScrollViewContentView.backgroundColor = RGBCOLOR(0xff, 0xff, 0xff);
    [self.myScrollView addSubview:self.myScrollViewContentView];
    [self.myScrollViewContentView mas_makeConstraints:^(MASConstraintMaker *make) {
    make.edges.mas_equalTo(self.myScrollView);
    make.width.mas_equalTo(self.myScrollView);
    make.height.mas_equalTo(ScreenHeight-kNavBar_H-kBottomSafeArea_H-50+self.headerHeight);
    }];
    }

#define RGBCOLOR(r,g,b) ([UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1])
wx20180918-143124 2x

Cyclomatic Complexity Number 25 exceeds limit of 10

This method has a macro definition method RGBCOLOR, macro definition inside the cyclomatic complexity is 1, the cyclomatic complexity of the above method should be 2, but the final scan cyclomatic complexity is 25, is wrong, someone encountered similar problems

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant