Shared insights

I use because my school team is really intense about being as professional as humanly possible before going into the industry. We find it is a great way to force people to think about the complexity of their functions and remember certain things we don't often think about (explicit single param functions!).

Unfortunately, we had to make it not a required check due to a large amount of false positives. There have been many pull requests where it will report reduced code quality because a function near the code that was changed was already poor quality (from before code factor was added). It's not really feasible or the responsibility of the person doing that specific pull request to fix what is likely someone else's mistakes.

It also has a problem with switch statements that are simply enum conversions. We often have a use for stringifying enums, but it will say there are "18+ code paths", which makes it a complex function. We're more than fine with this and the solution of using an unordered map isn't really elegant.

We've also gotten a fail because "Complex Code" and it just points to the whole file. Like...okay? What do you want from me? How do I help with this? "The file just kinda sucks". Thanks CodeFactor.

I would also really like the ability to ignore something that comes up during a pull request. Doing so doesn't make the code factor check pass. I'm not even sure if I have the option to do that.

2 upvotes6K views