RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

Algorithms behind RuboCop complexity metrics

I published a series on Medium.com, explaining the algorithms behind RuboCop complexity metrics. The third part reveals the mathematical connections between different metrics. The series will help you with configuring cyclomatic complexity, perceived complexity, and, ABC size values for RuboCop analysis, which are not completely random.

  • In the first part we cover syntactic representation of Ruby source code. It provides all the information required to get started with the algorithms.
  • In the second part we go through the pseudocode of the algorithms and solve a couple of problems to see how to calculate the complexity values without drawing control flow graphs.
  • In the third part we do mathematical analysis to establish a relationship between the metrics and not use a random RuboCop configuration.

Comments

Thanks for compiling it up, Great article!

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in