mauricioaniche / ck

Code metrics for Java code by means of static analysis
Apache License 2.0
382 stars 152 forks source link

(Help wanted!) More and more tests! #36

Open mauricioaniche opened 4 years ago

mauricioaniche commented 4 years ago

CK is a simple tool; yet, people's code are complicated!! Although our test suite has been growing, there are always exceptional cases that might lead the tool to bring strange results.

If you are looking for a way to start contributing to this project, I suggest you to write tests!! Our test suite is full of examples! In practice, all you need to do is:

Submit your tests as a PR!

If you found a bug, THANK YOU! Feel free to fix it yourself! If you can't, no worries. Just open an issue, and I'll work on that!

mauricioaniche commented 4 years ago

The RFC metric is one that deserves a lot more tests!

maykon-oliveira commented 4 years ago

I have a question, should be method reference counted in RFC metric?

Map<Character, List<Integer>> byAlphabet =
        aList.stream()
            .collect(
                Collectors.groupingBy(
                    e -> new Character(e.getName().charAt(0)),
                    Collectors.mapping(Avatar::getId, Collectors.toList())));

For example, that's stream above, there is a method reference, but currently RFC does not include it.

So, the result of RFC metric above is 7, what should be the result 7 or 8?

RFC test file at line 82

mauricioaniche commented 4 years ago

We are probably not counting the Avatar::getId, but maybe we should! Would you mind fixing it and opening a PR?

maykon-oliveira commented 4 years ago

Sure!

I opened up a pull request