| 204 | }}} |
| 205 | |
| 206 | == Using metric queries == |
| 207 | There is a [[MetricQuery|metric queries]] page, where you can read a general description about metric queries. |
| 208 | |
| 209 | Please, note that all of the metrics can be used as a property in our semantic query language. |
| 210 | |
| 211 | A metric query can be run by executing the followings: |
| 212 | |
| 213 | {{{#!erlang |
| 214 | MetricQueryString = "show number_of_fun for module ('a','b')", |
| 215 | ri:metric(MetricQueryString). |
| 216 | }}} |
| 217 | |
| 218 | === Querying bad smells === |
| 219 | |
| 220 | On the [[MetricQuery|metric queries]] page, more detailed information can be found about bad smells, and the usage of the metric analyzer mode. |
| 221 | |
| 222 | !RefactorErl console supports querying bad smells in the code. |
| 223 | |
| 224 | In order to utilize it, the metric analyzer mode had to be turned on first: |
| 225 | |
| 226 | {{{#!erlang |
| 227 | ri:metricmode(on). |
| 228 | }}} |
| 229 | |
| 230 | After the metric analyzer mode has been turned on, the bad smells can be queried: |
| 231 | |
| 232 | {{{#!erlang |
| 233 | ri:metricmode(show). |
| 234 | }}} |
| 235 | |
| 236 | which returns a term that describes the modules and functions where the metrics have values outside the user defined limits. |
| 237 | |
| 238 | The metric analyzer mode can be turned off by: |
| 239 | {{{#!erlang |
| 240 | ri:metricmode(off). |