Permalink
Browse files

Delete trailing whitespaces

  • Loading branch information...
1 parent b515d8f commit bdd3a402d6c13124086b76c45330b999743f9253 @delwyn delwyn committed Nov 12, 2010
Showing with 840 additions and 841 deletions.
  1. +5 −5 HISTORY
  2. +2 −2 README
  3. +1 −1 Rakefile
  4. +1 −1 TODO
  5. BIN home_page/reek.gif
  6. BIN home_page/roodi.gif
  7. BIN home_page/stats.gif
  8. +16 −16 lib/base/base_template.rb
  9. +3 −3 lib/base/churn_analyzer.rb
  10. +8 −8 lib/base/code_issue.rb
  11. +20 −20 lib/base/configuration.rb
  12. +2 −2 lib/base/flay_analyzer.rb
  13. +3 −3 lib/base/flog_analyzer.rb
  14. +21 −21 lib/base/generator.rb
  15. +6 −6 lib/base/graph.rb
  16. +11 −11 lib/base/line_numbers.rb
  17. +4 −4 lib/base/location.rb
  18. +12 −12 lib/base/metric_analyzer.rb
  19. +2 −2 lib/base/rcov_analyzer.rb
  20. +4 −4 lib/base/reek_analyzer.rb
  21. +9 −9 lib/base/report.rb
  22. +2 −2 lib/base/roodi_analyzer.rb
  23. +2 −2 lib/base/saikuro_analyzer.rb
  24. +2 −2 lib/base/scoring_strategies.rb
  25. +2 −2 lib/base/stats_analyzer.rb
  26. +4 −4 lib/base/table.rb
  27. +1 −1 lib/generators/churn.rb
  28. +1 −1 lib/generators/flay.rb
  29. +4 −4 lib/generators/hotspots.rb
  30. +1 −1 lib/generators/rails_best_practices.rb
  31. +16 −16 lib/generators/rcov.rb
  32. +2 −2 lib/generators/reek.rb
  33. +42 −42 lib/generators/saikuro.rb
  34. +6 −6 lib/generators/stats.rb
  35. +1 −1 lib/graphs/engines/bluff.rb
  36. +7 −7 lib/graphs/engines/gchart.rb
  37. +3 −3 lib/graphs/flog_grapher.rb
  38. +1 −1 lib/graphs/grapher.rb
  39. +2 −2 lib/metric_fu.rb
  40. +1 −1 lib/templates/awesome/churn.html.erb
  41. +0 −1 lib/templates/awesome/css/integrity.css
  42. +2 −2 lib/templates/awesome/flay.html.erb
  43. +2 −2 lib/templates/awesome/flog.html.erb
  44. +4 −4 lib/templates/awesome/hotspots.html.erb
  45. +2 −2 lib/templates/awesome/index.html.erb
  46. +1 −1 lib/templates/awesome/rails_best_practices.html.erb
  47. +1 −1 lib/templates/awesome/rcov.html.erb
  48. +1 −1 lib/templates/awesome/roodi.html.erb
  49. +3 −3 lib/templates/awesome/saikuro.html.erb
  50. +1 −1 lib/templates/awesome/stats.html.erb
  51. +2 −2 lib/templates/standard/churn.html.erb
  52. +4 −4 lib/templates/standard/default.css
  53. +4 −4 lib/templates/standard/flay.html.erb
  54. +1 −1 lib/templates/standard/flog.html.erb
  55. +4 −4 lib/templates/standard/hotspots.html.erb
  56. +2 −2 lib/templates/standard/index.html.erb
  57. +2 −2 lib/templates/standard/rails_best_practices.html.erb
  58. +2 −2 lib/templates/standard/rcov.html.erb
  59. +1 −1 lib/templates/standard/reek.html.erb
  60. +2 −2 lib/templates/standard/roodi.html.erb
  61. +4 −4 lib/templates/standard/saikuro.html.erb
  62. +2 −2 lib/templates/standard/stats.html.erb
  63. +3 −3 metric_fu.gemspec
  64. +1 −1 spec/base/base_template_spec.rb
  65. +36 −36 spec/base/configuration_spec.rb
  66. +10 −10 spec/base/generator_spec.rb
  67. +4 −4 spec/base/graph_spec.rb
  68. +11 −11 spec/base/line_numbers_spec.rb
  69. +9 −9 spec/base/report_spec.rb
  70. +4 −4 spec/generators/churn_spec.rb
  71. +31 −31 spec/generators/flay_spec.rb
  72. +18 −18 spec/generators/flog_spec.rb
  73. +6 −6 spec/generators/rails_best_practices_spec.rb
  74. +18 −18 spec/generators/rcov_spec.rb
  75. +10 −10 spec/generators/reek_spec.rb
  76. +2 −2 spec/generators/roodi_spec.rb
  77. +7 −7 spec/generators/saikuro_spec.rb
  78. +6 −6 spec/generators/stats_spec.rb
  79. +8 −8 spec/graphs/engines/gchart_spec.rb
  80. +8 −8 spec/graphs/flog_grapher_spec.rb
  81. +7 −7 spec/resources/line_numbers/foo.rb
  82. +2 −2 spec/resources/line_numbers/module.rb
  83. +6 −6 spec/resources/line_numbers/module_surrounds_class.rb
  84. +2 −2 spec/resources/saikuro/index_cyclo.html
  85. +349 −349 spec/resources/yml/20090630.yml
  86. +1 −1 spec/resources/yml/metric_missing.yml
  87. +4 −4 tasks/metric_fu.rake
View
@@ -3,16 +3,16 @@
* Hotspots - Dan Mayer, Ben Brinckerhoff, Jake Scruggs
* Rcov integration with Hotspots - Jake Scruggs, Tony Castiglione, Rob Meyer
-=== MetricFu 1.5.1 / 2010-7-28
+=== MetricFu 1.5.1 / 2010-7-28
* Patch that allows graphers to skip dates that didn't generate metrics for that graph (GitHub Issue #20). - Chris Griego
* Fixed bug where if you try and use the gchart grapher with the rails_best_practices metric, it blows up (GitHub Issue #23). - Chris Griego
* Fixed 'If coverage is 0% metric_fu will explode' bug (GitHub Issue #6). - Stew Welbourne
=== MetricFu 1.5.0 / 2010-7-27
-* Fixed bug where Flay results were not being reported. Had to remove the ability to remove selected files from flay processing (undocumented feature that may go away soon if it keeps causing problems).
-* Rewrote Flog parsing/processing to use Flog programmatically. Note: the yaml output for Flog has changed significantly - Pages have now become MethodContainers. This probably doesn't matter to you if you are not consuming the metric_fu yaml output.
+* Fixed bug where Flay results were not being reported. Had to remove the ability to remove selected files from flay processing (undocumented feature that may go away soon if it keeps causing problems).
+* Rewrote Flog parsing/processing to use Flog programmatically. Note: the yaml output for Flog has changed significantly - Pages have now become MethodContainers. This probably doesn't matter to you if you are not consuming the metric_fu yaml output.
* Added support for using config files in Reek and Roodi (roodi support was already there but undocumented).
* Removed verify_dependencies! as it caused too much confusion to justify the limited set of problems it solved. In the post Bundler world it just didn't seem necessary to limit metric_fu dependencies.
* Deal with Rails 3 activesupport vs active_support problems. - jinzhu
@@ -159,7 +159,7 @@
=== MetricFu 0.7.0 / 2008-09-11
-* Merged in Sean Soper's changes to metric_fu.
+* Merged in Sean Soper's changes to metric_fu.
* Metric_fu is now a gem.
* Flogging now uses a MD5 hash to figure out if it should re-flog a file (if it's changed)
* Flogging also has a cool new output screen(s)
@@ -194,7 +194,7 @@
=== Metricks 0.1.0 / 2008-06-10
* Initial integration of metric_fu and my enhancements to flog
- * Metrics are generated but are all over the place
+ * Metrics are generated but are all over the place
=== MetricFu 0.6.0 / 2008-05-11
View
@@ -11,9 +11,9 @@ How to contribute:
7. Make sure two important rake tests still run ('rake' and 'rake metrics:all')
8. Commit and send me a pull request with details as to what has been changed.
-Extra Credit:
+Extra Credit:
1. Make sure your changes work in 1.8.7, Ruby Enterprise Edition, and 1.9.1 (Hint use 'rvm' to help install multiple rubies)
-2. Post to the Google group explaining what you did and why you did it (I don't merge things in immediately so others might want to use what you've done).
+2. Post to the Google group explaining what you did and why you did it (I don't merge things in immediately so others might want to use what you've done).
3. Update the documentation (web page inside the 'home_page' folder)
4. Update the History and give yourself credit.
View
@@ -3,7 +3,7 @@ require 'rake'
require 'rake/rdoctask'
require 'spec/rake/spectask'
require 'lib/metric_fu'
-
+
desc "Run all specs in spec directory"
Spec::Rake::SpecTask.new(:spec) do |t|
t.spec_files = FileList['spec/**/*_spec.rb']
View
@@ -1,4 +1,4 @@
== TODO list
* Color code flog results with scale from: http://jakescruggs.blogspot.com/2008/08/whats-good-flog-score.html
-* Make running metric_fu on metric_fu less embarrassing
+* Make running metric_fu on metric_fu less embarrassing
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -9,12 +9,12 @@ module MetricFu
# example.
class Template
attr_accessor :report
-
+
private
# Creates a new erb evaluated result from the passed in section.
#
# @param section String
- # The section name of
+ # The section name of
#
# @return String
# The erb evaluated string
@@ -35,10 +35,10 @@ def erbify(section)
def template_exists?(section)
File.exist?(template(section))
end
-
+
# Copies an instance variable mimicing 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
+ # 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
#
# @param section String
@@ -48,10 +48,10 @@ def template_exists?(section)
# The value to set as the value of the created instance
# variable
def create_instance_var(section, contents)
- instance_variable_set("@#{section}", contents)
+ instance_variable_set("@#{section}", contents)
end
- # Generates the filename of the template file to load and
+ # Generates the filename of the template file to load and
# evaluate. In this case, the path to the template directory +
# the section name + .html.erb
#
@@ -76,7 +76,7 @@ def output_filename(section)
section.to_s + ".html"
end
- # Returns the contents of a given css file in order to
+ # Returns the contents of a given css file in order to
# render it inline into a template.
#
# @param css String
@@ -85,14 +85,14 @@ def output_filename(section)
# @return String
# The contents of the css file
def inline_css(css)
- open(File.join(this_directory, css)) { |f| f.read }
+ open(File.join(this_directory, css)) { |f| f.read }
end
-
+
# Provides a link to open a file through the textmate protocol
# on Darwin, or otherwise, a simple file link.
#
# @param name String
- #
+ #
# @param line Integer
# The line number to link to, if textmate is available. Defaults
# to nil
@@ -102,12 +102,12 @@ def inline_css(css)
def link_to_filename(name, line = nil, link_content = nil)
"<a href='#{file_url(name, line)}'>#{link_content(name, line, link_content)}</a>"
end
-
+
def round_to_tenths(decimal)
decimal = 0.0 if decimal.to_s.eql?('NaN')
- (decimal * 10).round / 10.0
+ (decimal * 10).round / 10.0
end
-
+
def link_content(name, line=nil, link_content=nil) # :nodoc:
if link_content
link_content
@@ -133,13 +133,13 @@ def display_location(location, stat)
end
str
end
-
+
def file_url(name, line) # :nodoc:
return '' unless name
filename = File.expand_path(name.gsub(/^\//, ''))
if MetricFu.configuration.platform.include?('darwin')
"txmt://open/?url=file://#{filename}" << (line ? "&line=#{line}" : "")
- else
+ else
"file://#{filename}"
end
end
@@ -6,7 +6,7 @@ class ChurnAnalyzer
def columns
COLUMNS
end
-
+
def name
:churn
end
@@ -23,7 +23,7 @@ def score(metric_ranking, item)
flat_churn_score = 0.50
metric_ranking.scored?(item) ? flat_churn_score : 0
end
-
+
def generate_records(data, table)
return if data==nil
Array(data[:changes]).each do |change|
@@ -35,7 +35,7 @@ def generate_records(data, table)
end
end
- private
+ private
def self.update_changes(total, changed)
changed.each do |change|
@@ -19,17 +19,17 @@ def carefully_remove(elements)
class CodeIssue < DelegateClass(Record) #DelegateClass(Ruport::Data::Record)
include Comparable
- # TODO: Yuck! 'stat_value' is a column for StatAnalyzer
+ # TODO: Yuck! 'stat_value' is a column for StatAnalyzer
EXCLUDED_COLUMNS = FlogAnalyzer::COLUMNS + SaikuroAnalyzer::COLUMNS + ['stat_value'] + ChurnAnalyzer::COLUMNS + ReekAnalyzer.new.columns.extend(CarefulArray).carefully_remove(['reek__type_name', 'reek__comparable_message']) + FlayAnalyzer.new.columns.extend(CarefulArray).carefully_remove(['flay_matching_reason'])
def <=>(other)
spaceship_for_columns(self.attributes, other)
end
-
+
def ===(other)
self.hash_for(included_columns_hash, included_columns) == other.hash_for(included_columns_hash, included_columns)
end
-
+
def spaceship_for_columns(columns, other)
columns.each do |column|
equality = self[column].to_s <=> other[column].to_s
@@ -41,7 +41,7 @@ def spaceship_for_columns(columns, other)
def hash_for(column_hash, columns)
@hashes ||= {}
# fetch would be cleaner, but slower
- if @hashes.has_key?(column_hash)
+ if @hashes.has_key?(column_hash)
@hashes[column_hash]
else
values = columns.map {|column| self[column]}
@@ -54,7 +54,7 @@ def hash_for(column_hash, columns)
def included_columns_hash
@included_columns_hash ||= included_columns.hash
end
-
+
def included_columns
@included_columns ||= self.attributes.extend(CarefulArray).carefully_remove(EXCLUDED_COLUMNS)
end
@@ -78,10 +78,10 @@ def modifies?(other)
self.reek__value != other.reek__value
when :flog
self.score != other.score
- when :saikuro
+ when :saikuro
self.complexity != other.complexity
when :stats
- self.stat_value != other.stat_value
+ self.stat_value != other.stat_value
when :churn
self.times_changed != other.times_changed
when :flay
@@ -93,5 +93,5 @@ def modifies?(other)
raise ArgumentError, "Invalid metric type #{self.metric}"
end
end
-
+
end
@@ -5,7 +5,7 @@ module MetricFu
# These are metrics which have been developed for the system. Of
# course, in order to use these metrics, their respective gems must
# be installed on the system.
- AVAILABLE_METRICS = [:churn, :flog, :flay, :reek,
+ AVAILABLE_METRICS = [:churn, :flog, :flay, :reek,
:roodi, :saikuro, :rcov,
:hotspots]
@@ -36,7 +36,7 @@ def self.configuration
#
# == Customization for CruiseControl.rb
#
- # The Configuration class checks for the presence of a
+ # The Configuration class checks for the presence of a
# 'CC_BUILD_ARTIFACTS' environment variable. If it's found
# it will change the default output directory from the default
# "tmp/metric_fu to the directory represented by 'CC_BUILD_ARTIFACTS'
@@ -45,7 +45,7 @@ def self.configuration
#
# The Configuration class checks for several deprecated constants
# that were previously used to configure MetricFu. These include
- # CHURN_OPTIONS, DIRECTORIES_TO_FLOG, SAIKURO_OPTIONS,
+ # CHURN_OPTIONS, DIRECTORIES_TO_FLOG, SAIKURO_OPTIONS,
# and MetricFu::SAIKURO_OPTIONS.
#
# These have been replaced by config.churn, config.flog and
@@ -57,7 +57,7 @@ def initialize #:nodoc:#
add_attr_accessors_to_self
add_class_methods_to_metric_fu
end
-
+
# Searches through the instance variables of the class and
# creates a class method on the MetricFu module to read the value
# of the instance variable from the Configuration class.
@@ -72,9 +72,9 @@ def self.#{method_name}
MetricFu.module_eval(method)
end
end
-
+
# Searches through the instance variables of the class and creates
- # an attribute accessor on this instance of the Configuration
+ # an attribute accessor on this instance of the Configuration
# class for each instance variable.
def add_attr_accessors_to_self
instance_variables.each do |name|
@@ -93,7 +93,7 @@ def add_attr_accessors_to_self
def self.run
yield MetricFu.configuration
end
-
+
# This does the real work of the Configuration class, by setting
# up a bunch of instance variables to represent the configuration
# of the MetricFu app.
@@ -102,23 +102,23 @@ def reset
@scratch_directory = File.join(@base_directory, 'scratch')
@output_directory = File.join(@base_directory, 'output')
@data_directory = File.join('tmp/metric_fu', '_data')
- @metric_fu_root_directory = File.join(File.dirname(__FILE__),
+ @metric_fu_root_directory = File.join(File.dirname(__FILE__),
'..', '..')
- @template_directory = File.join(@metric_fu_root_directory,
- 'lib', 'templates')
+ @template_directory = File.join(@metric_fu_root_directory,
+ 'lib', 'templates')
@template_class = AwesomeTemplate
set_metrics
set_graphs
set_code_dirs
@flay = { :dirs_to_flay => @code_dirs,
:minimum_score => 100,
- :filetypes => ['rb'] }
+ :filetypes => ['rb'] }
@flog = { :dirs_to_flog => @code_dirs }
@reek = { :dirs_to_reek => @code_dirs,
:config_file_pattern => nil}
@roodi = { :dirs_to_roodi => @code_dirs,
:roodi_config => nil}
- @saikuro = { :output_directory => @scratch_directory + '/saikuro',
+ @saikuro = { :output_directory => @scratch_directory + '/saikuro',
:input_directory => @code_dirs,
:cyclo => "",
:filter_cyclo => "0",
@@ -128,10 +128,10 @@ def reset
@churn = {}
@stats = {}
@rcov = { :environment => 'test',
- :test_files => ['test/**/*_test.rb',
+ :test_files => ['test/**/*_test.rb',
'spec/**/*_spec.rb'],
- :rcov_opts => ["--sort coverage",
- "--no-html",
+ :rcov_opts => ["--sort coverage",
+ "--no-html",
"--text-coverage",
"--no-color",
"--profile",
@@ -142,7 +142,7 @@ def reset
@rails_best_practices = {}
@hotspots = {}
@file_globs_to_ignore = []
-
+
@graph_engine = :bluff # can be :bluff or :gchart
end
@@ -163,12 +163,12 @@ def set_metrics
@metrics = MetricFu::AVAILABLE_METRICS
end
end
-
+
def set_graphs
if rails?
@graphs = MetricFu::AVAILABLE_GRAPHS + [:stats]
else
- @graphs = MetricFu::AVAILABLE_GRAPHS
+ @graphs = MetricFu::AVAILABLE_GRAPHS
end
end
@@ -180,11 +180,11 @@ def set_code_dirs
@code_dirs = ['lib']
end
end
-
+
def platform #:nodoc:
return RUBY_PLATFORM
end
-
+
def is_cruise_control_rb?
!!ENV['CC_BUILD_ARTIFACTS']
end
Oops, something went wrong.

0 comments on commit bdd3a40

Please sign in to comment.