yegor256 / cam

Classes and Metriсs (CaM): a dataset of Java classes from public open-source GitHub repositories
http://cam.yegor256.com
MIT License
23 stars 32 forks source link

Add number of metrics analyzer #341

Closed timur-harin closed 3 months ago

timur-harin commented 3 months ago

@yegor256 In this PR, I added:

Now the result of sudo make test TEST=tests/steps/test-measure-file.sh

steps/test-measure-file.sh:
πŸ‘πŸ» Single file measured correctly
πŸ‘πŸ» Broken syntax measured and error log created
πŸ‘πŸ» Complex file measured correctly
πŸ‘πŸ» Number of metrics matches for simple and complex Java files: 62 metrics
timur-harin commented 3 months ago

@yegor256 Please check this important PR for metrics

yegor256 commented 3 months ago

@timur-harin looks good! However, you broke the structure that we use in all our tests. Don't go outside of the {...} layout and don't make your own error message. Just exit 1 if the test fails. Also, don't modify an existing test, but add your own new test at the bottom.

timur-harin commented 3 months ago

@yegor256 But we had to remove expected in this file what I discussed in Issue #282

So you suggest creating another file test-number-of-metrics.sh with the same logic and return everything back in test-measure-file.sh besides analysing the number of metrics?

yegor256 commented 3 months ago

@timur-harin no need to create a new file. Just take the test-measure-file.sh file, remove the line where we check the number of metrics and commit. Then, add a new test at the bottom of this file -- the test that you created.

timur-harin commented 3 months ago

@yegor256 I applied your suggestions:

yegor256 commented 3 months ago

@timur-harin excellent work, thanks!