Currently there seems to be no way to ignore certain folders, tests, samples, or sub-projects. This makes it difficult to restrict metrics calculation to production code.
If you take a look at the help pages within Eclipse, you'll see a page called 'Exclusions'. That tells you how to do what you're asking, I think.
In case you can't find it, here's the relevant part:
If you have Java files for which you do not want to have metrics calculated, you can exclude them. To do this, open the project's Properties in any Java Perspective and select the 'Metrics' tab. You can either choose the files to ignore by browsing the file system -- press 'Add Files...' -- or you can enter a Perl5 regular expression that matches the file path -- press 'Add Regex...'.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you take a look at the help pages within Eclipse, you'll see a page called 'Exclusions'. That tells you how to do what you're asking, I think.
In case you can't find it, here's the relevant part:
If you have Java files for which you do not want to have metrics calculated, you can exclude them. To do this, open the project's Properties in any Java Perspective and select the 'Metrics' tab. You can either choose the files to ignore by browsing the file system -- press 'Add Files...' -- or you can enter a Perl5 regular expression that matches the file path -- press 'Add Regex...'.