atom-community / atom-community/ide-python
Can't suppress Mccabe.
- Dominant language
- JavaScript
- Stars
- 238
- Forks
- 40
- PR merge metrics
- No merged PRs in 30d
Description
Hi everyone,
below I have build an example for a McCabe-violation from the anti-pattern on Flake8's website.
`def post_comment(self): # noqa
if self.success: # noqa
comment = 'Build succeeded'
elif self.warning:
comment = 'Build had issues'
elif self.failed:
comment = 'Build failed'
if self.success:
self.post(comment, type='success')
else:
self.post(comment, type='error')
if self.success:
comment = 'Build succeeded'
elif self.warning:
comment = 'Build had issues'
elif self.failed:
comment = 'Build failed'
if self.success:
self.post(comment, type='success')
else:
self.post(comment, type='error')
if self.success:
comment = 'Build succeeded'
elif self.warning:
comment = 'Build had issues'
elif self.failed:
comment = 'Build failed'
if self.success:
self.post(comment, type='success')
else:
self.post(comment, type='error')
if self.success:
comment = 'Build succeeded'
elif self.warning:
comment = 'Build had issues'
elif self.failed:
comment = 'Build failed'
if self.success:
self.post(comment, type='success')
else:
self.post(comment, type='error')
`
Predictably, this results in a warning. However, adding `noqa` does not manage to suppress these.

Kind regards.
Contributor guide
Assessment
This issue has not been assessed yet.