-1

I'm refactoring old code and I want to find all functions that bigger than N lines to refactor it. It would be cool if there was the same tool for finding big classes. The project has a lot of files so it is not so easy to find large methods manually. I couldn't find this tool on the Internet, so, maybe you guys know a tool that can help me? Thanks in advance!

zenno2
  • 425
  • 2
  • 7

3 Answers3

0

You can find IDE plugins and external tools which will compute cyclomatic complexities of each of your methods to achieve your needs. You can find some tools in this subject

Ennoriel
  • 144
  • 1
  • 8
0

In the PVS-Studio analyzer there is the V553 diagnostic that reports that the size of the function or class exceeds 2000 lines. However, it's not the best idea to rely on the function size. It is because in addition to the length one should also take the function complexity into account. In this case, search for functions with large Cyclomatic complexity may help. For this, there is another V2008 diagnostic in PVS-Studio (note that it's disabled by default).

AndreyKarpov
  • 1,083
  • 6
  • 17
0

The tool NDepend can help finding large and complex classes and methods. There are several default rules for that:

Patrick from NDepend team
  • 13,237
  • 6
  • 61
  • 92