mauricioaniche/ck

Option to ignore Test classes

tbloemen opened this issue · 3 comments

Hi,

Sometimes it is only necessary to refactor in the main part of your application, and the tests don't necessarily need to be refactored. It would be nice if there was an option to ignore test classes, and just produce the metrics for the main code. Is this possible?

This is to my knowledge not possible at the moment. However, as a workaround, you could write a small script to prepare the files and run ck. An example in Bash:

#!/bin/bash
# assuming you are in the root of your project directory
mkdir -p sources/
mkdir -p output/
# repeat this for every Gradle module you have
cp -r module1/src/main/. sources/ 
# run ck with whatever options you are using
java -jar ck.jar sources/ false 0 false output/

Helpful, I'll do that in the meantime!

Indeed, @tbloemen, there's no way to do that with ck. And, to be honest, I don't think the tool should offer this feature!

So, you can either filter them out before or after running ck!