C#

C#

Made by DeepSource

Methods with Pure attribute should return a value CS-R1002

Anti-pattern
Major

A method with the Pure attribute suggests that it does not have any side effects, i.e., does not mutate the object's state. Therefore, having such a method have a return type void does not make any sense. Therefore, it is suggested that you refactor your code accordingly, i.e., drop the said attribute or modify your method's logic.

Bad Practice

[Pure]
public void CalculateMetrics()
{
    // ...
}

Recommended

public void CalculateMetrics()
{
    // ...
}

Reference