diff --git a/HISTORY.md b/HISTORY.md index 51a5fdbcd..ea238ebfa 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -69,7 +69,7 @@ As such, a _Feature_ would map to either major (breaking change) or minor. A _bu The old `mf_debug` and `mf_log` main mixin is presevered. Needs documentation. See #113. (Benjamin Fleischer, a49bfdd182) * Use *launchy* (new dependency) when opening output files. (Nick Veys, #224) * Coverage formatter now behaves like SimpleCov; it ignores certain lines in - calculating the precent run. Fixes #153, #222 (Benjamin Fleischer, #226). + calculating the percent run. Fixes #153, #222 (Benjamin Fleischer, #226). - Thanks to @crv for the test in #153 - Note: JRuby will usually report different Coverage from MRI. This is a known issue. - Note: This technically is a *breaking change* from how RCov works. But wwe don't run RCov anymore. (65bf21723291f) @@ -86,7 +86,7 @@ As such, a _Feature_ would map to either major (breaking change) or minor. A _bu * Rename ReekHotspot to MetricFu::ReekHotspot. Was missing namespace. (Benjamin Fleischer, a3aa70c1a9) * Allow failures for Ruby 2.1, in addition to rbx per issues with rvm. (Benjamin Fleischer, 3018b22) * `spec/quality_spec.rb` checks for whitespace, tabs, quotes, etc. `rake spec` also checks for warnings. (Benjamin Fleischer, b0c51bb9b17) - * When run with COVERAGE=true, will ouptut a file to `coverage/coverage_percent.txt` that can be checked via `rake check_code_coverage`. Borrowed from VCR. (Benjamin Fleischer, 32df3a34c6) + * When run with COVERAGE=true, will output a file to `coverage/coverage_percent.txt` that can be checked via `rake check_code_coverage`. Borrowed from VCR. (Benjamin Fleischer, 32df3a34c6) ### [4.10.0 / 2014-04-01](https://github.com/metricfu/metric_fu/compare/v4.9.0...v4.10.0) @@ -284,7 +284,7 @@ add all contriubtors * Skip reek when no files are found to run against. Otherwise, reek hangs trying to read from STDIN (Benjamin Fleischer, #119, #121) * Reek will now find files on Windows. Remove *nix-specific '/' directory separators from Reek file glob. (Benjamin Fleischer, #119, #121) * Link to correct reek url on report. (Calveto #116) - * Hack to accomodate Rails Best Practices dependency Code Analyzer monkey patch of Sexp (Benjamin Fleischer #123, #124) + * Hack to accommodate Rails Best Practices dependency Code Analyzer monkey patch of Sexp (Benjamin Fleischer #123, #124) * Misc * Moved environmental concerns into an Environment module ( Benjamin Fleischer / Robin Curry #91, #111) * Exposed RubyParser patch ( Benjamin Fleischer / Robin Curry #91, #111) @@ -435,7 +435,7 @@ add all contriubtors * MetricFu::MetricAnalyzer * MetricFu::AnalysisError * MetricFu::HotspotScoringStrategies -* Rename MetricAnalyzer to HotspotAnalyzer, and rename all Analzyer classes to Hotspot to signify that they are part of the Hotspot code -Benjamin Fleischer +* Rename MetricAnalyzer to HotspotAnalyzer, and rename all Analyzer classes to Hotspot to signify that they are part of the Hotspot code -Benjamin Fleischer ### MetricFu 2.1.3.4 / 2012-12-28 diff --git a/TODO.md b/TODO.md index 6d5dca193..f64128657 100644 --- a/TODO.md +++ b/TODO.md @@ -73,13 +73,13 @@ instance variables and accessors * Look into issues for the tools metric_fu uses * Look into other tools that might work well -* Update contributing or issue guidlines +* Update contributing or issue guidelines * Suggest commit message guidelines * [Update the homepage](https://github.com/metricfu/metricfu.github.com) ## Future Thoughts -* Look into how to manage plugins or otherwise load abritrary metrics +* Look into how to manage plugins or otherwise load arbitrary metrics * [Hoe](https://github.com/seattlerb/hoe/blob/master/lib/hoe.rb#L301) * CLI [Flog](https://github.com/seattlerb/flog/blob/master/lib/flog_cli.rb) Plugins [Flog](https://github.com/seattlerb/flog/blob/master/lib/flog_cli.rb#L34) * Look into adding @@ -87,7 +87,7 @@ instance variables and accessors * or extract from rails into a gem [rake task](https://github.com/rails/rails/blob/master/railties/lib/rails/tasks/statistics.rake) [can be modified by rspec](https://github.com/rspec/rspec-rails/blob/master/lib/rspec/rails/tasks/rspec.rake#L38) with the [calculator](https://github.com/rails/rails/blob/master/railties/lib/rails/code_statistics_calculator.rb) and [class](https://github.com/rails/rails/blob/master/railties/lib/rails/code_statistics.rb) * brakeman https://github.com/metricfu/brakeman * laser https://github.com/metricfu/laser -* Other intersting libraries to consider: +* Other interesting libraries to consider: * https://gist.github.com/4562865 for generating Flog on ERB templates by jamesmartin * https://github.com/chad/turbulence churn and complexity (flog) * https://github.com/vinibaggio/discover-unused-partials diff --git a/lib/metric_fu/data_structures/location.rb b/lib/metric_fu/data_structures/location.rb index 044b2fbed..b1fa9c894 100644 --- a/lib/metric_fu/data_structures/location.rb +++ b/lib/metric_fu/data_structures/location.rb @@ -62,7 +62,7 @@ def self.for(class_or_method_name) begin match = class_or_method_name.match(/(.*)((\.|\#|\:\:[a-z])(.+))/) rescue => error - # new error during port to metric_fu occasionally a unintialized + # new error during port to metric_fu occasionally a uninitialized # MatchData object shows up here. Not expected. mf_debug "ERROR on getting location for #{class_or_method_name} #{error.inspect}" match = nil diff --git a/lib/metric_fu/generator.rb b/lib/metric_fu/generator.rb index f1c840de7..7e1fd1d08 100644 --- a/lib/metric_fu/generator.rb +++ b/lib/metric_fu/generator.rb @@ -26,7 +26,7 @@ module MetricFu # named after the metric under the scratch_directory, where # any output from the #emit method should go. # - # It will also create the output_directory if neccessary, and + # It will also create the output_directory if necessary, and # in general setup the directory structure that the MetricFu system # expects. class Generator diff --git a/lib/metric_fu/metrics/flay/hotspot.rb b/lib/metric_fu/metrics/flay/hotspot.rb index 05d203347..e8e17b04c 100644 --- a/lib/metric_fu/metrics/flay/hotspot.rb +++ b/lib/metric_fu/metrics/flay/hotspot.rb @@ -46,7 +46,7 @@ def generate_records(data, table) end def present_group(group) - occurences = group.size - "found #{occurences} code duplications" + occurrences = group.size + "found #{occurrences} code duplications" end end diff --git a/lib/metric_fu/metrics/flog/hotspot.rb b/lib/metric_fu/metrics/flog/hotspot.rb index 0da92583d..54a507ab2 100644 --- a/lib/metric_fu/metrics/flog/hotspot.rb +++ b/lib/metric_fu/metrics/flog/hotspot.rb @@ -39,8 +39,8 @@ def generate_records(data, table) end def present_group(group) - occurences = group.size + occurrences = group.size complexity = get_mean(group.column("score")) - "#{'average ' if occurences > 1}complexity is %.1f" % complexity + "#{'average ' if occurrences > 1}complexity is %.1f" % complexity end end diff --git a/lib/metric_fu/metrics/rcov/hotspot.rb b/lib/metric_fu/metrics/rcov/hotspot.rb index 04541fc58..b569614ab 100644 --- a/lib/metric_fu/metrics/rcov/hotspot.rb +++ b/lib/metric_fu/metrics/rcov/hotspot.rb @@ -39,8 +39,8 @@ def generate_records(data, table) end def present_group(group) - occurences = group.size + occurrences = group.size average_code_uncoverage = get_mean(group.column("percentage_uncovered")) - "#{'average ' if occurences > 1}uncovered code is %.1f%" % average_code_uncoverage + "#{'average ' if occurrences > 1}uncovered code is %.1f%" % average_code_uncoverage end end diff --git a/lib/metric_fu/metrics/reek/hotspot.rb b/lib/metric_fu/metrics/reek/hotspot.rb index b9c97cfce..8f214725f 100644 --- a/lib/metric_fu/metrics/reek/hotspot.rb +++ b/lib/metric_fu/metrics/reek/hotspot.rb @@ -55,8 +55,8 @@ def self.numeric_smell?(type) end def present_group(group) - occurences = group.size - "found #{occurences} code smells" + occurrences = group.size + "found #{occurrences} code smells" end private diff --git a/lib/metric_fu/metrics/roodi/hotspot.rb b/lib/metric_fu/metrics/roodi/hotspot.rb index 041083137..d50920bff 100644 --- a/lib/metric_fu/metrics/roodi/hotspot.rb +++ b/lib/metric_fu/metrics/roodi/hotspot.rb @@ -33,7 +33,7 @@ def generate_records(data, table) end def present_group(group) - occurences = group.size - "found #{occurences} design problems" + occurrences = group.size + "found #{occurrences} design problems" end end diff --git a/lib/metric_fu/metrics/saikuro/hotspot.rb b/lib/metric_fu/metrics/saikuro/hotspot.rb index da5be8d86..47b93487d 100644 --- a/lib/metric_fu/metrics/saikuro/hotspot.rb +++ b/lib/metric_fu/metrics/saikuro/hotspot.rb @@ -44,8 +44,8 @@ def generate_records(data, table) end def present_group(group) - occurences = group.size + occurrences = group.size complexity = get_mean(group.column("complexity")) - "#{'average ' if occurences > 1}complexity is %.1f" % complexity + "#{'average ' if occurrences > 1}complexity is %.1f" % complexity end end diff --git a/lib/metric_fu/metrics/saikuro/metric.rb b/lib/metric_fu/metrics/saikuro/metric.rb index 1a1ed5dd0..0ccbef3fc 100644 --- a/lib/metric_fu/metrics/saikuro/metric.rb +++ b/lib/metric_fu/metrics/saikuro/metric.rb @@ -12,7 +12,7 @@ def default_run_options filter_cyclo: "0", warn_cyclo: "5", error_cyclo: "7", - formater: "text", + formatter: "text", } end diff --git a/lib/metric_fu/templates/javascripts/bluff_graph.js b/lib/metric_fu/templates/javascripts/bluff_graph.js index 098ffdd82..5b2279997 100644 --- a/lib/metric_fu/templates/javascripts/bluff_graph.js +++ b/lib/metric_fu/templates/javascripts/bluff_graph.js @@ -8,8 +8,8 @@ chart.legend_font_size = "12px"; chart.marker_font_size = "10px"; chart.title = graph_title; for(var i = 0; i < graph_series.length; i++) { - var serie = graph_series[i]; - chart.data(serie.name, serie.data); + var series = graph_series[i]; + chart.data(series.name, series.data); } chart.labels = graph_labels; chart.draw(); diff --git a/lib/metric_fu/templates/report.rb b/lib/metric_fu/templates/report.rb index 26748b846..62143c4b7 100644 --- a/lib/metric_fu/templates/report.rb +++ b/lib/metric_fu/templates/report.rb @@ -7,7 +7,7 @@ module MetricFu module Templates class Report < MetricFu::Template # @param file [String] the analyzed file to annotate - # @param lines [Hash] of line number [String] keyed to an list [[Array] of metrics for that line. Each metric in the list is a hash containing the keys :type => metric_name, :descrption => metric_score + # @param lines [Hash] of line number [String] keyed to an list [[Array] of metrics for that line. Each metric in the list is a hash containing the keys :type => metric_name, :description => metric_score # @example file and lines # file: "lib/metric_fu/gem_version.rb # lines: {"30"=>[{:type=>:flog, :description=>"Score of 22.43"}], "42"=>[{:type=>:flog, :description=>"Score of 8.64"}]} diff --git a/lib/metric_fu/templates/template.rb b/lib/metric_fu/templates/template.rb index dd20d7437..f225a3e25 100644 --- a/lib/metric_fu/templates/template.rb +++ b/lib/metric_fu/templates/template.rb @@ -43,7 +43,7 @@ def erb_template_source(template_file) erb end - # Copies an instance variable mimicing the name of the section + # Copies an instance variable mimicking the name of the section # we are trying to render, with a value equal to the passed in # constant. Allows the concrete template classes to refer to # that instance variable from their ERB rendering diff --git a/spec/fixtures/20090630.yml b/spec/fixtures/20090630.yml index 2e36a7a22..f05f63afe 100644 --- a/spec/fixtures/20090630.yml +++ b/spec/fixtures/20090630.yml @@ -1771,7 +1771,7 @@ - :was_run: true :content: " :error_cyclo => \"7\"," - :was_run: true - :content: " :formater => \"text\"}" + :content: " :formatter => \"text\"}" - :was_run: true :content: " @churn = {}" - :was_run: true @@ -2682,7 +2682,7 @@ - :was_run: true :content: " #" - :was_run: true - :content: " # It will also create the MetricFu.output_directory if neccessary, and" + :content: " # It will also create the MetricFu.output_directory if necessary, and" - :was_run: true :content: " # in general setup the directory structure that the MetricFu system" - :was_run: true @@ -3159,7 +3159,7 @@ - :was_run: true :content: " " - :was_run: true - :content: " # Copies an instance variable mimicing the name of the section" + :content: " # Copies an instance variable mimicking the name of the section" - :was_run: true :content: " # we are trying to render, with a value equal to the passed in " - :was_run: true diff --git a/spec/metric_fu/formatter_spec.rb b/spec/metric_fu/formatter_spec.rb index 290f988ab..e94212adf 100644 --- a/spec/metric_fu/formatter_spec.rb +++ b/spec/metric_fu/formatter_spec.rb @@ -38,7 +38,7 @@ end end - context "given a custom formatter that doesnt exist" do + context "given a custom formatter that doesn't exist" do subject { MetricFu::Formatter.class_for("MyNonExistentCustomFormatter") } it "raises an error" do diff --git a/spec/metric_fu/generator_spec.rb b/spec/metric_fu/generator_spec.rb index 6835ed208..8ff5140a2 100644 --- a/spec/metric_fu/generator_spec.rb +++ b/spec/metric_fu/generator_spec.rb @@ -97,7 +97,7 @@ def to_h @container.destroy! end - it "should return entire pathlist given no exclude pattens" do + it "should return entire pathlist given no exclude patterns" do files = @concrete_class.remove_excluded_files(@paths) expect(files).to eq(@paths) end diff --git a/spec/metric_fu/metrics/rails_best_practices/generator_spec.rb b/spec/metric_fu/metrics/rails_best_practices/generator_spec.rb index a39330333..f0a09859a 100644 --- a/spec/metric_fu/metrics/rails_best_practices/generator_spec.rb +++ b/spec/metric_fu/metrics/rails_best_practices/generator_spec.rb @@ -14,7 +14,7 @@ describe "analyze method" do let(:error) { ::RailsBestPractices::Core::Error.new } - context "RailsBestPractices provdies the expected API" do + context "RailsBestPractices provides the expected API" do it { expect(error).to respond_to :filename } it { expect(error).to respond_to :line_number } it { expect(error).to respond_to :message } diff --git a/spec/metric_fu/metrics/rcov/simplecov_formatter_spec.rb b/spec/metric_fu/metrics/rcov/simplecov_formatter_spec.rb index c71a8d96e..44a1ae347 100644 --- a/spec/metric_fu/metrics/rcov/simplecov_formatter_spec.rb +++ b/spec/metric_fu/metrics/rcov/simplecov_formatter_spec.rb @@ -42,7 +42,7 @@ result = SimpleCov.result # end coverage source_file = result.source_files.first - # formatter ouputs this from simplecov result + # formatter outputs this from simplecov result rcov_text = SimpleCov::Formatter::MetricFu::FormatLikeRCov.new(result).format # generator analyzes the rcov text diff --git a/spec/metric_fu/metrics/saikuro/configuration_spec.rb b/spec/metric_fu/metrics/saikuro/configuration_spec.rb index 7bb6c696f..1ae957d1f 100644 --- a/spec/metric_fu/metrics/saikuro/configuration_spec.rb +++ b/spec/metric_fu/metrics/saikuro/configuration_spec.rb @@ -9,7 +9,7 @@ :filter_cyclo => '0', :warn_cyclo => '5', :error_cyclo => '7', - :formater => 'text' }" do + :formatter => 'text' }" do load_metric "saikuro" expect(MetricFu::Metric.get_metric(:saikuro).run_options).to eq( output_directory: "#{scratch_directory}/saikuro", @@ -18,7 +18,7 @@ filter_cyclo: "0", warn_cyclo: "5", error_cyclo: "7", - formater: "text" + formatter: "text" ) end end diff --git a/spec/usage_test_spec.rb b/spec/usage_test_spec.rb index dbd6c88b9..929a4b059 100644 --- a/spec/usage_test_spec.rb +++ b/spec/usage_test_spec.rb @@ -63,7 +63,7 @@ expect(test_result.success).to eq(true) end specify "fails when the command runs with an error" do - code = "sandwhich_fu ruby" + code = "sandwich_fu ruby" test_result = SnippetRunner.new(code, "sh").run_code expect(test_result.captured_output).to match(failed_command_error) expect(test_result.success).to eq(false)