# by default, your directory base name # MetricFu.report_name = 'Something Convenient' # cane # Fails your build if code quality thresholds are not met # dirs_to_cane: MetricFu::Io::FileSystem.directory("code_dirs"), # options: # abc_max: 15, # line_length: 80, # no_doc: "n", # no_readme: "n", # filetypes: ["rb"] MetricFu.configuration.configure_metric(:cane) do |cane| cane.enabled = false end # churn # Identifies the file changes too frequently # options : # minimum_churn_count # ignore_files # start_date # data_directory # history # report # name MetricFu.configuration.configure_metric(:churn) do |churn| churn.enabled = true churn.start_date = '6 months ago' end # flog # measuring code complexity # options : # dirs_to_flog # continue # all # quiet MetricFu.configuration.configure_metric(:flog) do |flog| flog.enabled = false flog.dirs_to_flog = ['app'] end # flay # Flay analyzes code for structural similarities. Differences in literal # values, variable, class, method names, whitespace, programming style, # braces vs do/end, etc are all ignored. Making this totally rad. MetricFu.configuration.configure_metric(:flay) do |flay| flay.enabled = true flay.dirs_to_flay = ['app', 'script'] # MetricFu has been setting the minimum score as 100 for # a long time. This is a really big number, considering # the default is 16. Setting it to nil to use the Flay default. minimum_score = nil end # reek # find code smell MetricFu.configuration.configure_metric(:reek) do |reek| reek.enabled = true reek.dirs_to_reek = ['app'] dirs_to_reek = nil end # roodi # find a large number of general issues, design issue # options # dirs_to_roodi # roodi_config MetricFu.configuration.configure_metric(:roodi) do |roodi| roodi.enabled = true roodi.dirs_to_roodi = ['app'] end # SAIKURO # Saikuro is a Ruby cyclomatic complexity analyzer # optins : # cyclo: "", # filter_cyclo: "0", # warn_cyclo: "5", # error_cyclo: "7", # formater: "text", MetricFu.configuration.configure_metric(:saikuro) do |saikuro| saikuro.enabled = true saikuro.output_directory = 'tmp/metric_fu/scratch/saikuro' saikuro.input_directory = ['app'] end # code statics # options # additional_test_directories # additional_app_directories MetricFu.configuration.configure_metric(:stats) do |stats| stats.enabled = true end # rails best practices MetricFu::Configuration.run do |config| config.configure_metric(:rails_best_practices) do |rbp| # rbp.silent = true # rbp.exclude = ["config/chef"] end end # simplecover # calculate coverage MetricFu::Configuration.run do |config| config.configure_metric(:rcov) do |rcov| rcov.coverage_file = MetricFu.run_path.join("coverage/rcov/rcov.txt") rcov.rcov_opts = ["--profile", "--rails", "--exclude /gems/,/Library/,spec"] rcov.enable rcov.activate end end