metriculator was subject of my bachelor thesis, the original documentation is available as PDF from http://eprints.hsr.ch/223/.
- Various C++ source code metrics (McCabe Complexity, Logical Lines of Code, Number of Params, Efferent Coupling, Number of Members)
- Smoothly integrated into Eclipse UI (Juno and earlier)
- Rich export functions (tag cloud image, HTML report, ASCII Text file, plain XML)
- Configurable limits per metric (e.g. maximum lines of code per function)
- Designed to easily add your own metrics (via separate plugin or via project contribution)
Download Eclipse CDT (or install C++ Development Tools as plug-in) from eclipse.org
Install the following plug-ins via update site in eclipse:
zest: https://hudson.eclipse.org/hudson/job/gef-zest-integration/ws/org.eclipse.zest.repository/target/repository/ Zest is not supported in Eclipse Juno. Zest is only required if metriculator will be installed with the tag cloud feature.
metriculator is also available from Eclipse marketplace: http://marketplace.eclipse.org/content/metriculator To install from marketplace simply drag and drop the following install button into your running Eclipse window.
Metriculator allows you to add new C++ metrics easily. There are already some metrics implemented which might help you to implement additional metrics. The following steps describe how you can add new metrics fast an simple. This manual assumes that you are working with Eclipse and have installed the Plug-in Development Environment (PDE) as well as the C/C++ Development Tooling (CDT) plug-in.
Set up metriculator Eclipse Workspace
- Checkout sources from the Git at GitHub repository
- In Eclipse Import Existing Projects into Workspace, select the repository checked out from point 1.
- Set the missing baselines to ignore in Eclipse > Window > Preferences > Plug-in Development > API Baselines.
- Open the target definition file in the package metriculator and set it as target platform.
- Update all the locations.
Adding a New Metric
- Add a new checker with a problem in the plugin.xml.
- Create a new metric class which inherits from AbstractMetric.
- If your new metric requires a non default metric value aggregation, override the aggregate method.
- Create a new metric checker class that inherits from AbstractMetricChecker.
- Define a problem ID.
- Create the name, description and preferences strings.
- Add the name, description and preferences strings to the MetricLabels.properties file in the package resources.
- Add the name, description and preferences strings to MetricLabels.
- Create a new instance of the metric in this checker.
- Register the new metric at the MetriculatorPluginActivator singleton instance.
- Implement the reportProblemsFor method.
- Implement the processTranslationUnit method. See chapter 3 for further information about visitors.
To see whether your pull request would successfully build, after merged into the master branch, have a look at Travis-CI