在Python中,我们可以通过应用“# NOSONAR”注释来抑制代码中特定行的所有Sonarqube警告。这并不理想。有没有一种方法可以抑制特定的错误,而不是抑制所有错误?
例如,您可能有一个带有两个警告的函数:
你如何抑制第一个但不抑制第二个?
例如,您可能有一个带有两个警告的函数:
Function "foo" has 8 parameters, which is greater than the 7 authorized.
Refactor this function to reduce its Cognitive Complexity from 17 to the 15 allowed
你如何抑制第一个但不抑制第二个?
@SupressWarnings
在 Python 中可用吗?我认为这只允许在 Java 中使用。 - Matthew Moisen