title: Measure purity of a function
body: <p>Is there an existing solution to detect if a function is <a href="https://en.wikipedia.org/wiki/Pure_function" rel="nofollow">pure</a> or impure, or the degree of purity using some metrics?</p>
  
  <p>The case is, I want to transition my existing app code to more functional-style, and one of the desires is to reduce the impurity of functions to the bare minimum level. I can do it manually, but if can be automated, why not?</p>
  
  <p>I know <a href="https://en.wikipedia.org/wiki/Cyclomatic_complexity" rel="nofollow">cyclomatic complexity</a> can be measured with tools like <a href="http://eslint.org/docs/rules/complexity.html" rel="nofollow">ESLint</a>, so I think purity can be too.</p>